pUPnGO - 6Mb ISO - Basic Building Block Puplet
gabe: I would try TurboPup first - I haven't tested it my self - but if it works its a lot easier than building a desktop on pupngo. If you want to play with pupngo anyway - try the BL3-sfs linked in latest version-post. BL3 has Abiword as an add-on and in one of the external links on the BL3 homepage there is a static build of mplayer. I have tested both and they seem to work.
COPY2RAM
COPY2RAM is hardcoded to be done if RAMSIZE greater than 220Mb. I would like to make this dynamic and depending on the size of pup_412pupngo.sfs. But what should be the minimum size to handle load of kernel and initrd?
Any suggestions? Any rules of thumbs here?
Any suggestions? Any rules of thumbs here?
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Re COPY2RAM:
I posted this to Barry's Blog a while back and he has since integrated it into woof. (See init in latest wary/quirky release) I can check it out when I get back home if you need help locating the code block.
I posted this to Barry's Blog a while back and he has since integrated it into woof. (See init in latest wary/quirky release) I can check it out when I get back home if you need help locating the code block.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
My plan is building a diskless PC that will netboot from my machine and load itself into RAM (only 256 MB available). I'm going to use it for one thing only -Music Player Daemon server.
I think your supermini superawesome pUPnGO is the right thing for this job, right? Any suggestions on this setup? Anything I should worry about? I'm a bit of a noob in console, but I'll learn as I go.
I don't need MPD client on that box, so I guess I don't have to load X?
I'm going to hook up a USB DAC on that box. Would your 4 MB build autodetect such a device? It's using standard USB Audio driver on more common distros (Ubuntu, Mint...), so I guess it's not something too exotic.
I think your supermini superawesome pUPnGO is the right thing for this job, right? Any suggestions on this setup? Anything I should worry about? I'm a bit of a noob in console, but I'll learn as I go.
I don't need MPD client on that box, so I guess I don't have to load X?
I'm going to hook up a USB DAC on that box. Would your 4 MB build autodetect such a device? It's using standard USB Audio driver on more common distros (Ubuntu, Mint...), so I guess it's not something too exotic.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
here is the key code
@xyrion
if you are just wanting to play mp3s you can try minimp3 ... other than that you only need what you need - try the full driver version and use the zdrv cutter
Code: Select all
RAMSIZE=`free | grep 'Mem:' | tr -s ' ' | cut -f 3 -d ' '`
SIZESFSK=`du -k ${PUPSFSDEVMNTPT}${PUPSFSFILE} | cut -f 1`
#need to add a "fudge factor" to the size of the sfs
# ... 32Mb maybe enough ... 16Mb if nox (32768 ... 16384)
if you are just wanting to play mp3s you can try minimp3 ... other than that you only need what you need - try the full driver version and use the zdrv cutter
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Save2CD/DVD and load sfs-files - is that possible?
I am working on an add-on pet containing the missing progs for pupngo to be able to save to CD/DVD. I have never used this save-method myself and I do not see any code making it possible for a saved2cd system to load an additional sfs-file sitting on the CD/DVD...
Is this possible?
Is this possible?
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Re: Save2CD/DVD and load sfs-files - is that possible?
sfs linker?goingnuts wrote:I am working on an add-on pet containing the missing progs for pupngo to be able to save to CD/DVD. I have never used this save-method myself and I do not see any code making it possible for a saved2cd system to load an additional sfs-file sitting on the CD/DVD...
Is this possible?
http://murga-linux.com/puppy/viewtopic.php?t=47976
the package may need some de-roxification and could be much smaller if the ldconfig from uclibc is used and sln is replaced with a script
Code: Select all
#!/bin/sh
#replaces sln - recommend using a static uclibc busybox
busybox ln $@
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
technosaurus: You are swift as always - thanks. Yes, I can mount sfs-files on the cd and do something as the sfs-linker - but my question was if P412 (or other Puppy-versions) running as a save2cd system is able to load any sfs-files on the cd after creating a save folder on the cd (by it self...)
Guess it should be...or are Puppy running only from and saving to CD/DVD not able to use additional sfs-files at all?
Another thing that puzzles me is:
If I burn pUPnGO to a CD-RW and boot, zdrv is not picked up.
If I burn the same image to a DVD_RW and boot, zdrv is picked up.
In both cases copy2ram is used.
If i boot the same CD-RW in a lower-ram system (not copying to ram) zdrv is loaded.
Some timing in initrd? Seems to have something to do with copy2ram and CD-RW....
Guess it should be...or are Puppy running only from and saving to CD/DVD not able to use additional sfs-files at all?
Another thing that puzzles me is:
If I burn pUPnGO to a CD-RW and boot, zdrv is not picked up.
If I burn the same image to a DVD_RW and boot, zdrv is picked up.
In both cases copy2ram is used.
If i boot the same CD-RW in a lower-ram system (not copying to ram) zdrv is loaded.
Some timing in initrd? Seems to have something to do with copy2ram and CD-RW....
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
I never reallylearned all of the pupmodes, perhaps there is a different mode for dvd vs cd? ???
As for the zdrv I guess its size should be used in the copytoram calculations before copy and mount.(instead of just the main sfs)
I like jrb's tcl style linker better than the unionfs setup, because it should work regardless of the install type.... including the cd/dvd mode.
As for the zdrv I guess its size should be used in the copytoram calculations before copy and mount.(instead of just the main sfs)
I like jrb's tcl style linker better than the unionfs setup, because it should work regardless of the install type.... including the cd/dvd mode.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
To be able to save to cd/dvd we have to run in ram (copy2ram in use) - otherwise you can not umount main-sfs or zdrv-sfs. If I deactivate copy2ram for zdrv, zdvr loads fine and main-sfs goes to ram but save2cd is not possible as zdrv-loop-mount is in use.
P412 is not really fit for a zdrv-approach and pupngo is hacked/fixed by using zdrv-code from P431 in initrd - otherwise zdrv is not picked up after creating a frugal-savefile.
I think I have isolated the CD-RW/DVD-RW/copy2ram issue to be happening in the zdrv-code-block:
So problem seems to be that the CR-RW for what ever reason is not able to do the
if the copy2ram-code block is run before it...
I am not presenting the solution - only a status of my debugging findings. Seems that every variable have same value before the code-block is run and do not depend on whether its a CD-RW or a DVD-RW.
Update 131210: Did not find any working solution but below hack secure that modules are loaded from zdrv although save to cd/dvd will be disabled (if installed):
Update 151210: Almost sure now, that the problem only occurs if CD is a defective burn. CD-RW´s that verify the burn works fine whereas CD-RW that do not verify the burn fails in loading zdrv to ram - even though they work fine if you do not copy2ram...
P412 is not really fit for a zdrv-approach and pupngo is hacked/fixed by using zdrv-code from P431 in initrd - otherwise zdrv is not picked up after creating a frugal-savefile.
I think I have isolated the CD-RW/DVD-RW/copy2ram issue to be happening in the zdrv-code-block:
Code: Select all
############pupngo zdrv hack/fix#############
ZLAYER='' #v4.02
ZFACTOR='' #v426
# note, traditionally, loop2 kept free for scripts to use.
if [ "$ZDRVINIT" != "yes" ]; then
# v4.02 if ZDRV located, and mounted, put it into the unionfs...
if [ "$ZDRV" != "" ]; then
ZDEV="`echo "$ZDRV" | cut -f 1 -d ','`"
ZFS="`echo "$ZDRV" | cut -f 2 -d ','`"
ZFILE="`echo "$ZDRV" | cut -f 3 -d ','`"
MNT_ZFILE=""
[ -f /mnt/dev_save${ZFILE} ] && MNT_ZFILE="dev_save"
[ "$MNT_ZFILE" = "" ] && [ -f /mnt/dev_ro2${ZFILE} ] && MNT_ZFILE="dev_ro2"
ZBASENAME="`basename $ZFILE`" #v426 moved up.
if [ "$MNT_ZFILE" != "" ]; then
#w020 do not ever copy it to ram... w460 restore choice...
if [ "$COPY2RAM" = "yes" ]; then #256MB system. note, only checking physical ram.
SIZEZK=`du -k /mnt/${MNT_ZFILE}${ZFILE} | cut -f 1`
SIZEZK=`expr $SIZEZK + 1000` #some slack.
mount -t tmpfs -o size=${SIZEZK}k tmpfs /mnt/tmpfs2
cp -af /mnt/${MNT_ZFILE}${ZFILE} /mnt/tmpfs2/
sync
losetup /dev/loop3 /mnt/tmpfs2/${ZBASENAME}
else
losetup /dev/loop3 /mnt/${MNT_ZFILE}${ZFILE}
fi
mount -r -t squashfs -o noatime /dev/loop3 /pup_z
if [ $? -eq 0 ];then
ZLAYER=':/pup_z=ro'
ZFACTOR="$ZBASENAME" #v426
else #added debug code - this is where cd/dvd difference happens
echo "" > /dev/console
echo "debug - CD_RW ends up here if copy2ram is done" > /dev/console
echo "debug - DVD_RW do not..." > /dev/console
read dummy
fi
fi
fi
fi
############hack end##################
Code: Select all
mount -r -t squashfs -o noatime /dev/loop3 /pup_z
I am not presenting the solution - only a status of my debugging findings. Seems that every variable have same value before the code-block is run and do not depend on whether its a CD-RW or a DVD-RW.
Update 131210: Did not find any working solution but below hack secure that modules are loaded from zdrv although save to cd/dvd will be disabled (if installed):
Code: Select all
mount -r -t squashfs -o noatime /dev/loop3 /pup_z
if [ $? -eq 0 ]; then
ZLAYER=':/pup_z=ro'
else #no copy2ram hack
losetup -d /dev/loop3
umount /mnt/tmpfs2
sync
losetup /dev/loop3 /mnt/${MNT_ZFILE}${ZFILE}
mount -r -t squashfs -o noatime /dev/loop3 /pup_z
ZLAYER=':/pup_z=ro'
echo -en "\\033[1;31m" >/dev/console #31=red
echo "">/dev/console
echo "Could not load modules into ram. Save to CD/DVD disabled" >/dev/console
echo "if installed - try burning iso to another media to fix..." > /dev/console
echo -en "\\033[0;39m" >/dev/console
fi
Updates
Attached extended versions of pkgstall/pkgremove [pupngo041210_SP2.pet] install/remove pet, sfs, tgz, rpm and deb-files. Nice to have if you want to try the bl3dressup or your own home brewed dress-up-sfs´s...Install this before pupngo041210_SP3.pet.
Also attached pupngo041210_SP3.pet - Save to CD or DVD (RW-types). Approx. 1200Kb installed...but I cheated - used upx on the binaries. Contains static build of the programs needed and updated versions of functions4puppy and rc.shutdown. Additional - burnisotools.sh - is included - burn iso´s to CD/DVD_RW. Please read previous post - its important that your burn verify if zdrv should succeed to load in ram.
Also attached pupngo041210_SP3.pet - Save to CD or DVD (RW-types). Approx. 1200Kb installed...but I cheated - used upx on the binaries. Contains static build of the programs needed and updated versions of functions4puppy and rc.shutdown. Additional - burnisotools.sh - is included - burn iso´s to CD/DVD_RW. Please read previous post - its important that your burn verify if zdrv should succeed to load in ram.
- Attachments
-
- pupngo041210_SP2.pet
- Extended version of pkgstall/pkgremove. Install/remove pet, sfs, tgz, rpm and deb-files
- (4.65 KiB) Downloaded 314 times
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Sorry I couldn't help out with the save2cd thing - I never use it, but you got me thinking about the possibility of a better way.
1. mount any and all sfs using methods from jrb's sfs/tcz linker
2. Mount a new save file during startup (a compressed 2fs file stored in the initrd)
3. On shutdown (or at the users request ... at a later date) convert to an sfs file and save to disk (or not, if the user declines) with a number suffix XX (one greater than the highest already on disk)
4. On subsequent reboots all the sfs files are loaded, then the save files (in order) and finally a new save file from a compressed .2fs in initrd
(May need to have a couple different sizes of 2fs.bz2 for low ram machines and for those who may want to store more since they need to be mounted in ram .../tmp or /dev/shm would work ... or to disk if insufficient ram)
Note 2fs compresses much better than 3fs or 4fs
1. mount any and all sfs using methods from jrb's sfs/tcz linker
2. Mount a new save file during startup (a compressed 2fs file stored in the initrd)
3. On shutdown (or at the users request ... at a later date) convert to an sfs file and save to disk (or not, if the user declines) with a number suffix XX (one greater than the highest already on disk)
4. On subsequent reboots all the sfs files are loaded, then the save files (in order) and finally a new save file from a compressed .2fs in initrd
(May need to have a couple different sizes of 2fs.bz2 for low ram machines and for those who may want to store more since they need to be mounted in ram .../tmp or /dev/shm would work ... or to disk if insufficient ram)
Note 2fs compresses much better than 3fs or 4fs
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
technosaurus: I never used CD/DVD-save myself - just was annoyed that it did not work and pUPnGO missed that feature as it seems to be basic/core Puppy.
I like your ideas - think it might liberate chose sfs´s totally - might need some more /dev/loop´s though.
Another thought: CD/DVD save seems to only saving new stuff from each session and merge them at boot - could be an alternative way to have a personal savefile-structure - maybe it could be inside your suggested compressed 2fs file stored in the initrd...
But would it still be Puppy? And how many hacks must a man...?
I like your ideas - think it might liberate chose sfs´s totally - might need some more /dev/loop´s though.
Another thought: CD/DVD save seems to only saving new stuff from each session and merge them at boot - could be an alternative way to have a personal savefile-structure - maybe it could be inside your suggested compressed 2fs file stored in the initrd...
But would it still be Puppy? And how many hacks must a man...?
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
The save file can be just a plain jane ext# file system with no folders (aufs will add them as needed) I've already done some experiments with that part because I didn't like the idea losing work because of waiting until first shutdown to create the save file... Now that I have completely removed my ntfs partition, I just work from a mounted partition for stuff I want to keep.
busybox mount can now automatically create new loops up to 255 (however this can be increased in the code)
Here is the original busybox commit:
http://git.busybox.net/busybox/commit/? ... bf9d5ba7bd
tiny core is already using this feature (I think one of their devs may have sent the patch)
Gaining the ability to roll back would be a nice incidental feature.
(Seems like it could be used for any type of install)
Honestly I don't know how the existing save2cd works - my only other thought was to use a tar archive since it has the ability to add new additional files to the end of the "Tape ARchive", however I don't know if the cd tools could handle that (if they write anything at the end it would probably fail?) someone was writing a specific filesystem just for this purpose at one point - not sure where it went though
Edit - here:
http://keyj.s2000.at/?p=275#more-275
Edit2 - found a nifty little curses style mixer (mmix) that compiles to 17kb with static dietlibc
http://www.mcmilk.de/projects/mmix/
busybox mount can now automatically create new loops up to 255 (however this can be increased in the code)
Here is the original busybox commit:
http://git.busybox.net/busybox/commit/? ... bf9d5ba7bd
tiny core is already using this feature (I think one of their devs may have sent the patch)
Gaining the ability to roll back would be a nice incidental feature.
(Seems like it could be used for any type of install)
Honestly I don't know how the existing save2cd works - my only other thought was to use a tar archive since it has the ability to add new additional files to the end of the "Tape ARchive", however I don't know if the cd tools could handle that (if they write anything at the end it would probably fail?) someone was writing a specific filesystem just for this purpose at one point - not sure where it went though
Edit - here:
http://keyj.s2000.at/?p=275#more-275
Edit2 - found a nifty little curses style mixer (mmix) that compiles to 17kb with static dietlibc
http://www.mcmilk.de/projects/mmix/
- Attachments
-
- mmix-0.3-diet.pet
- (10.82 KiB) Downloaded 399 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Worked with modifying SFS-TCZ_Linker-2.1-T for pupngo - works now but seems to me it is a too complicated way of getting sfs content usable...sfs must be special build (/etc/choice, pinstall) and some scripts using readlink must be recoded.
You can modify it to load sfs on the bootdisk at first boot - but maybe a fake cd-save folder could do the same?
I have been looking for some info on the aufs setup - but haven't got a clue yet...It should be possible to append a file system to the running aufs mount...but I have only failed until now..
Running below code second command fails:
# mount -t aufs -o br:/tmp/rw none /tmp/aufs
# mount -o remount,append:${HOME} /tmp/aufs
with:
/sbin/mount.aufs:plink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
??? Maybe my aufs-tools from Debian do not work in P412 (could not compile from source either)
But it would be a nice and clean method to load/unload sfs-files if possible.
The mmix is cool! (hard to view with white background in rxvt - in console it is beautiful!)
The roll-back opportunity would be nice to have - sort of eliminates the need for backups - I will look into this when I have some better time.
You can modify it to load sfs on the bootdisk at first boot - but maybe a fake cd-save folder could do the same?
I have been looking for some info on the aufs setup - but haven't got a clue yet...It should be possible to append a file system to the running aufs mount...but I have only failed until now..
Running below code second command fails:
# mount -t aufs -o br:/tmp/rw none /tmp/aufs
# mount -o remount,append:${HOME} /tmp/aufs
with:
/sbin/mount.aufs:plink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
??? Maybe my aufs-tools from Debian do not work in P412 (could not compile from source either)
But it would be a nice and clean method to load/unload sfs-files if possible.
The mmix is cool! (hard to view with white background in rxvt - in console it is beautiful!)
The roll-back opportunity would be nice to have - sort of eliminates the need for backups - I will look into this when I have some better time.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
yeah - I need to set the background color in the mixer script ...can just use the alsa-mixer script I think (I always have mine set to black, so I didn't think about it)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
A short follow up on mounting sfs directly in the root-unionfs. I succeeded in appending a normal sfs-file to the root branch - might have reinvented the wheel but thats ok with me....
Commands:
1. #mkdir /tmp/sfs
2. mount your SFS-file on /tmp/sfs - ex:
#mount -t squashfs -o loop /tmp/lynx2-8-7-i486_412.sfs /tmp/sfs
3. #mount -o remount,append:/tmp/sfs=ro /
output of mount hereafter:
unionfs on / type aufs (rw,si=74ad6b34,xino=/initrd/pup_rw/.aufs.xino,diropq=w,dirs=/initrd/pup_rw=rw:/initrd/pup_ro2=ro:/initrd/pup_ro4=ro:/initrd/pup_ro5=ro:/tmp/sfs=ro)
And good old lynx runs ok.
To remove the sfs again:
#mount -o remount,del:/tmp/sfs /
output of mount hereafter:
unionfs on / type aufs (rw,si=74ad6b34,xino=/initrd/pup_rw/.aufs.xino,diropq=w,dirs=/initrd/pup_rw=rw:/initrd/pup_ro2=ro:/initrd/pup_ro4=ro:/initrd/pup_ro5=ro)
Only done small tests - but it works - sort of moves sfs-mounting from boot-process to user space...
In latest pUPnGO same approach can be used to mount GUI_412.sfs and glibc-2.6.1-1_412.sfs - no install, no wait for GUI/full glibc to after creating savefile and reboot.
Commands:
1. #mkdir /tmp/sfs
2. mount your SFS-file on /tmp/sfs - ex:
#mount -t squashfs -o loop /tmp/lynx2-8-7-i486_412.sfs /tmp/sfs
3. #mount -o remount,append:/tmp/sfs=ro /
output of mount hereafter:
unionfs on / type aufs (rw,si=74ad6b34,xino=/initrd/pup_rw/.aufs.xino,diropq=w,dirs=/initrd/pup_rw=rw:/initrd/pup_ro2=ro:/initrd/pup_ro4=ro:/initrd/pup_ro5=ro:/tmp/sfs=ro)
And good old lynx runs ok.
To remove the sfs again:
#mount -o remount,del:/tmp/sfs /
output of mount hereafter:
unionfs on / type aufs (rw,si=74ad6b34,xino=/initrd/pup_rw/.aufs.xino,diropq=w,dirs=/initrd/pup_rw=rw:/initrd/pup_ro2=ro:/initrd/pup_ro4=ro:/initrd/pup_ro5=ro)
Only done small tests - but it works - sort of moves sfs-mounting from boot-process to user space...
In latest pUPnGO same approach can be used to mount GUI_412.sfs and glibc-2.6.1-1_412.sfs - no install, no wait for GUI/full glibc to after creating savefile and reboot.