How to make your puppy able to load more than 6 .sfs files

How to do things, solutions, recipes, tutorials
Message
Author
R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#21 Post by R-S-H »

Wow.

It took more than a year to solve this and I did never really try to use shinobar's suggestion at previous post.

However, this is solved by now!

After my last post in this thread here, I did some more research on this, but could not find a solution - so, I gave up.

The last weeks I was busy to add the so called "adrv"-option to my private version of LazY Puppy. After succesful work on this -thanks to mavrothal- it came back to me, suddenly, today, a few moments ago.

So, here it is. The Guide to make your puppy able to load more than 6 sfs files at boot up (when using personal storage file). I will show this for a count up to 15 pup_ro(x) directories, which means, the puppy is then able to load 12 sfs files at boot up.

1. Edit the initrd.gz

If you need a tool to edit the initrd.gz, here is Edit-Initrdgz-1.4.pet. Install the PET, copy the initrd.gz to /root and execute the program (must be somewhere in menu utility). This tool opens the init script plus other files in geany. Otherwise open the init script in a text editor.

Then found and edit the following (added pup_ro 10 ... pup_ro15):

Code: Select all

#if same dir exists lower layer, then wipe the opaque file...
[ -d /pup_ro3${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro4${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro5${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro6${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro7${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro8${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro9${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro10${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro11${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro12${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro13${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro14${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro15${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
Then found and edit the following (added pup_ro 10 ... pup_ro15):

Code: Select all

#cpio archive does switch_root, lose the initial-ramfs, so move all mntd...
mkdir -p /pup_new/initrd
mkdir -p /pup_new/initrd/pup_ro1
mkdir -p /pup_new/initrd/pup_ro2
mkdir -p /pup_new/initrd/pup_ro3
mkdir -p /pup_new/initrd/pup_ro4
mkdir -p /pup_new/initrd/pup_ro5
mkdir -p /pup_new/initrd/pup_ro6
mkdir -p /pup_new/initrd/pup_ro7
mkdir -p /pup_new/initrd/pup_ro8
mkdir -p /pup_new/initrd/pup_ro9
mkdir -p /pup_new/initrd/pup_ro10
mkdir -p /pup_new/initrd/pup_ro11
mkdir -p /pup_new/initrd/pup_ro12
mkdir -p /pup_new/initrd/pup_ro13
mkdir -p /pup_new/initrd/pup_ro14
mkdir -p /pup_new/initrd/pup_ro15
mkdir -p /pup_new/initrd/pup_rw
mkdir -p /pup_new/initrd/pup_z
mkdir -p /pup_new/initrd/mnt
mkdir -p /pup_new/initrd/mnt/data
mkdir -p /pup_new/initrd/mnt/dev_ro1
mkdir -p /pup_new/initrd/mnt/dev_ro2
mkdir -p /pup_new/initrd/mnt/dev_save
mkdir -p /pup_new/initrd/mnt/swap
mkdir -p /pup_new/initrd/mnt/tmpfs
mkdir -p /pup_new/initrd/mnt/tmpfs2
mkdir -p /pup_new/initrd/mnt/zdrv
mkdir -p /pup_new/initrd/tmp
Then found and edit the following (changed [ $CNTLOOP -eq 10 ] && break to [ $CNTLOOP -eq 16 ] && break):

Code: Select all

  UMNTRO="" ; EXTRASFSLIST=""
  if [ -s /tmp/EXTRASFSS ];then #100711
   CNTLOOP=4
   for ONEEXTRA in `cat /tmp/EXTRASFSS | tr '\n' ' '`
   do
    ONEBASE="`basename $ONEEXTRA`"
    EXTRASFSLIST="${EXTRASFSLIST}${ONEBASE} " #construct list of actually used.
    losetup /dev/loop${CNTLOOP} $ONEEXTRA
    mount -r -t squashfs -o noatime /dev/loop${CNTLOOP} /pup_ro${CNTLOOP}
    [ $? -eq 0 ] && UMNTRO="${UMNTRO}:/pup_ro${CNTLOOP}=ro"
    CNTLOOP=`expr $CNTLOOP + 1`
    [ $CNTLOOP -eq 16 ] && break
    #...only support adding 3 extra .sfs files, as performance degrades as each layer added.
    #...v410 bugfix, change 6 to 7 so can have 3 sfs files.
    #...w015 change 7 to 10 so can have 6 sfs files.
    #...LazY200 change 10 to 16 so can have 12 sfs files.
   done
  fi
Execute the following script, but first change Init_rd_tmp to the extraction directory of your initrd.gz:

Code: Select all

for i in 11 12 13 14 15 16;
do
	mknod -m664 /root/Init_rd_tmp/dev/loop$i b 7 $i
done
exit 0
Rebuild the initrd.gz and copy back to your boot directory (backup the original!!!)

2. Remaster Puppy

File /etc/MAXEXTRANUM must have included the new max extra sfs files number (in this here example would be 12). You need to take this file manually when option to edit /tmp/etc is given at remaster process!

I can remember editing another file, but currently can't find it and also can't say if it would be needed. Will add this to here as soon as I've found the file...

---

I'm currently running a Save-File-Version of my private LazY Puppy using this feature and having loaded sfs files up to pup_ro28 at boot up! :D

RSH
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#22 Post by R-S-H »

Ok, I've found the file.

The file is: /etc/rc.d/rc.update

Change

Code: Select all

  #v431 added 6 7 8 9
  for LAYERNUM in 3 4 5 6 7 8 9
  do
   [ -f /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/PuppyPin ] && cat /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/PuppyPin >> /root/Choices/ROX-Filer/PuppyPin
   [ -f /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/globicons ] && cat /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/globicons >> /root/Choices/ROX-Filer/globicons
  done
to

Code: Select all

  #v431 added 6 7 8 9
  for LAYERNUM in 3 4 5 6 7 8 9 10 11 12 13 14 15 16
  do
   [ -f /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/PuppyPin ] && cat /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/PuppyPin >> /root/Choices/ROX-Filer/PuppyPin
   [ -f /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/globicons ] && cat /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/globicons >> /root/Choices/ROX-Filer/globicons
  done
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

Post Reply