X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=functions;h=e9111fe08e9c72e6640a7cca20dfe1e1f88b9449;hb=c9ae07817991aa1a0453811459fb5011c407c40c;hp=bc65448082cb4c697df37d2d6f8e82f2bc5a5a4f;hpb=999f45597a2b2461d43d05b3a4726c29d2eed0ac;p=rrq%2Foverlay-boot.git diff --git a/functions b/functions index bc65448..e9111fe 100644 --- a/functions +++ b/functions @@ -11,6 +11,10 @@ die() { exit 1 } +beginswith() { + [ "$1" != "${1#$2}" ] +} + # Function to setup subhost name and log file subhost_name() { CONFIG="$1" @@ -150,6 +154,17 @@ setup_overlay() { mount --bind $UPPER $LOWER fi + grep ^SHARE= "$CONFIG" | while read A ; do + B="$(echo ${A#SHARE=})" + D="$(realpath "$LOWER$B")" + [ "$D" = "$LOWER" ] && continue + if [ -d "$D" ] ; then + echo bind mount $D onto $LIVE$D + mkdir -p $LIVE$D + mount --bind $D $LIVE$D + fi + done + env CONFIG="$CONFIG" $POSTMOUNT "LIVE" "$UPPER" }