Support only new puppies, discard old methods.
Puppy might search all over the place for files, but in the end it uses only files found on PDEV1 and SAVEPART, or as specified with boot parameters.
New basic algorithm:
1. Search for only pup...sfs file, establish PDEV1 based on this search. If it's specified with a boot parameter, look only there.
2. Load pup...sfs file.
3. Look for, and load any found, boot parameter specified other system sfs files.
4. Look for still unfound, and load any found, unspecified other system sfs files on PDEV1.
5. Determine SAVEPART.
6. Umount any partitions that are no longer required.
7. "insmod" any initmodules.
8. find and load savefile/savefolder from SAVEPART, move mountpoint of SAVEPART to /mnt/dev_save, if required.
9. Setup aufs stack.
NOTES:
Do not search for "vmlinuz".
Do not use an IDSTRING, use only filenames.
Only the search for pup...sfs actually loops through partitions.
When searching for pup...sfs, stop once it is found.
When searching for pup...sfs, umount any partitions that do not contain pup...sfs.
Usually, no partition should be mounted more than once.
"other system sfs file" means fdrv, zdrv, ydrv, or adrv.
"pup...sfs" means the main puppy sfs filename as specified in DISTRO_SPECS.
An extra possibility:
The aufs stack could be built after step 6 or built gradualy as each sfs is loaded, using a tmpfs as it's rw layer. This would allow step 7 to use "/pup_new/lib/modules", instead of just zdrv.
Then step 9 would have to replace the tmpfs rw layer with the savefile/savefolder for pupmode=12. (I have sucessfully replaced the rw layer in a test stack. The test stack was not "/".)
Other more minor things:
Let "losetup" provide us with an unused loop device, stop tying to control the number.
Possibly refer to pup...sfs as the pdrv, for consistency with other system sfs's. "pup_ro2" -> "pup_p", "dev_ro2" -> "pdrv".
The latest version of the new "init" script can be downloaded from git-hub with the following command:
Code: Select all
svn export https://github.com/puppylinux-woof-CE/initrd_progs/trunk/0initrd/init
gyro