Add a "pfix=noram" option to your Puppy

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

Add a "pfix=noram" option to your Puppy

#1 Post by Pizzasgood »

I was making a custom Puppy for someone and they wanted a pfix=noram option, to prevent pup_xxx.sfs from loading into ram even when there's enough available. I've seen another person say it would be nice to have, so here's how to do it. These directions assume you're using Puppy 3.01 with an unmodified initrd.gz file. For 3.00, or if you changed initrd.gz a little, they should still apply, but the line numbers will likely be off.

Also note: this involves editing initrd.gz, so if you're booting from a CD you'll have to re-burn it with the new initrd.gz file. USB and Frugal users can just drop in the new version.

First, put initrd.gz somewhere on a Linux filesystem (I tend to use /tmp/NewDir). Open a terminal there and do this to extract it:

Code: Select all

mkdir initrd-tree
cd initrd-tree/
zcat ../initrd.gz | cpio -i -d
Now the contents are inside initrd-tree/. Open init as text. At line 104 add

Code: Select all

   noram) NORAM="yes";;  prevents pup_xxx.sfs from loading to ram
At line 771 (772 after the above edit), change

Code: Select all

 if [ $RAMSIZE -gt 230000 ];then #256MB system. note, only checking physical ram.
to

Code: Select all

 if [ $RAMSIZE -gt 230000 ] && [ ! "$NORAM" = "yes" ];then #256MB system. note, only checking physical ram.
Then rebuild the initrd.gz by opening a terminal inside initrd-tree and running this:

Code: Select all

rm ../initrd.gz
find . | cpio -o -H newc | gzip -9 > ../initrd.gz
Now just replace the original initrd.gz file with the new one. You can now use the pfix=noram option to boot without loading the pup_xxx.sfs file to ram, regardless of how much you have.


By the way, up where you edited line 771/772, you can change the "230000" to set the minimum amount of ram before Puppy automatically loads the pup_xxx.sfs file into ram when not using the pfix=noram option. That's good to know if you're making a puplet that's bigger than the standard Puppy.
Last edited by Pizzasgood on Fri 28 Dec 2007, 23:09, edited 2 times in total.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

JB4x4
Posts: 256
Joined: Sun 30 Jul 2006, 22:44
Contact:

#2 Post by JB4x4 »

Need to edit your example -

Code: Select all

nosplash) NOSPLASH="yes";;     #prevent bootsplash from running
to

Code: Select all

nosplash) NORAM="yes";;     #prevent pup_xxx.sfs from loading to ram
I had also put together an initrd.gz for Puppy 3.01 using "noramsfs"

http://www.murga-linux.com/puppy/viewto ... 74&t=24044

JB

Bruce B

#3 Post by Bruce B »

Pizzasgood,

Good work! I'll make the initrd.gz and post it on my little known website for people who may need or want something like this.

I use a free Linux application called TreePad™
for keeping things like this. See screen shot below. Posted as a program preview for anyone who needs a similar application.

mcewanw - also good post, that's a keeper also.

Bruce
Attachments
treepad-lite-for-linux.png
(20.08 KiB) Downloaded 3195 times

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#4 Post by Pizzasgood »

JB4x4 wrote:Need to edit your example -

Code: Select all

nosplash) NOSPLASH="yes";;     #prevent bootsplash from running
to

Code: Select all

nosplash) NORAM="yes";;     #prevent pup_xxx.sfs from loading to ram
Good catch (though I also needed to change the nosplash) to noram) ). I had also added Pebble to that project, and the nosplash option is right next to the noram option. So it was really easy to copy the wrong one.

@Bruce B: Don't forget to correct my error in there! Unless that's just an old screenshot.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#5 Post by disciple »

Do you know how to take the 4.1.1 initrd.gz apart? That cpio command doesn't work.
I thought I'd look at it to see if I could figure out why pfix=noram doesn't actually work...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#6 Post by jcoder24 »

Compliments MU

Code: Select all

