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

Issue 3916002: cros_make_image_bootable, mount_gpt_image, common.sh: root filesystem changes: ext2, ro by default (Closed)

Created:
10 years, 2 months ago by Will Drewry
Modified:
9 years, 7 months ago
CC:
chromium-os-reviews_chromium.org, Mandeep Singh Baines, anush, sosa, thieule, Hung-Te
Visibility:
Public.

Description

cros_make_image_bootable, mount_gpt_image, common.sh: root filesystem changes: ext2, ro by default This change makes more of the root filesyste metadata static across builds, but more can be done there. It also changes the root filesystem to use ext2 as we don't need journaling in normal mode. Optionally we could use ext3 for non-verified if desired (it's an easy change). In particular, this change cleans up the following: - clears the rootfs uuid - labels it C-ROOT (instead of C-KEYFOB) - removes reserved inodes and blocks The major feature of this change, however, is that it adds two simple helpers to common.sh: disable_rw_mount and enable_rw_mount. They will set high order byte (le) in the ro compat field to be 0xff. This will tell the kernel that the filesystem uses features R24-R31 which are safe for use on the running kernel iff the filesystem is mounted read-only. These functions are called in cros_make_image_bootable and mount_gpt_image, respectively. mount_gpt_image will always enable_rw_mount and cros_make_image_bootable will disable_rw_mount if --enable_rootfs_verification is true. The approach is ugly but reasonably well contained. If ext2 ever gets a new revision and new features in the same range are introduced, then we would be getting inconsistent behavior. That said, it is unlikely that that churmn will happen and if the impact is negative, it will ideally show up during testing. N.B., this will likely result in changes needing to be made to the signing scripts in vboot_reference to ensure that rw mounting is enabled/disabled in the same way (E.g., during stamping). BUG=chromium-os:7468 TEST=- built x86-generic, imaged to usb stick, attempted to mount rw /dev/sdc3 on the host and was properly bounced. - booted to the image just fine on a dogfood device. - mod'd for recovery, then installed and booted. - mod_image_for_test runs with no errors; booted the resulting image as well - booted a factory_install with the pending dm changes - BVT passed with build_image x86-generic (vboot enabled) - [in progress] autotest that checks if the rootdev = /dev/dm-0 and then does a dumpe2fs | grep -q FEATURE_R31

Patch Set 1 #

Patch Set 2 : fix typos, nits, etc #

Total comments: 4

Patch Set 3 : commented the rw/ro trick #

Patch Set 4 : line len #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -9 lines) Patch
M bin/cros_make_image_bootable View 1 chunk +9 lines, -0 lines 0 comments Download
M build_image View 1 2 chunks +14 lines, -7 lines 2 comments Download
M common.sh View 1 2 3 2 chunks +42 lines, -1 line 2 comments Download
M mount_gpt_image.sh View 1 chunk +8 lines, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
Will Drewry
10 years, 2 months ago (2010-10-20 04:25:35 UTC) #1
Will Drewry
added a few extra people to the cc and review list because they are either ...
10 years, 2 months ago (2010-10-20 04:29:54 UTC) #2
Nick Sanders
lg for me w/ addition of comments, gaurav should OK it as well. http://codereview.chromium.org/3916002/diff/4001/5003 File ...
10 years, 2 months ago (2010-10-20 05:56:35 UTC) #3
Bill Richardson
LGTM, once you've documented the magic incantation as Nick suggested. BUT: after this goes in, ...
10 years, 2 months ago (2010-10-20 15:52:48 UTC) #4
Bill Richardson
... and either make or file bugs to make the changes to the other signing ...
10 years, 2 months ago (2010-10-20 15:53:56 UTC) #5
adlr
interesting hack for the ro mount. LGTM
10 years, 2 months ago (2010-10-20 17:37:58 UTC) #6
gauravsh
LGTM (and a very neat hack!) http://codereview.chromium.org/3916002/diff/11001/12002 File build_image (right): http://codereview.chromium.org/3916002/diff/11001/12002#newcode510 build_image:510: -m 0 \ ...
10 years, 2 months ago (2010-10-20 19:06:55 UTC) #7
Will Drewry
http://codereview.chromium.org/3916002/diff/4001/5003 File common.sh (right): http://codereview.chromium.org/3916002/diff/4001/5003#newcode456 common.sh:456: echo -ne '\xff' | On 2010/10/20 05:56:35, Nick Sanders ...
10 years, 2 months ago (2010-10-20 19:11:48 UTC) #8
Will Drewry
10 years, 2 months ago (2010-10-20 20:37:52 UTC) #9
On 2010/10/20 15:53:56, Bill Richardson wrote:
> ... and either make or file bugs to make the changes to the other signing
> scripts that you mentioned. Thanks.

Will do. Need to update chromeos-setimage too.

Powered by Google App Engine
This is Rietveld 408576698