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:
  SFSSDIR="$SMNTPT"

#[ "$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
[ "$xPSUBDIR" ] && SFSSDIR="${SMNTPT}${xPSUBDIR}"
[ $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:
 EXTRASFSMNTPT="/initrd${PUP_HOME}"

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')"
MSGz='/mnt/home'
#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
MSGz="/mnt/home${xPSUBDIR}"
EXTRASFSMNTPT="/initrd${PUP_HOME}${xPSUBDIR}"
fi
fi
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.

Comments

psubdir
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"118.173.143.54'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"70.131.107.80'Re symlinked SFSs"BarryK"Yes you can. Username: 10 Jul 2010, 11:03
"01717"114.129.167.148'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"118.173.143.54'Re symlinking"BarryK"Yeah, I tend to forget about that, rarely use FAT partitions myself. Username: 10 Jul 2010, 11:50
"01717"59.100.249.158'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"113.53.13.8'extra sfs in subdirectory"Béèm"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"87.64.7.95'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"219.75.240.92'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"114.129.167.148'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
"01717"114.129.167.148'

Tags: woof