#!/bin/bash
gunzip initrd.gz
mkdir puppy-init
cd puppy-init
cat ../initrd | cpio -d -i
leafpad init
find . | cpio -o -H newc | gzip -9 > ../initrd.gz
cd ..
rm -rf puppy-init
rm -f initrd

maddox
Posts: 454
Joined: Fri 28 Sep 2007, 20:37
Location: sometimes in France

#7 Post by maddox »

Hi,
I've tried a slightly different way using 4.11 :
create the new directory , copy the initrd.gz into the new directory, open a console in the new directory, then run the extract command in the new directory.

Code: Select all

zcat ./initrd.gz | cpio -i -d
- Notice there's one dot less between zcat and / , since I'm already in the new directory with the console.
Don't forget to delete the original "initrd.gz" file in the new directory before creating the new one.

Maybe just a problem with where the file is located in respect to the new directory. A dot ./ (run from here) ../ double-dot (go up 1 level)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#8 Post by disciple »

That's weird - it works now. Before I was in pfix=ram, so maybe I have a different cpio here that came with unrpm or something...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#9 Post by steve_s »

Ok, I'm waking this thread back up...hopefully I can get Pizzasgood and the crew to help out...

I searched around and found this thread, so if I missed a thread where it is answered then sorry...

I got a remaster I don't want to load to ram. It's a 685mb remaster from a frugal install with a massive save file...I don't want it to load to ram no matter what...I pick the "puppy pfix=noram" option, no go, it loads. I tried to use the stuff from this thread, thought I did it right, apparently I didn't, still picked the "noram" option, but it still loads to ram.

So, what are the changes I need to make to initrd.gz on a 4.2.1 remaster so that it won't load to ram?

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#10 Post by CatDude »

Hello steve_s

Try the one attached below, it was done using the information Pizzasgood gave here

Using the Default initrd.gz with pfix=noram added to the kernel line of the grub entry
showed the following when booting up:
Loading the 'pup_421.sfs' main file...copying to ram
whereas there was no mention of copying to ram when using the Hacked initrd.gz

Here is the results of running free

Default initrd.gz

Code: Select all

# free
              		total         	used         	free       shared      buffers
  Mem:      1035420       286392       749028            0        16784
 Swap:      2104496            		0      2104496
  Total:      3139916       286392      2853524
# 
Hacked initrd.gz

Code: Select all

# free
              		total         	used         	free       shared      buffers
  Mem:      1035420       113852       921568            0        16784
 Swap:      2104496            		0      2104496
  Total:      3139916       113852      3026064
# 
Hope this helps
CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#11 Post by steve_s »

Rockin', CatDude, that should save me a lot of work...

But just to be 100% clear: I am to just substitute this one for the current initrd.gz, correct? Change the name to initrd.gz just replace the current one, right? Just making absolutely certain before I burn another coaster... 8)

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#12 Post by CatDude »

Hello steve
steve_s wrote: But just to be 100% clear: I am to just substitute this one for the current initrd.gz, correct?
That's correct mate.
Just unzip the attached file and you will get a directory called puppy-4.2.1-k2.6.25.16-Hacked_initrd
inside of that is the initrd.gz, no need to rename anything.

CatDude
.

EDIT:

Obviously you will still need to use the puppy pfix=noram at boot up.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

how about 431

#13 Post by pri »

how about puppy 431, how to add pfix=noram
Learning by Doing

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#14 Post by Pizzasgood »

Same directions for accessing the init script as in the first post. Just make the following edits instead of the edits described there.


At line 247, add this line:

Code: Select all

   noram)   PNORAM="yes";;        #do NOT copy .sfs files into ram.

At line 1055 (after the above change), change the line from this:

Code: Select all

[ $RAMSIZE -gt 220000 -a "$PCOPY" = "yes" ] && COPY2RAM="yes" #note, only checking physical ram.
to this:

Code: Select all

[ $RAMSIZE -gt 220000 -a "$PCOPY" = "yes" -a "$PNORAM" != "yes" ] && COPY2RAM="yes" #note, only checking physical ram.

