mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 06:31:18 +02:00
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
This commit is contained in:
parent
b54301bb9a
commit
e39579a9d0
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user