X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;ds=sidebyside;f=functions;h=67ea3ad51b143476c0ba5f3a82bfaa52d438c4ee;hb=018cee4d13bc670479131ae2167dad4824ab1c47;hp=8c1b45c048706c91a2923f451c5065040c0224f6;hpb=7c240a57cac965924a90d04a24473a0387c36089;p=rrq%2Foverlay-boot.git diff --git a/functions b/functions index 8c1b45c..67ea3ad 100644 --- a/functions +++ b/functions @@ -8,7 +8,7 @@ die() { # grab and set a configuration variable # $1 = variable, [ $2 = default .. error otherwise ] config() { - eval $1="$(sed "/^$1=.*/{s|^$1=||;b};d" $CONFIG)" + eval $1="'$(sed "/^$1=.*/{s|^$1=||;b};d" $CONFIG)'" [ -z "$(eval echo "\$$1")" ] || return 0 [ $# -lt 2 ] && die "Missing $1=... in $CONFIG" eval $1="'$2'" @@ -89,13 +89,14 @@ setup_overlay() { # LIVE is the same as LOWER then skip the overlay; just assume # a proper chroot system exists at LIVE. if [ "$LIVE" != "$LOWER" ] ; then - # setup $UPPER/run - mkdir -p "$UPPER/run" - mount -t tmpfs -osize=100M tmpfs "$UPPER/run" - mkdir -p "$UPPER/run/lock" + # sanity check + [ -d "$WORK" ] || die "WORK=$WORK is not a directory" + [ -d "$UPPER" ] || die "UPPER=$UPPER is not a directory" + [ -d "$LOWER" ] || die "LOWER=LOWPER is not a directory" + [ -d "$LIVE" ] || die "LOWER=LOWPER is not a directory" # setup $UPPER/dev mkdir -p "$UPPER/dev" - mount -t tmpfs -osize=100M tmpfs "$UPPER/dev" + mount -t tmpfs -osize=50M tmpfs "$UPPER/dev" mknod -m 622 "$UPPER/dev/console" c 5 1 mknod -m 666 "$UPPER/dev/null" c 1 3 mknod -m 666 "$UPPER/dev/zero" c 1 5