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

Issue 3604001: New utility to tag/stamp image (Closed)

Created:
10 years, 2 months ago by Hung-Te
Modified:
9 years, 7 months ago
Reviewers:
Nick Sanders, gauravsh
CC:
chromium-os-reviews_chromium.org, Randall Spangler, gauravsh, Luigi Semenzato, Bill Richardson
Visibility:
Public.

Description

Add a utility to tag/stamp image There are several procedures in Chrome OS post-processing before being released: stamping, tagging, mod image for URLs, ... and signing. We need an integrated script to handle all the stamping / tagging. This CL can handle empty tag files like /root/.force_update_firmware or /root/.dev_mode. This CL deprecates http://codereview.chromium.org/3421040 and moved script from crosutils to vboot_reference. In the future we may isolate the non-signing post-processing scripts (set_lsb, tag_image, remove_label, ...) into crosutils. BUG=none TEST=manually: (1) Build a general dev image without firmware updates (default behavior of build_image for x86-generic ToT) (2) Enter chroot and then execute: cd ~/trunk/src/platform/vboot_reference/scripts; ./tag_image.sh \ --from ~/trunk/src/build/images/x86-generic/latest/chromiumos_image.bin Expected: output message: Update Firmware: disabled Developer Mode: Enabled (3) ./tag_image.sh --update_firmware=1 --dev_mode=0 \ --from ~/trunk/src//build/images/x86-generic/latest/chromiumos_image.bin Expected: output message: Update Firmware: disabled => Enabled Developer Mode: Enabled => disabled Manually verify: pushd ../../build/images/x86-generic/latest unpack_partitions.sh chromiumos_image.bin sudo mount -o loop,ro part_3 rootfs ls -l rootfs/root/.force_update_firmware # this file should exist ls -l rootfs/root/.dev_mode # this file should NOT exist (i.e., error) sudo umount rootfs (4) ./tag_image.sh --update_firmware=0 --dev_mod=1 \ --from ~/trunk/src/build/images/x86-generic/latest/chromiumos_image.bin Expected: output message: Update Firmware: Enabled => disabled Developer Mode: disabled => Enabled Manually verify: pushd ../../build/images/x86-generic/latest unpack_partitions.sh chromiumos_image.bin sudo mount -o loop,ro part_3 rootfs ls -l rootfs/root/.force_update_firmware # this file should NOT exist (i.e., error) ls -l rootfs/root/.dev_mode # this file should exist sudo umount rootfs Change-Id: I96af3c7201372bb904426d10cff142467a1fa2e7 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=04c00e1

Patch Set 1 #

Patch Set 2 : add shflags in case if the script is not executed in chroot #

Total comments: 18

Patch Set 3 : Remove the 'needs_to_be_regisned' tag when resigning (i.e., update rootfs hash) #

Total comments: 6

Patch Set 4 : Fix typo and improve comments #

Patch Set 5 : fix parentheses consisntency #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1228 lines, -1 line) Patch
M scripts/image_signing/common.sh View 2 4 chunks +48 lines, -0 lines 0 comments Download
A scripts/image_signing/lib/shflags/README.chromium View 1 chunk +1 line, -0 lines 0 comments Download
A scripts/image_signing/lib/shflags/shflags View 1 chunk +1009 lines, -0 lines 0 comments Download
M scripts/image_signing/sign_official_build.sh View 3 4 2 chunks +12 lines, -1 line 0 comments Download
A scripts/image_signing/tag_image.sh View 1 2 3 4 1 chunk +158 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Hung-Te
10 years, 2 months ago (2010-09-30 03:58:39 UTC) #1
gauravsh
http://codereview.chromium.org/3604001/diff/3001/4004 File scripts/image_signing/tag_image.sh (right): http://codereview.chromium.org/3604001/diff/3001/4004#newcode15 scripts/image_signing/tag_image.sh:15: DEFINE_boolean enable_update_firmware ${FLAGS_FALSE} \ could we combine these 2 ...
10 years, 2 months ago (2010-09-30 04:28:48 UTC) #2
Hung-Te
http://codereview.chromium.org/3604001/diff/3001/4004 File scripts/image_signing/tag_image.sh (right): http://codereview.chromium.org/3604001/diff/3001/4004#newcode15 scripts/image_signing/tag_image.sh:15: DEFINE_boolean enable_update_firmware ${FLAGS_FALSE} \ It was made as 2 ...
10 years, 2 months ago (2010-09-30 07:48:00 UTC) #3
gauravsh
lgtm with some minor nits. Thanks Hung-Te! http://codereview.chromium.org/3604001/diff/8001/9004 File scripts/image_signing/sign_official_build.sh (right): http://codereview.chromium.org/3604001/diff/8001/9004#newcode130 scripts/image_signing/sign_official_build.sh:130: sudo umount ...
10 years, 2 months ago (2010-09-30 07:59:43 UTC) #4
Hung-Te
10 years, 2 months ago (2010-09-30 08:13:08 UTC) #5
http://codereview.chromium.org/3604001/diff/8001/9004
File scripts/image_signing/sign_official_build.sh (right):

http://codereview.chromium.org/3604001/diff/8001/9004#newcode130
scripts/image_signing/sign_official_build.sh:130: sudo umount "${rootfs_dir}"
On 2010/09/30 07:59:44, gauravsh wrote:
> -d here to free the loop device

Done.

http://codereview.chromium.org/3604001/diff/8001/9004#newcode134
scripts/image_signing/sign_official_build.sh:134: sudo umount "${rootfs_dir}"
On 2010/09/30 07:59:44, gauravsh wrote:
> -d

Done.

http://codereview.chromium.org/3604001/diff/8001/9005
File scripts/image_signing/tag_image.sh (right):

http://codereview.chromium.org/3604001/diff/8001/9005#newcode86
scripts/image_signing/tag_image.sh:86: if [ "$do_enable" = ${FLAGS_TRUE} ]; then
On 2010/09/30 07:59:44, gauravsh wrote:
> nit: for consistency enclose var names within parentheses { }
> 
> Same comment for the rest of the file.

Done.

Powered by Google App Engine
This is Rietveld 408576698