At lines 1105-1107 (after the above changes), change the code from this:

Code: Select all

 [ "$PUPSFSDEVMNTPT" = "" ] && COPY2RAM="yes"
  #v405 fast media plus more than 256MB ram then definitely worth copying to ram...
 [ "`echo -n "$FASTPARTS0" | grep "$PUPSFSDEV"`" != "" ] && [ $RAMSIZE -gt 280000 ] && COPY2RAM="yes"
to this:

Code: Select all

 [ "$PUPSFSDEVMNTPT" = "" ] && [ "$PNORAM" != "yes" ] && COPY2RAM="yes"
 #v405 fast media plus more than 256MB ram then definitely worth copying to ram...
 [ "`echo -n "$FASTPARTS0" | grep "$PUPSFSDEV"`" != "" ] && [ $RAMSIZE -gt 280000 ] && [ "$PNORAM" != "yes" ] && COPY2RAM="yes"

For reference, I also attached a patch file that does the above changes. You don't need it if you did everything by hand.
Attachments
add_noram.patch.gz
Add a pfix=noram boot option to the init script.
(860 Bytes) Downloaded 912 times
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#15 Post by steve_s »

Pizzasgood wrote:....
Thanks, pizzasgood! 8)

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#16 Post by pri »

thanks... pizzasgood now my puppy will be run, even it fat :D.

already have multiuser for easy use too ? :D
Learning by Doing

lee321987
Posts: 3
Joined: Tue 27 Apr 2010, 21:50

#17 Post by lee321987 »

Hello.

Every time I do this (even tried using Pizzasgoods' patch file), the boot screen does this:

Code: Select all

Loading drivers needed to access disk drives....   done
Searching for Puppy files in computer disk drives...pup-431.sfs not found. Dropping out to initial-ramdisk console...
/bin/sh: can't access tty; job control turned off
Any ideas?

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#18 Post by Pizzasgood »

Turns out the problem isn't my changes. For Puppy 4.3.x, it looks like you need to use the -R option when running mkisofs. Otherwise the init script won't be able to locate the pup-431.sfs on the iso you build.

(Thank goodness for Qemu or it would have taken me about ten times as long to figure that out and verify it.)
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
gjuhasz
Posts: 422
Joined: Mon 29 Sep 2008, 14:28

Puppy apps placed on hard disk

#19 Post by gjuhasz »

I am happy to find this topic. The pfix=noram option is an ultimate solution if we have little RAM installed. Of course, Puppy becomes slower this case.

But...

What to do if you like some puppy variants, such as Bruno, but they are slow because you have 256 MB of RAM only? In my favorite distros, there are many nice-to-have packages (as parts of the distros' main sfs file) that could be better to lay in the hard disk. Per se, different users want different files to exile to the hard drive. How to replace a subset of files from the read-only sfs with links to the hard disk?

Don't try to move files from the sfs to the hard disk then put links in their original folder. Beyond response time and/or speed issues, Aufs/Unionfs punishes you with more RAM occupied.

A more complex but successful method to delete files from the read-only sfs (then replace them with links of course) is like this:

http://forum.eeeuser.com/viewtopic.php?id=71821 (I don't know whether this method has been applied for Puppies, please advise... I would prefer a simple "drag&drop" utility in the System menu for this purpose.)

A simple workaround is selecting a fat-free puppy then placing static packages (Skype, Zoiper, Opera52, Iron etc.) on the hard drive. This keeps the system being fast and prevents consuming RAM.

I know, dynamic sfs inclusion is well implemented in choicepup. I like it. Choicepup is very flexible, but unfortunately not too comfortable for some users such as my mother-in-low...
Last edited by gjuhasz on Thu 29 Apr 2010, 10:56, edited 5 times in total.

lee321987
Posts: 3
Joined: Tue 27 Apr 2010, 21:50

mkisofs

#20 Post by lee321987 »

What file do I need to put 'mkisofs -R' in?

Post Reply