From 3dd49be938d6b328136ca81e655dbc4b932220e1 Mon Sep 17 00:00:00 2001 From: Evgeniy Ivanov Date: Tue, 31 Jan 2012 15:48:14 +0400 Subject: [PATCH] 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. --- drivers/ramdisk/rc | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) 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 ] -- 2.44.0