Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 21 Jun 2018, 20:27
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Loading a SFS to a top Layer
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
ITSMERSH


Joined: 02 May 2018
Posts: 114

PostPosted: 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
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1076

PostPosted: 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
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 3099
Location: holland

PostPosted: 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

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.0339s ][ Queries: 14 (0.0051s) ][ GZIP on ]