To load a SFS to a top Layer I've used a modified version of a script by mikeb for years, in Puppies from Lucid up to Tahr. To load a SFS to a top Layer is the only way to update scripts/programs in main SFS without to install a PET package.
Nowadays, e.g. in Bionic Beaver Puppy this doesn't work anymore.
The code used (the line causing the trouble is marked in red color):
It complains about the argument / when trying to mount unionfs to /.#!/bin/bash -a
#------------------------------------------------------------------------------
# Simple but useful Script to load/unload SFS Modules - original by: mikeb
# Modified for compatibility to shinobar's sfs_load
# 2016-10-19 RSH for T.O.P.L.E.S.S., Scripting Library and LazY Puppy
#------------------------------------------------------------------------------
# Sort out submitted commands to be compatible to shinobar's sfs_load
DOFIXMENUS="true"
QUIET="false"
ACTION="load"
# Taken from my modified sfs_load version 1.3.9
while [ "$1" ] ; do
case "$1" in
-s|--skip-fixmenus) DOFIXMENUS="false" ;;
-u|--un*) ACTION="unload" ;;
-c|--cli) GUI="" ;;
-q|--quiet) QUIET="true" ;;
*) break;;
esac
shift
done
MODULE="$1"
MODE="$ACTION"
NAME="`basename $MODULE | tr ' ' '_' `" # Remove spaces for later...easier life
#if [[ "`mount | grep "$NAME "`" = "" && "$ACTION" = "load" ]]; then
if [[ "$ACTION" = "load" ]]; then
# Makes nodes if all used
NEXT=$(losetup -f 2>/dev/null)
if [ "$NEXT" = "" ]; then
NR=$(find /dev/loop* | cut -b 10- | sort -n | tail -1)
NR=$(expr $NR + 1)
NEXT=/dev/loop$NR
mknod $NEXT b 7 $NR 2>/dev/null
fi
mkdir -p /initrd/$NAME
mount-FULL -o loop -t squashfs "$MODULE" /initrd/$NAME
busybox mount -t aufs -o remount,add:1:/initrd/$NAME=ro unionfs /
if [ $? -eq 0 ]; then
if [ "$DOFIXMENUS" = "true" ]; then
[ "`pidof X`" != "" ] && fixmenus
[ "`pidof X`" != "" ] && touch /root/.config/xfce4/desktop/menu.xml
if [ "$QUIET" = "false" ]; then
[ "`pidof X`" != "" ]&& Xdialog --timeout 3 --msgbox "Inserted $NAME" 5 40
fi
echo "Inserted $NAME"
fi
exit
fi
########################################################################
#elif [[ "`mount | grep "$NAME "`" != "" || "$ACTION" = "unload" ]]; then
elif [[ "$ACTION" = "unload" ]]; then
########################################################################
busybox mount -t aufs -o remount,del:/initrd/$NAME unionfs /
busybox umount /initrd/$NAME
rmdir /initrd/$NAME
if [ $? -eq 0 ]; then
if [ "$DOFIXMENUS" = "true" ]; then
[ "`pidof X`" != "" ] && fixmenus
[ "`pidof X`" != "" ] && touch /root/.config/xfce4/desktop/menu.xml
if [ "$QUIET" = "false" ]; then
[ "`pidof X`" != "" ]&& Xdialog --timeout 3 --msgbox "Removed $NAME" 5 40
fi
echo "Removed $NAME"
fi
exit
fi
fi
if [ "$QUIET" = "false" ]; then
[ "`pidof X`" != "" ]&& Xdialog --timeout 3 --msgbox "Unable to $MODE $NAME" 5 40
fi
echo "Unable to $MODE $NAME"
exit 0
I need this for real, so how can I fix this?
Thanks