From 93b6effb0bf977d74d391ae2b9a9d2c217ea4ee3 Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Wed, 18 May 2011 17:21:13 +0800 Subject: [PATCH] arm: kernel cmdline use root=PARTUUID=UUID/PARTNROFF=%d Since now the arm firmware can parse %U as x86 bios, and kernel can parse PARTNROFF=%d, we are able to generate kernel command line with such construct. BUG=chromium-os:14022,15683 TEST=manual 1. Build image with root filesystem verification turns off 2. Boot successfully 3. Run 'cat /proc/cmdline' and validate its output 4. Run 'rootdev' and validate its output Change-Id: I11de0a30928efe9d9b0149feb3389a2f30063516 Reviewed-on: http://gerrit.chromium.org/gerrit/1104 Tested-by: Che-Liang Chiou Reviewed-by: Reviewed-by: Che-Liang Chiou --- bin/cros_make_image_bootable | 8 ++------ build_kernel_image.sh | 2 +- mod_image_for_recovery.sh | 5 +---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/bin/cros_make_image_bootable b/bin/cros_make_image_bootable index 1c2bccbd03..185be73c9b 100755 --- a/bin/cros_make_image_bootable +++ b/bin/cros_make_image_bootable @@ -157,12 +157,8 @@ make_image_bootable() { local image="$1" local use_dev_keys= - # Default to non-verified, non-UUID boot unless verified. - # Long term we want root=PARTUUID=uuid+1. - cros_root=/dev/sd%D%P - if [[ "${FLAGS_arch}" = "arm" ]]; then - cros_root='/dev/${devname}${rootpart}' - fi + # Default to non-verified + cros_root="PARTUUID=%U/PARTNROFF=1" if [[ ${FLAGS_enable_rootfs_verification} -eq ${FLAGS_TRUE} ]]; then cros_root=/dev/dm-0 fi diff --git a/build_kernel_image.sh b/build_kernel_image.sh index 64299d68f6..073649540a 100755 --- a/build_kernel_image.sh +++ b/build_kernel_image.sh @@ -54,7 +54,7 @@ DEFINE_string boot_args "noinitrd" \ # By default, we use a firmware enumerated value, but it isn't reliable for # production use. If +%d can be added upstream, then we can use: # root=PARTUID=uuid+1 -DEFINE_string root "/dev/sd%D%P" \ +DEFINE_string root "PARTUUID=%U/PARTNROFF=1" \ "Expected device root partition" # If provided, will automatically add verified boot arguments. DEFINE_string rootfs_image "" \ diff --git a/mod_image_for_recovery.sh b/mod_image_for_recovery.sh index 12d54400ba..8248caa865 100755 --- a/mod_image_for_recovery.sh +++ b/mod_image_for_recovery.sh @@ -215,10 +215,7 @@ create_recovery_kernel_image() { trap "sudo losetup -d $root_dev" EXIT - cros_root=/dev/sd%D%P # only used for non-verified images - if [[ "${ARCH}" = "arm" ]]; then - cros_root='/dev/${devname}${rootpart}' - fi + cros_root="PARTUUID=%U/PARTNROFF=1" # only used for non-verified images if grep -q enable_rootfs_verification "${IMAGE_DIR}/boot.desc"; then cros_root=/dev/dm-0 fi