bootrc: fix $rootdir and $rootspec handling (thanks lucio)

we did not interpret the $rootdir and $rootspec environment
variables right. $rootdir is what gets bound to / (usually /root)
and $rootspec is the mountspec of /root.
This commit is contained in:
cinap_lenrek 2019-05-05 17:02:37 +02:00
parent 75d44bc306
commit f22b4ecc77

View file

@ -130,7 +130,7 @@ fn main{
# mount root filesystem # mount root filesystem
if(~ $#rootdir 0) if(~ $#rootdir 0)
rootdir=/root rootdir=/root
must mount -c /srv/boot $rootdir must mount -c '#s/boot' /root $rootspec
# compile init command # compile init command
if(~ $#init 0){ if(~ $#init 0){
@ -151,7 +151,7 @@ fn main{
# create the name space, mount the root fs # create the name space, mount the root fs
/mnt/broot/$cputype/bin/bind / / /mnt/broot/$cputype/bin/bind / /
/mnt/broot/$cputype/bin/mount -ac '#s/boot' / /mnt/broot/$cputype/bin/bind -ac $rootdir /
# remove the remaining temporary root # remove the remaining temporary root
/mnt/broot/$cputype/bin/unmount /mnt/broot /mnt/broot/$cputype/bin/unmount /mnt/broot