Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/scripts/build_gpt.sh

Issue 1567013: Clean up temporary files and directories left by build_image, etc. (Closed)
Patch Set: Emit scripts to pack/unpack the image. Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/scripts/build_image » ('j') | src/scripts/emit_gpt_scripts.sh » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 # 6 #
7 # Load common constants. This should be the first executable line. 7 # Load common constants. This should be the first executable line.
8 # The path to common.sh should be relative to your script's location. 8 # The path to common.sh should be relative to your script's location.
9 . "$(dirname "$0")/common.sh" 9 . "$(dirname "$0")/common.sh"
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if [[ -x "$MKIMAGE" ]]; then 123 if [[ -x "$MKIMAGE" ]]; then
124 MBR_SCRIPT_UIMG="${MBR_SCRIPT}.uimg" 124 MBR_SCRIPT_UIMG="${MBR_SCRIPT}.uimg"
125 "$MKIMAGE" -A "${ARCH}" -O linux -T script -a 0 -e 0 -n "COS boot" \ 125 "$MKIMAGE" -A "${ARCH}" -O linux -T script -a 0 -e 0 -n "COS boot" \
126 -d ${MBR_SCRIPT} ${MBR_SCRIPT_UIMG} 126 -d ${MBR_SCRIPT} ${MBR_SCRIPT_UIMG}
127 MBR_IMG=${IMAGEDIR}/mbr.img 127 MBR_IMG=${IMAGEDIR}/mbr.img
128 dd bs=1 count=`stat --printf="%s" ${MBR_SCRIPT_UIMG}` \ 128 dd bs=1 count=`stat --printf="%s" ${MBR_SCRIPT_UIMG}` \
129 if="$MBR_SCRIPT_UIMG" of="$MBR_IMG" conv=notrunc 129 if="$MBR_SCRIPT_UIMG" of="$MBR_IMG" conv=notrunc
130 hexdump -v -C "$MBR_IMG" 130 hexdump -v -C "$MBR_IMG"
131 else 131 else
132 echo "Error: u-boot mkimage not found or not executable." 132 echo "Error: u-boot mkimage not found or not executable."
133 exit 1
133 fi 134 fi
134 PMBRCODE=${MBR_IMG} 135 PMBRCODE=${MBR_IMG}
135 else 136 else
136 PMBRCODE=$(readlink -f /usr/share/syslinux/gptmbr.bin) 137 PMBRCODE=$(readlink -f /usr/share/syslinux/gptmbr.bin)
137 fi 138 fi
138 139
139 # Create the GPT. This has the side-effect of setting some global vars 140 # Create the GPT. This has the side-effect of setting some global vars
140 # describing the partition table entries (see the comments in the source). 141 # describing the partition table entries (see the comments in the source).
141 install_gpt $OUTDEV $ROOTFS_IMG $KERNEL_IMG $STATEFUL_IMG $PMBRCODE 142 install_gpt $OUTDEV $ROOTFS_IMG $KERNEL_IMG $STATEFUL_IMG $PMBRCODE
142 143
144 # Emit helpful scripts for testers, etc.
145 ${SCRIPTS_DIR}/emit_gpt_scripts.sh "${OUTDEV}" "${IMAGEDIR}"
146
143 # Now populate the partitions. 147 # Now populate the partitions.
144 echo "Copying stateful partition..." 148 echo "Copying stateful partition..."
145 dd if=${STATEFUL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_STATEFUL} 149 dd if=${STATEFUL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_STATEFUL}
146 150
147 echo "Copying kernel..." 151 echo "Copying kernel..."
148 dd if=${KERNEL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_KERN_A} 152 dd if=${KERNEL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_KERN_A}
149 153
150 echo "Copying rootfs..." 154 echo "Copying rootfs..."
151 dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ROOTFS_A} 155 dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ROOTFS_A}
152 156
157 # Clean up temporary files.
158 if [[ -n "${MBR_IMG:-}" ]]; then
159 rm "${MBR_IMG}"
160 fi
OLDNEW
« no previous file with comments | « no previous file | src/scripts/build_image » ('j') | src/scripts/emit_gpt_scripts.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698