From f5d10846463f9fa542131b7ffd643869f48dd2c7 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 18 Aug 2013 14:02:59 +0200 Subject: [PATCH] initrd.scripts: make rootdev_init use find_real_device --- defaults/initrd.scripts | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 12d4e37..87f1398 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1936,28 +1936,12 @@ rootdev_init() { case "${REAL_ROOT}" in LABEL=*|UUID=*) - ROOT_DEV="" - retval=1 - - if [ ${retval} -ne 0 ]; then - ROOT_DEV=$(findfs "${REAL_ROOT}" 2>/dev/null) - retval=$? - fi - - if [ ${retval} -ne 0 ]; then - ROOT_DEV=$(busybox findfs "${REAL_ROOT}" 2>/dev/null) - retval=$? - fi - - if [ ${retval} -ne 0 ]; then - ROOT_DEV=$(blkid -o device -l -t "${REAL_ROOT}") - retval=$? - fi - - if [ ${retval} -eq 0 ] && [ -n "${ROOT_DEV}" ]; then - good_msg "Detected real_root=${ROOT_DEV}" - REAL_ROOT="${ROOT_DEV}" + local root_dev=$(find_real_device "${REAL_ROOT}") + if [ -n "${root_dev}" ]; then + REAL_ROOT="${root_dev}" + good_msg "Detected root: ${REAL_ROOT}" else + bad_msg "Unable to resolve root: ${REAL_ROOT}" prompt_user "REAL_ROOT" "root block device" got_good_root=0 continue