Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 21 Apr 2014, 04:31
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Add a "pfix=noram" option to your Puppy
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [43 Posts]   Goto page: 1, 2, 3 Next
Author Message
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: 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
View user's profile Send private message Visit poster's website 
JB4x4

Joined: 30 Jul 2006
Posts: 256

PostPosted: 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
View user's profile Send private message Yahoo Messenger 
Bruce B


Joined: 18 May 2005
Posts: 11050
Location: The Peoples Republic of California

PostPosted: 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
treepad-lite-for-linux.png
 Description   
 Filesize   20.08 KB
 Viewed   1849 Time(s)

treepad-lite-for-linux.png

Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: 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
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6378
Location: Auckland, New Zealand

PostPosted: 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
View user's profile Send private message 
jcoder24


Joined: 06 May 2005
Posts: 601
Location: Barbados

PostPosted: 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
View user's profile Send private message 
maddox

Joined: 28 Sep 2007
Posts: 453
Location: sometimes in France

PostPosted: 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
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6378
Location: Auckland, New Zealand

PostPosted: 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
View user's profile Send private message 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: 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
View user's profile Send private message Visit poster's website 
CatDude


Joined: 03 Jan 2007
Posts: 1432
Location: UK

PostPosted: 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
.
puppy-4.2.1-k2.6.25.16-Hacked_initrd.tar.gz
Description 
gz

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

_________________

Back to top
View user's profile Send private message 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: 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... Cool
Back to top
View user's profile Send private message Visit poster's website 
CatDude


Joined: 03 Jan 2007
Posts: 1432
Location: UK

PostPosted: 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
View user's profile Send private message 
pri


Joined: 09 Oct 2009
Posts: 330
Location: Bandung Indonesia

PostPosted: 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
View user's profile Send private message Visit poster's website Yahoo Messenger 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: 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.
add_noram.patch.gz
Description  Add a pfix=noram boot option to the init script.
gz

 Download 
Filename  add_noram.patch.gz 
Filesize  860 Bytes 
Downloaded  532 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
View user's profile Send private message Visit poster's website 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Wed 07 Apr 2010, 11:04    Post subject:  

Pizzasgood wrote:
....


Thanks, pizzasgood! Cool
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 3 [43 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0968s ][ Queries: 12 (0.0066s) ][ GZIP on ]