From 6f6befff9965e0af866bbbadbda1960213ee5bed Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 6 Aug 2013 14:16:30 +0200 Subject: [PATCH] linuxrc: call ensure_initramfs_mounts after mounting ${REAL_ROOT} This makes possible to deal with systemd and separate /usr support as discussed in bug #479730. --- defaults/linuxrc | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/defaults/linuxrc b/defaults/linuxrc index baa367b..66a4dc7 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -443,14 +443,32 @@ do # else not a good root and start over. if [ "$?" = '0' ] then - if [ -d ${NEW_ROOT}/dev -a -x "${NEW_ROOT}${REAL_INIT:-/sbin/init}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ] - then + # now that the root filesystem is mounted, before + # checking the validity of ${NEW_ROOT} and ${REAL_INIT}, + # ensure that ${NEW_ROOT}/etc/initramfs.mounts entries + # are mounted. + ensure_initramfs_mounts + + # NFS does not need further checks here. + if [ "${REAL_ROOT}" = "/dev/nfs" ]; then break - else - bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" - got_good_root=0 - REAL_ROOT='' fi + + if [ ! -d "${NEW_ROOT}/dev" ]; then + _msg="The filesystem ${REAL_ROOT}," + _msg="${_msg} mounted at ${NEW_ROOT}" + _msg="${_msg} does not contain /dev" + _msg="${_msg}, init will likely fail..." + bad_msg "${_msg}" + fi + if [ ! -x "${NEW_ROOT}${REAL_INIT:-/sbin/init}" ]; then + _msg="The filesystem ${REAL_ROOT}," + _msg="${_msg} mounted at ${NEW_ROOT}" + _msg="${_msg} does not contain a valid" + _msg="${_msg} init=${REAL_INIT}" + bad_msg "${_msg}" + fi + break else bad_msg "Could not mount specified ROOT, try again" got_good_root=0 @@ -648,7 +666,8 @@ then CDBOOT=1 fi -# Mount the additional things as required by udev & systemd +# Re-run this here, which makes sure that it at least had a chance +# to be called. ensure_initramfs_mounts splashcmd hasroot "${NEW_ROOT}"