changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: bootrc: fix $rootdir and $rootspec handling (thanks lucio)

changeset 7209: 1209e04a3af9
parent 7208: 40ad429365ef
child 7210: 379e0fe30652
child 7211: b52531f0e5af
author: cinap_lenrek@felloff.net
date: Sun, 05 May 2019 17:02:37 +0200
files: sys/src/9/boot/bootrc
description: 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.
     1.1--- a/sys/src/9/boot/bootrc
     1.2+++ b/sys/src/9/boot/bootrc
     1.3@@ -130,7 +130,7 @@ fn main{
     1.4 	# mount root filesystem
     1.5 	if(~ $#rootdir 0)
     1.6 		rootdir=/root
     1.7-	must mount -c /srv/boot $rootdir
     1.8+	must mount -c '#s/boot' /root $rootspec
     1.9 
    1.10 	# compile init command
    1.11 	if(~ $#init 0){
    1.12@@ -151,7 +151,7 @@ fn main{
    1.13 
    1.14 	# create the name space, mount the root fs
    1.15 	/mnt/broot/$cputype/bin/bind / /
    1.16-	/mnt/broot/$cputype/bin/mount -ac '#s/boot' /
    1.17+	/mnt/broot/$cputype/bin/bind -ac $rootdir /
    1.18 
    1.19 	# remove the remaining temporary root
    1.20 	/mnt/broot/$cputype/bin/unmount /mnt/broot