Allow human readable name for the root device.

Instead of using rootdev= or ramimagedev= in the boot monitor
which are changed to numbers and cannot be used with other
loaders, rootdevname= or ramimagename= are (MINIX-style)
device names always stored as strings.

Patch by Antoine Leca.
This commit is contained in:
Evgeniy Ivanov 2012-01-31 15:48:14 +04:00 committed by Ben Gras
parent 8979450631
commit 3dd49be938

View File

@ -28,9 +28,14 @@ fi
/bin/service -c edit /sbin/mfs -label fs_imgrd /bin/service -c edit /sbin/mfs -label fs_imgrd
/bin/service up /sbin/procfs || echo "WARNING: couldn't start procfs" /bin/service up /sbin/procfs || echo "WARNING: couldn't start procfs"
rootdev=`sysenv rootdev` || echo 'No rootdev?' if /bin/sysenv rootdevname >/dev/null
rootdevname=`/bin/dev2name "$rootdev"` || then
{ echo 'No device name for root device'; exit 1; } rootdevname=/dev/`/bin/sysenv rootdevname`
else
rootdev=`/bin/sysenv rootdev` || echo 'No rootdev?'
rootdevname=`/bin/dev2name "$rootdev"` ||
{ echo 'No device name for root device'; exit 1; }
fi
if [ "`sysenv bin_img`" = 1 ] if [ "`sysenv bin_img`" = 1 ]
then then
@ -49,12 +54,18 @@ then
loadramdisk "$cddev"p1 loadramdisk "$cddev"p1
elif [ "$rootdevname" = "/dev/ram" ] elif [ "$rootdevname" = "/dev/ram" ]
then then
ramimagedev=`sysenv ramimagedev` || if /bin/sysenv rootdevname >/dev/null
{ echo 'ramimagedev not found'; exit 1; } then
ramimagename=`/bin/dev2name "$ramimagedev"` || ramimagename=/dev/`/bin/sysenv ramimagename`
{ echo 'No device name for ramimagedev'; exit 1; } else
ramimagedev=`/bin/sysenv ramimagedev` ||
{ echo 'ramimagedev not found'; exit 1; }
ramimagename=`/bin/dev2name "$ramimagedev"` ||
{ echo 'No device name for ramimagedev'; exit 1; }
fi
echo "Loading ramdisk from $ramimagename" echo "Loading ramdisk from $ramimagename"
loadramdisk "$ramimagename" loadramdisk "$ramimagename" || echo "WARNING: loadramdisk failed"
fi fi
echo "Root device name is $rootdevname" echo "Root device name is $rootdevname"
if [ -e $FSCK ] if [ -e $FSCK ]