site  contact  subhomenews

Extra SFSs in a sub-directory

July 10, 2010 — BarryK
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.


Username: 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?"10 Jul 2010, 10:32"01717"'symlink?"lwill"Can you symlink to an SFS? Put common ones in a seperate directory and symlink to them in each puppy psubdir?"10 Jul 2010, 10:51"01717"'Re symlinked SFSs"BarryK"Yes you can. Username: 10 Jul 2010, 11:03
"01717"'symlink fat32 no can do"aarf"yes you can symlink IF it is not a fat32 partition like my main sdcard that i boot from"10 Jul 2010, 11:09"01717"'Re symlinking"BarryK"Yeah, I tend to forget about that, rarely use FAT partitions myself. Username: 10 Jul 2010, 11:50
"01717"'load sfs from two locations?"aarf"is it much of a problem to load sfs from two locations both /mnt/home and /mnt/home/<psubdir>"10 Jul 2010, 23:16"01717"'extra sfs in subdirectory"Bm"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."11 Jul 2010, 4:10"01717"'both home and subdir"shinobar"Japanese edition reads additional sfs both from /mnt/home and from /mnt/home/<psubdir>. It is quite simple gyro's idea. [code]#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 #gyro for ONEEXTRA in $EXTRASFSLIST do [ -f "$SFSSDIR/$ONEEXTRA" ] && echo "$SFSSDIR/$ONEEXTRA" >> /tmp/EXTRASFSS #gyro done fi[/code] and the bootmanager extrasfs_func(): [code]# 02jul09 lookup the same folder of sfsfile MORE="" SFSFILE=$(echo $PUPSFS|cut -d',' -f3) SFSFOLDER=$(dirname $SFSFILE |cut -c2-) [ "$SFSFOLDER" ] && MORE="$SFSFOLDER/*.sfs" #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" " "`" ALLSFSLIST="" for ONEFILE in $(ls *.sfs $MORE) do basename "$ONEFILE" | grep -q -E "^(z|pup_|${DISTRO_FILE_PREFIX}\-[0-9][0-9][0-9]|${DISTRO_FILE_PREFIX}[rx])" || ALLSFSLIST="$ALLSFSLIST $ONEFILE" done[/code] Username: 11 Jul 2010, 7:32
"01717"'code query"BarryK"shinobar, 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 [ -f "$SFSSDIR/$ONEEXTRA" ] will only see SFSs at the top directory? Username: 11 Jul 2010, 8:25
"01717"'Extra SFS loading"BarryK"Ok, I have modified those two scripts so that they now will load SFSs from both top dir and the subdirectory. Username: 11 Jul 2010, 9:37

Tags: woof