+# Function to setup subhost name and log file
+subhost_name() {
+ CONFIG="$1"
+ [ -r "$CONFIG" ] || die "Cannot use $CONFIG"
+ config NAME "$(basename $CONFIG .conf)"
+ config LOG /tmp/oly-$NAME.log
+}
+
+# Function to set up all subhost configuration
+subhost_config() {
+
+ config BASE
+ BASE="$(cd $(dirname $CONFIG); realpath $BASE)"
+ [ -z "$BASE" ] && die "BASE is unset; bogus $CONFIG ?"
+ [ -d "$BASE" ] || die "$BASE is not a directory; bogus $CONFIG ?"
+ cd "$BASE" || die "$BASE is inaccessible"
+
+ config CABLES ""
+ config LIVE "$BASE/live"
+ config UPPER "$BASE/root"
+ config WORK "$BASE/work"
+ config LOWER "/"
+ config START "networking ssh"
+ config PREMOUNT "$PROGRAMDIR/overlay-premount"
+ config POSTMOUNT "$PROGRAMDIR/overlay-postmount"
+ config INIT "$PROGRAMDIR/overlay-init"
+ config RAM_SIZE 50M
+}
+
+# function to reverse the $* words
+reverse() {
+ local OUT=""
+ for w in $* ; do OUT="$w $OUT" ; done
+ echo "${OUT% }"
+}
+