| Author |
Message |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Thu 27 Dec 2007, 11:50 Post subject:
Add a "pfix=noram" option to your Puppy Subject description: Instructions for Puppy 3.xx, updated to 4.3.1 |
|
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: | 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: | | noram) NORAM="yes";; prevents pup_xxx.sfs from loading to ram |
At line 771 (772 after the above edit), change
| Code: | | if [ $RAMSIZE -gt 230000 ];then #256MB system. note, only checking physical ram. | to
| Code: | | 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: | 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.
_________________ 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

Last edited by Pizzasgood on Fri 28 Dec 2007, 19:09; edited 2 times in total
|
|
Back to top
|
|
 |
JB4x4
Joined: 30 Jul 2006 Posts: 256
|
Posted: Thu 27 Dec 2007, 20:12 Post subject:
|
|
Need to edit your example -
| Code: | | nosplash) NOSPLASH="yes";; #prevent bootsplash from running |
to
| Code: | | 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/viewtopic.php?search_id=1269705774&t=24044
JB
|
|
Back to top
|
|
 |
Bruce B

Joined: 18 May 2005 Posts: 10818 Location: The Peoples Republic of California
|
Posted: Thu 27 Dec 2007, 20:38 Post subject:
|
|
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
| Description |
|
| Filesize |
20.08 KB |
| Viewed |
1556 Time(s) |

|
|
|
Back to top
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Fri 28 Dec 2007, 19:12 Post subject:
|
|
| JB4x4 wrote: | Need to edit your example -
| Code: | | nosplash) NOSPLASH="yes";; #prevent bootsplash from running |
to
| Code: | | 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.
_________________ 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

|
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6182 Location: Auckland, New Zealand
|
Posted: Thu 20 Nov 2008, 18:08 Post subject:
|
|
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...
_________________ DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
|
|
Back to top
|
|
 |
jcoder24

Joined: 06 May 2005 Posts: 601 Location: Barbados
|
Posted: Thu 20 Nov 2008, 19:26 Post subject:
|
|
Compliments MU
| Code: | #!/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 |
|
|
Back to top
|
|
 |
maddox
Joined: 28 Sep 2007 Posts: 453 Location: sometimes in France
|
Posted: Thu 20 Nov 2008, 20:21 Post subject:
|
|
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: | | 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)
|
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6182 Location: Auckland, New Zealand
|
Posted: Fri 21 Nov 2008, 00:55 Post subject:
|
|
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...
_________________ DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
|
|
Back to top
|
|
 |
steve_s

Joined: 26 May 2008 Posts: 1543 Location: Austin, TX, USA
|
Posted: Sun 14 Feb 2010, 18:50 Post subject:
|
|
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?
|
|
Back to top
|
|
 |
CatDude

Joined: 03 Jan 2007 Posts: 1355 Location: UK
|
Posted: Mon 15 Feb 2010, 10:51 Post subject:
|
|
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:
| Quote: | | 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: |
# free
total used free shared buffers
Mem: 1035420 286392 749028 0 16784
Swap: 2104496 0 2104496
Total: 3139916 286392 2853524
#
|
Hacked initrd.gz
| Code: |
# free
total used free shared buffers
Mem: 1035420 113852 921568 0 16784
Swap: 2104496 0 2104496
Total: 3139916 113852 3026064
#
|
Hope this helps
CatDude
.
| Description |
|

Download |
| Filename |
puppy-4.2.1-k2.6.25.16-Hacked_initrd.tar.gz |
| Filesize |
1.23 MB |
| Downloaded |
494 Time(s) |
_________________

|
|
Back to top
|
|
 |
steve_s

Joined: 26 May 2008 Posts: 1543 Location: Austin, TX, USA
|
Posted: Mon 15 Feb 2010, 13:30 Post subject:
|
|
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...
|
|
Back to top
|
|
 |
CatDude

Joined: 03 Jan 2007 Posts: 1355 Location: UK
|
Posted: Mon 15 Feb 2010, 18:15 Post subject:
|
|
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.
_________________

|
|
Back to top
|
|
 |
pri

Joined: 09 Oct 2009 Posts: 330 Location: Bandung Indonesia
|
Posted: Tue 06 Apr 2010, 00:47 Post subject:
how about 431 |
|
how about puppy 431, how to add pfix=noram
_________________ Learning by Doing
|
|
Back to top
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Tue 06 Apr 2010, 20:38 Post subject:
|
|
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: | | noram) PNORAM="yes";; #do NOT copy .sfs files into ram. |
At line 1055 (after the above change), change the line from this:
| Code: | | [ $RAMSIZE -gt 220000 -a "$PCOPY" = "yes" ] && COPY2RAM="yes" #note, only checking physical ram. | to this:
| Code: | | [ $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: | [ "$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: | [ "$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.
| Description |
Add a pfix=noram boot option to the init script.
|

Download |
| Filename |
add_noram.patch.gz |
| Filesize |
860 Bytes |
| Downloaded |
474 Time(s) |
_________________ 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

|
|
Back to top
|
|
 |
steve_s

Joined: 26 May 2008 Posts: 1543 Location: Austin, TX, USA
|
Posted: Wed 07 Apr 2010, 11:04 Post subject:
|
|
Thanks, pizzasgood!
|
|
Back to top
|
|
 |
|