Extra SFSs in a sub-directory

Iguleder posted about this. Yes, it is a good idea. If you have your 'pupsave' file in a subdirectory, as you normally do with a frugal installation, it is much more tidy if the extra SFS files also reside in that subdirectory. It avoids confusion of lots of them all at the top '/'.

I have modified the 'init' script like this:

#[ "$PSUBDIR" ] && SFSSDIR="${SMNTPT}/${PSUBDIR}" #100710
#100710 no, don't rely on psubdir boot param, more generic solution...
xPSUBDIR="`echo -n "$PUPSAVE" | cut -f 3 -d ',' | sed -e 's%/[^/]*$%%'`" #ex: sda3,ext2,/pup220/spupsave.2fs will return /pup220
[ $PUPMODE -eq 77 ] && SFSSDIR="$DESTDIR" #v3.97

...this does not rely upon the existence of a "psubdir" kernel boot parameter. Instead, it looks at the PUPSAVE variable (see /etc/rc.d/PUPSTATE) and determines if the 'pupsave' file is in a sub-directory.

The Boot Manager (usr/sbin/bootmanager) also had to be modified:

xHOMEPART="$PDEV1" #100518
[ "$PUPSAVE" ] && xHOMEPART="`echo -n "$PUPSAVE" | cut -f 1 -d ','`" #100518
#MSGx="Note2: These files are at /mnt/home (same as '${DISTRO_FILE_PREFIX}save')"
#100710 if pupsave is in a subdirectory, only look in that...
if [ "$PUPSAVE" ];then #this test probably not needed
xPSUBDIR="`echo -n "$PUPSAVE" | cut -f 3 -d ',' | sed -e 's%/[^/]*$%%'`" #ex: sda3,ext2,/pup220/spupsave.2fs will return /pup220
if [ "$xPSUBDIR" ];then
MSGx="Note2: These files are at ${MSGz} (in ${xHOMEPART} partition)" #100221 100518 100710

I haven't tested it yet. This will be in the next upload of Woof.

Posted on 10 Jul 2010, 9:50


Posted on 10 Jul 2010, 10:32 by aarf
"This makes your Puppy load SFS from /mnt/home/<psubdir>, but ONLY from there"

do you then need to have a separate say googleearth.sfs in all your psubdirectories? one in each puppy?

Posted on 10 Jul 2010, 10:51 by lwill
Can you symlink to an SFS?
Put common ones in a seperate directory and symlink to them in each puppy psubdir?

Posted on 10 Jul 2010, 11:03 by BarryK
Re symlinked SFSs
Yes you can.

Posted on 10 Jul 2010, 11:09 by aarf
symlink fat32 no can do
yes you can symlink IF it is not a fat32 partition like my main sdcard that i boot from

Posted on 10 Jul 2010, 11:50 by BarryK
Re symlinking
Yeah, I tend to forget about that, rarely use FAT partitions myself.

Posted on 10 Jul 2010, 23:16 by aarf
load sfs from two locations?
is it much of a problem to load sfs from two locations both /mnt/home and /mnt/home/<psubdir>

Posted on 11 Jul 2010, 4:10 by Bm
extra sfs in subdirectory
I hope it doesn't corrupt the actual way of operating. Having one sfs in /mnt/home which can be shared amongst different puppy's.

Posted on 11 Jul 2010, 7:32 by shinobar
both home and subdir
Japanese edition reads additional sfs both from /mnt/home and from /mnt/home/<psubdir>.
It is quite simple gyro's idea.
#v424 modified to only load selection made in BootManager...

if [ "$EXTRASFSLIST" != "" ];then #in /etc/rc.d/BOOTCONFIG
#v430jp-sp1 lookup extra sfs files along bootmanager selected

and the bootmanager extrasfs_func():
# 02jul09 lookup the same folder of sfsfile

SFSFILE=$(echo $PUPSFS|cut -d',' -f3)
SFSFOLDER=$(dirname $SFSFILE |cut -c2-)
#ALLSFSLIST="`ls -1 *.sfs $MORE| grep -v '^z' | grep -v '^pup_' | grep -v "^${DISTRO_FILE_PREFIX}\-[0-9][0-9][0-9]\.sfs$" | grep -v ^${DISTRO_FILE_PREFIX}[rz]" | grep '\.sfs$' | tr "\n" " "`"
for ONEFILE in $(ls *.sfs $MORE)
basename "$ONEFILE" | grep -q -E "^(z|pup_|${DISTRO_FILE_PREFIX}\-[0-9][0-9][0-9]|${DISTRO_FILE_PREFIX}[rx])" || ALLSFSLIST="$ALLSFSLIST $ONEFILE"

Posted on 11 Jul 2010, 8:25 by BarryK
code query
I don't understand the code you have posted. Yes, the BootManager will offer SFSs in both locations, but in the init script your line starting with
will only see SFSs at the top directory?

Posted on 11 Jul 2010, 9:37 by BarryK
Extra SFS loading
Ok, I have modified those two scripts so that they now will load SFSs from both top dir and the subdirectory.