From: Robin H. Johnson Date: Mon, 20 Feb 2012 06:58:10 +0000 (-0800) Subject: With the new /usr mounting, if the device path that ends up in /proc/mounts ends... X-Git-Tag: v3.4.25~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=995635a2c7fbc6cc6250f697c4977bd2e2f56762;p=genkernel.git With the new /usr mounting, if the device path that ends up in /proc/mounts ends up being different than in /etc/fstab due to symlinks, mount -a will always exit 32. Avoid by resolving symlinks like util-linux does. Signed-off-by: Robin H. Johnson --- diff --git a/ChangeLog b/ChangeLog index e5c391b..4d9f866 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ # Distributed under the GPL v2 # $Id$ + 20 Feb 2012; Robin H. Johnson defaults/linuxrc: + With the new /usr mounting, if the device path that ends up in /proc/mounts + ends up being different than in /etc/fstab due to symlinks, mount -a will + always exit 32. Avoid by resolving symlinks like util-linux does. + 14 Feb 2012; Robin H. Johnson gen_compile.sh, gen_initramfs.sh: dmraid is entirely broken if you try to use the system static diff --git a/defaults/linuxrc b/defaults/linuxrc index 693257f..528f58d 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -544,6 +544,9 @@ do if [ "${REAL_ROOT}" = '/dev/nfs' ]; then findnfsmount else + # If $REAL_ROOT is a symlink + # Resolve it like util-linux mount does + [ -L ${REAL_ROOT} ] && REAL_ROOT=`readlink ${REAL_ROOT}` # mount ro so fsck doesn't barf later if [ "${REAL_ROOTFLAGS}" = '' ]; then good_msg "Using mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE}" @@ -777,6 +780,8 @@ fi for fs in $fslist; do dev=$(get_mount_device $fs) + # Resolve it like util-linux mount does + [ -L ${dev} ] && dev=`readlink ${dev}` # In this case, it's probably part of the filesystem # and not a mountpoint [ -z "$dev" ] && continue