From: Evgeniy Ivanov Date: Tue, 31 Jan 2012 11:48:14 +0000 (+0400) Subject: Allow human readable name for the root device. X-Git-Tag: v3.2.0~66 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=3dd49be938d6b328136ca81e655dbc4b932220e1;p=minix.git 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. --- diff --git a/drivers/ramdisk/rc b/drivers/ramdisk/rc index 2bde8f43f..165dd0217 100644 --- a/drivers/ramdisk/rc +++ b/drivers/ramdisk/rc @@ -28,9 +28,14 @@ fi /bin/service -c edit /sbin/mfs -label fs_imgrd /bin/service up /sbin/procfs || echo "WARNING: couldn't start procfs" -rootdev=`sysenv rootdev` || echo 'No rootdev?' -rootdevname=`/bin/dev2name "$rootdev"` || - { echo 'No device name for root device'; exit 1; } +if /bin/sysenv rootdevname >/dev/null +then + 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 ] then @@ -49,12 +54,18 @@ then loadramdisk "$cddev"p1 elif [ "$rootdevname" = "/dev/ram" ] then - ramimagedev=`sysenv ramimagedev` || - { echo 'ramimagedev not found'; exit 1; } - ramimagename=`/bin/dev2name "$ramimagedev"` || - { echo 'No device name for ramimagedev'; exit 1; } + if /bin/sysenv rootdevname >/dev/null + then + ramimagename=/dev/`/bin/sysenv ramimagename` + 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" - loadramdisk "$ramimagename" + loadramdisk "$ramimagename" || echo "WARNING: loadramdisk failed" fi echo "Root device name is $rootdevname" if [ -e $FSCK ]