projects
/
rrq
/
overlay-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ignore generated files
[rrq/overlay-boot.git]
/
overlay-boot
diff --git
a/overlay-boot
b/overlay-boot
index 239ae1cc7228d4c4a1b06a86b5b44a0e4e336516..f068b43b06fa4ac32168551c331a6974e551b139 100755
(executable)
--- a/
overlay-boot
+++ b/
overlay-boot
@@
-5,12
+5,9
@@
# subhost is defined by a configuration file named on teh command line
[ $(id -u) = 0 ] || exec sudo $0 $@
# subhost is defined by a configuration file named on teh command line
[ $(id -u) = 0 ] || exec sudo $0 $@
-
-. $(dirname $(realpath $0))/functions
-
+. $(dirname $(realpath $0))/functions $*
CONFIG="$1"
[ -r "$CONFIG" ] || die "Missing configuration $CONFIG"
CONFIG="$1"
[ -r "$CONFIG" ] || die "Missing configuration $CONFIG"
-
config NAME $(basename $1 .${1##*.})
config LOG /tmp/oly-$NAME.log
config NAME $(basename $1 .${1##*.})
config LOG /tmp/oly-$NAME.log
@@
-26,6
+23,8
@@
if [ -z "$UNSHARED" ] ; then
fi
config BASE
fi
config BASE
+BASE="$(cd $(dirname $CONFIG); realpath $BASE)"
+
config LIVE "$BASE/live"
config UPPER "$BASE/root"
config WORK "$BASE/work"
config LIVE "$BASE/live"
config UPPER "$BASE/root"
config WORK "$BASE/work"
@@
-50,11
+49,11
@@
trap "exithandler" 0
CMD="unshare -fp --mount-proc ip netns exec $NAME chroot $LIVE /bin/sh"
echo "$CMD"
CMD="unshare -fp --mount-proc ip netns exec $NAME chroot $LIVE /bin/sh"
echo "$CMD"
+
cat <<EOF | $CMD
set -x
cat <<EOF | $CMD
set -x
-mount -
-bind $UPPER/run /run
+mount -
t proc proc /proc
for srv in $START ; do service \$srv start ; done
exec /.reaper $NAME
EOF
echo "EXITED $CMD"
for srv in $START ; do service \$srv start ; done
exec /.reaper $NAME
EOF
echo "EXITED $CMD"
-#echo "$STOP" | ip netns exec $NAME chroot $LIVE $SUBSHELL