initrd.scripts: add is_nfs(), replace ${REAL_ROOT} = /dev/nfs checks

master
Fabio Erculiani 12 years ago
parent 6f6befff99
commit 37121be638

@ -214,6 +214,11 @@ is_livecd() {
return 1 return 1
} }
is_nfs() {
[ "${REAL_ROOT}" = "/dev/nfs" ] && return 0
return 1
}
setup_real_root() { setup_real_root() {
if ! is_livecd if ! is_livecd
then then
@ -1582,8 +1587,7 @@ livecd_init() {
mknod "${NEW_ROOT}/dev/tty1" c 4 1 mknod "${NEW_ROOT}/dev/tty1" c 4 1
fi fi
if [ "${REAL_ROOT}" != "/dev/nfs" ] && \ if ! is_nfs && [ "${LOOPTYPE}" != "sgimips" ]; then
[ "${LOOPTYPE}" != "sgimips" ]; then
bootstrap_cd bootstrap_cd
fi fi

@ -296,7 +296,7 @@ rundebugshell "before setting up the root filesystem"
is_livecd && livecd_init is_livecd && livecd_init
# Determine root device # Determine root device
good_msg 'Determining root device...' good_msg "Determining root device..."
while true while true
do do
while [ "${got_good_root}" != '1' ] while [ "${got_good_root}" != '1' ]
@ -388,8 +388,8 @@ do
prompt_user "REAL_ROOT" "root block device" prompt_user "REAL_ROOT" "root block device"
got_good_root=0 got_good_root=0
# Check for a block device or /dev/nfs # Check for a block device or NFS
elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ] elif [ -b "${REAL_ROOT}" ] || is_nfs
then then
got_good_root=1 got_good_root=1
@ -401,7 +401,7 @@ do
done done
if is_livecd && [ "${got_good_root}" = '1' -a "${REAL_ROOT}" != "/dev/nfs" ] if [ "${got_good_root}" = "1" ] && is_livecd && ! is_nfs
then then
# CD already mounted; no further checks necessary # CD already mounted; no further checks necessary
break break
@ -426,7 +426,7 @@ do
fi fi
# Try to mount the device as ${NEW_ROOT} # Try to mount the device as ${NEW_ROOT}
if [ "${REAL_ROOT}" = '/dev/nfs' ]; then if is_nfs; then
findnfsmount findnfsmount
else else
# mount ro so fsck doesn't barf later # mount ro so fsck doesn't barf later
@ -450,7 +450,7 @@ do
ensure_initramfs_mounts ensure_initramfs_mounts
# NFS does not need further checks here. # NFS does not need further checks here.
if [ "${REAL_ROOT}" = "/dev/nfs" ]; then if is_nfs; then
break break
fi fi
@ -588,8 +588,9 @@ then
# Unpacking additional packages from NFS mount # Unpacking additional packages from NFS mount
# This is useful for adding kernel modules to /lib # This is useful for adding kernel modules to /lib
# We do this now, so that additional packages can add whereever they want. # We do this now, so that additional packages can add whereever
if [ "${REAL_ROOT}" = '/dev/nfs' ] # they want.
if is_nfs
then then
if [ -e "${CDROOT_PATH}/add" ] if [ -e "${CDROOT_PATH}/add" ]
then then

Loading…
Cancel
Save