From e39579a9d0272ef22f42006b0767193b57a1dc2f Mon Sep 17 00:00:00 2001 From: Mandeep Singh Baines Date: Fri, 4 Mar 2011 15:58:57 -0800 Subject: [PATCH] update_kernel: fix to be not rely on kernel command-line This script recently stopped working when we changed the kernel cmdline. Fix to be more robust by using rootdev instead. BUG=12780 TEST=Updated my kernel. Change-Id: I033f670c5db821863441ea1546c382fce3436c01 Review URL: http://codereview.chromium.org/6628027 --- update_kernel.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/update_kernel.sh b/update_kernel.sh index b5cb818b43..6d0e61ba48 100755 --- a/update_kernel.sh +++ b/update_kernel.sh @@ -62,8 +62,12 @@ function learn_device() { # Ask the target what the kernel partition is function learn_partition() { [ -n "${FLAGS_partition}" ] && return - remote_sh cat /proc/cmdline - if echo "${REMOTE_OUT}" | egrep -q "${FLAGS_device}3"; then + ! remote_sh rootdev + if [ "${REMOTE_OUT}" == "/dev/dm-0" ]; then + remote_sh ls /sys/block/dm-0/slaves + REMOTE_OUT="/dev/${REMOTE_OUT}" + fi + if [ "${REMOTE_OUT}" == "${FLAGS_device}3" ]; then FLAGS_partition="${FLAGS_device}2" else FLAGS_partition="${FLAGS_device}4"