Puppy Topdog
Posted: Fri 06 Nov 2015, 17:59
Since 'TopDog' variant of puppy doesn't seem to have been used in quite a while (8 years) I'm slipping in within another variant of that same name. More of just a proof of concept at present - that seems to work.
I have a small PXE server installed on my home puppy PC. Most network cards have the option to net boot and PXE server is a means to deliver such boot up capability to other PC's on the same LAN. Some have pushed that further and gPXE from the 'cloud'. Typically to net boot you press the F12 key whilst the PC is first starting up and if set up in the BIOS that will present a bootup screen.
For PXE booting you need just the vmlinuz and initrd.gz file. Similar to when you boot puppy frugally using the likes of grub4dos. So as to pass puppy sfs along with those files you typically drop puppy sfs into the initrd.gz file. To do so I use the commands :
To extract the contents of initrd.gz
mkdir NewDir
cd NewDir
zcat ../initrd.gz | cpio -id
Copy the puppy sfs into that same directory
cp ../puppy*.sfs .
Reform the initrd.gz (note that you probably should make sure you have a copy of the original initrd.gz beforehand)
find | cpio -o -H newc | gzip >../initrd.gz
That new (larger) initrd.gz with the puppy sfs inside it can then be booted using grub4dos or PXE net booted etc. i.e. those same two files (vmlinuz and (larger) initrd.gz can also be used to boot using grub4dos so this isn't a PXE only exclusive concept.
A problem with PXE booting is that it tends to be slow. Better if we can use HTTP instead, at least for part of the bootup process. So I came up with the concept of layering one puppy (topdog) on top of another (underdog). For the underdog I opted to use Wary 5.3 XVesa Baby Barebone http://murga-linux.com/puppy/viewtopic.php?t=83841 which is a barebone XVesa only pup wth very limited functionality, but it does tend to boot straight to desktop and if you're hard wired to the net it also tends to auto connect. Being around a 60MB pup that PXE boots reasonably quickly. I've added code to that to then download a full-blown Puppy Wary 5.5 sfs from my googledrive ... and then sfs load that 5.5 puppy sfs. The only modification to that Wary 5.5 pup is that the Startup folder contents have been deleted as we don't want those to run when the puppy is sfs loaded (as we already have our tray, network ...etc already running in the underdog Wary 5.3 puppy).
CAUTION : I HAVE A FAST INTERNET CONNECTION AND NO BANDWIDTH LIMIT/CHARGE. This isn't for modem dial up (or other slower connections) or if you pay for bandwidth.
The code so far is without error checking and is very first-cut/basic. I simply added the creation of another folder in initrd (that I called linkexec), that contains a single script. That way changing the script is relatively simple i.e. extract the content of initrd.gz, modify the /initrd/linkexec/linkexec.sh script and then reform the initrd.gz file again.
To invoke that script when the underdog Wary 5.3 boots I simply added a call in its Startup folder. To ensure that its called only once per boot rather tha each time a Startup occurs (exit to prompt, xwin back in again) the script /initrd/linkexec/linkexec.sh script deletes the /root/Startup/linkexec.sh script as part of its processing.
The other main job of the script is to 'automatically' download the Wary 5.5 puppy sfs (134MB) from my googledrive (that's accessible to all) which it does using wget. Once downloaded it then sfs_load's that 5.5 puppy sfs (that has no Startup folder content). Thereafter the puppy is running 5.3 Wary XVesa only underdog, with 5.5 Wary full-blown on top and as such has access to Abiword, gNumeric and all of the other features contained within the full blown Wary 5.5. You can even exit to prompt, run xorgwizard and then switch from using XVesa to perhaps nvidia or whatever graphics server.
As I said the code is very weak. For instance there's no checking to see if the network is available before issuing the wget command ... etc. (Currently I've just coded a 30 second wait beforehand to give time for network connection to occur). When (if) the 5.5 Wary puppy sfs is downloaded and being sfs_loaded it prompts for where to run that from - I tend to answer with a use 'RAM' choice. Assuming your PC has a GB or two of ram space then that seems to work fine.
Another thing I've added to the Wary 5.3 XVesa barebone is dbus, together with a get_latest_firefox script in the /root directory. Run that once and it will download and run the latest firefox. To run a second time search down through something like /root/firefox-42.0/opt/firefox Even without 5.5 topdog loaded on top that firefox works ok, views youtubes etc (HTML5). I've even tried out (sfs loaded) local copies of Libre, Skype and master-pdf-editor etc and the underdog worked reasonably well.
Thoughts that come to mind is that with further development (encasing the no error checks etc in current scripts), having a consistent underdog pup that could then be modified to load different topdog pup's by just changing the pointer (where to download the topdog puppy sfs from) would be rather neat. "Hey - try out my topdog located at http://abc.xyz type of thing". The other thought is the HTTP booting the larger part of a PXE booted system is so much faster than local PXE booting a large image. For instance at my network speeds firefox downloads in seconds, whilst the above puppy wary 5.5 full blown sfs takes around 30 seconds to download.
A final word of caution. I've PXE booted several relatively older machines fine using Wary 5.3 XVesa Barebone however one relatively new (year or two) machine boots, but hasn't network nor mouse activated. I guess because of lacking more recent modules/drivers in that (now dated) Wary 5.3, so your mileage may vary. Another problem I've encountered is that XVesa is somewhat temperamental - I just stick with a bulk standard choice of resolution change initially from the 640x480 to 1024x768 and that works for me, but again your mileage may vary - and given the 30 second clock ticking before the current code starts downloading I'd suggest perhaps just booting and sitting back for a while without doing anything for a few minutes and perhaps wait for the sfs load to prompt to popup before moving.
vmlinux (2MB) https://drive.google.com/file/d/0B4MbXu ... sp=sharing
Initrd.gz (56.8MB) https://drive.google.com/file/d/0B4MbXu ... sp=sharing
Currently without appropriate code even though it may have downloaded Wary 5.5 sfs previously there's no detection of that. I haven't tried saving yet and run pfix=ram and opt to not save at the end of each session. Presumably with a savefile then it would already be set to load up fully from the get-go - but currently would start a download anyway despite having the 5.5 sfs already available.
I have a small PXE server installed on my home puppy PC. Most network cards have the option to net boot and PXE server is a means to deliver such boot up capability to other PC's on the same LAN. Some have pushed that further and gPXE from the 'cloud'. Typically to net boot you press the F12 key whilst the PC is first starting up and if set up in the BIOS that will present a bootup screen.
For PXE booting you need just the vmlinuz and initrd.gz file. Similar to when you boot puppy frugally using the likes of grub4dos. So as to pass puppy sfs along with those files you typically drop puppy sfs into the initrd.gz file. To do so I use the commands :
To extract the contents of initrd.gz
mkdir NewDir
cd NewDir
zcat ../initrd.gz | cpio -id
Copy the puppy sfs into that same directory
cp ../puppy*.sfs .
Reform the initrd.gz (note that you probably should make sure you have a copy of the original initrd.gz beforehand)
find | cpio -o -H newc | gzip >../initrd.gz
That new (larger) initrd.gz with the puppy sfs inside it can then be booted using grub4dos or PXE net booted etc. i.e. those same two files (vmlinuz and (larger) initrd.gz can also be used to boot using grub4dos so this isn't a PXE only exclusive concept.
A problem with PXE booting is that it tends to be slow. Better if we can use HTTP instead, at least for part of the bootup process. So I came up with the concept of layering one puppy (topdog) on top of another (underdog). For the underdog I opted to use Wary 5.3 XVesa Baby Barebone http://murga-linux.com/puppy/viewtopic.php?t=83841 which is a barebone XVesa only pup wth very limited functionality, but it does tend to boot straight to desktop and if you're hard wired to the net it also tends to auto connect. Being around a 60MB pup that PXE boots reasonably quickly. I've added code to that to then download a full-blown Puppy Wary 5.5 sfs from my googledrive ... and then sfs load that 5.5 puppy sfs. The only modification to that Wary 5.5 pup is that the Startup folder contents have been deleted as we don't want those to run when the puppy is sfs loaded (as we already have our tray, network ...etc already running in the underdog Wary 5.3 puppy).
CAUTION : I HAVE A FAST INTERNET CONNECTION AND NO BANDWIDTH LIMIT/CHARGE. This isn't for modem dial up (or other slower connections) or if you pay for bandwidth.
The code so far is without error checking and is very first-cut/basic. I simply added the creation of another folder in initrd (that I called linkexec), that contains a single script. That way changing the script is relatively simple i.e. extract the content of initrd.gz, modify the /initrd/linkexec/linkexec.sh script and then reform the initrd.gz file again.
To invoke that script when the underdog Wary 5.3 boots I simply added a call in its Startup folder. To ensure that its called only once per boot rather tha each time a Startup occurs (exit to prompt, xwin back in again) the script /initrd/linkexec/linkexec.sh script deletes the /root/Startup/linkexec.sh script as part of its processing.
The other main job of the script is to 'automatically' download the Wary 5.5 puppy sfs (134MB) from my googledrive (that's accessible to all) which it does using wget. Once downloaded it then sfs_load's that 5.5 puppy sfs (that has no Startup folder content). Thereafter the puppy is running 5.3 Wary XVesa only underdog, with 5.5 Wary full-blown on top and as such has access to Abiword, gNumeric and all of the other features contained within the full blown Wary 5.5. You can even exit to prompt, run xorgwizard and then switch from using XVesa to perhaps nvidia or whatever graphics server.
As I said the code is very weak. For instance there's no checking to see if the network is available before issuing the wget command ... etc. (Currently I've just coded a 30 second wait beforehand to give time for network connection to occur). When (if) the 5.5 Wary puppy sfs is downloaded and being sfs_loaded it prompts for where to run that from - I tend to answer with a use 'RAM' choice. Assuming your PC has a GB or two of ram space then that seems to work fine.
Another thing I've added to the Wary 5.3 XVesa barebone is dbus, together with a get_latest_firefox script in the /root directory. Run that once and it will download and run the latest firefox. To run a second time search down through something like /root/firefox-42.0/opt/firefox Even without 5.5 topdog loaded on top that firefox works ok, views youtubes etc (HTML5). I've even tried out (sfs loaded) local copies of Libre, Skype and master-pdf-editor etc and the underdog worked reasonably well.
Thoughts that come to mind is that with further development (encasing the no error checks etc in current scripts), having a consistent underdog pup that could then be modified to load different topdog pup's by just changing the pointer (where to download the topdog puppy sfs from) would be rather neat. "Hey - try out my topdog located at http://abc.xyz type of thing". The other thought is the HTTP booting the larger part of a PXE booted system is so much faster than local PXE booting a large image. For instance at my network speeds firefox downloads in seconds, whilst the above puppy wary 5.5 full blown sfs takes around 30 seconds to download.
A final word of caution. I've PXE booted several relatively older machines fine using Wary 5.3 XVesa Barebone however one relatively new (year or two) machine boots, but hasn't network nor mouse activated. I guess because of lacking more recent modules/drivers in that (now dated) Wary 5.3, so your mileage may vary. Another problem I've encountered is that XVesa is somewhat temperamental - I just stick with a bulk standard choice of resolution change initially from the 640x480 to 1024x768 and that works for me, but again your mileage may vary - and given the 30 second clock ticking before the current code starts downloading I'd suggest perhaps just booting and sitting back for a while without doing anything for a few minutes and perhaps wait for the sfs load to prompt to popup before moving.
vmlinux (2MB) https://drive.google.com/file/d/0B4MbXu ... sp=sharing
Initrd.gz (56.8MB) https://drive.google.com/file/d/0B4MbXu ... sp=sharing
Currently without appropriate code even though it may have downloaded Wary 5.5 sfs previously there's no detection of that. I haven't tried saving yet and run pfix=ram and opt to not save at the end of each session. Presumably with a savefile then it would already be set to load up fully from the get-go - but currently would start a download anyway despite having the 5.5 sfs already available.