The time now is Thu 21 Feb 2019, 00:06
All times are UTC - 4 |
Author |
Message |
ITSMERSH

Joined: 02 May 2018 Posts: 830
|
Posted: Wed 16 May 2018, 14:19 Post subject:
Loading a SFS to a top Layer Subject description: Loading above the Puppy's main SFS |
|
Hi.
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):
Quote: | #!/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
|
It complains about the argument / when trying to mount unionfs to /.
I need this for real, so how can I fix this?
Thanks
_________________ RSH
|
Back to top
|
|
 |
s243a
Joined: 02 Sep 2014 Posts: 1337
|
Posted: Wed 16 May 2018, 14:44 Post subject:
|
|
Maybey neither the busybox or the unionfs / in the statement is required. From the /initrd/init script:
Code: |
if [ "$ONE_PREP" ];then
echo "mount -o remount,add:1:$ONE_LAYER /pup_new" #debug
mount -o remount,add:1:$ONE_LAYER /pup_new
[ $? -eq 0 ] || return 5
else
|
https://github.com/puppylinux-woof-CE/woof-CE/blob/c96d661c2232caef1d69c693de673fb0e54796f8/initrd-progs/0initrd/init#L421
|
Back to top
|
|
 |
fredx181

Joined: 11 Dec 2013 Posts: 3701 Location: holland
|
Posted: Wed 16 May 2018, 14:51 Post subject:
|
|
ITSMERSH wrote: | The code used (the line causing the trouble is marked in red color):
.....
busybox mount -t aufs -o remount,add:1:/initrd/$NAME=ro unionfs / |
Maybe try this instead:
Code: | mount-FULL -n -o remount,add:1:/initrd/$NAME=rr+wh aufs / |
Or:
Code: | mount-FULL -n -o remount,add:1:/initrd/$NAME=rr aufs / |
Fred
_________________ Dog Linux website
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
[ Time: 0.0350s ][ Queries: 11 (0.0043s) ][ GZIP on ] |