LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices



Reply
 
Search this Thread
Old 11-09-2006, 07:16 AM   #1
zaxonus
Member
 
Registered: Jul 2005
Posts: 53

Rep: Reputation: 15
Puppy on a USB key.


Hi,

I have installed Puppy on a USB key, a few times. But now I would like to put the file PUP_xxx.SFS (PUP_211.SFS for version 2.11) in a directory of my choice; that is not necessarily the root directory, of the partition where Puppy is installed. Does anyone know how to do that ?

When I tried to move the file some where else it didn't work. Appearently the place where the file PUP_xxx.SFS is stored has to be specified somehow. And this is what I need to know.

Michel
 
Old 11-09-2006, 07:32 AM   #2
billstclair
LQ Newbie
 
Registered: Oct 2006
Distribution: Slackware 11.0, Puppy 2.10
Posts: 6

Rep: Reputation: 0
The /sbin/init script in initrd.gz looks for pup_$PUPPYVERSION.sfs in the top-level of each partition. You could change it to look wherever you want. The important thing is to set the PUPSFS variable, which is used later in the script to copy the pup_xxx.sfs file to the RAM disk.

You can look at the script in an existing Puppy at /initrd/sbin/init .

Remastering isn't hard, gunzip a copy of initrd.gz, mount -o loop it, make changes to $MOUNT_POINT/sbin/init, umount it, gzip it again, and aim your bootstrap loader at it.

The vmlinuz and initrd.gz files can be called whatever your want, as long as you tell the boot loader where they are.
 
Old 11-11-2006, 09:12 PM   #3
zaxonus
Member
 
Registered: Jul 2005
Posts: 53

Original Poster
Rep: Reputation: 15
This information is great and puts me on the track. Thanks

I followed the suggestions without any problems. But did not find out yet exactly how to modify the script. I found the PUPSFS variable, and changed the line :
PUPSFS="pup_$PUPPYVERSION.sfs"
to :
PUPSFS="MyNewDir/pup_$PUPPYVERSION.sfs"

When I tried to reboot on the USB key (after updating and moving pup_211.sfs to the adequate directory of course) I still got the message :

ERROR, cannot find Puppy on '$PMEDIA' boot media." >/dev/console
.....
the Linux-guru can now debug, 'e3' editor is available)


which is displayed by the /initrd/sbin/init.

This is a fairly long script, I only had a glance at it before making the change.
I need to take a closer look to see what is happening in more details and then make more appropriate modifications.

If someone knows about some good tutorials concerning this initrd thing I am interested.
 
Old 11-13-2006, 01:39 PM   #4
marksouth2000
Puppy Motivator
 
Registered: Oct 2004
Location: The Shadowy Planet
Distribution: Too many to mention
Posts: 111

Rep: Reputation: 15
What was the value of PMEDIA (echo $PMEDIA) at that stage?
 
Old 11-25-2006, 11:05 PM   #5
zaxonus
Member
 
Registered: Jul 2005
Posts: 53

Original Poster
Rep: Reputation: 15
I have set :
PMEDIA=usbflash
at the GRUB level.

I have also been able to go a little further by trying to see in the script where the pup_$PUPPYVERSION.sfs file is refered to and change the script consequently.
Nevertheless I cannot make a complete boot yet. At some point it still cannot find what it is supposed to.

I am sure I can do what I want. Though the init script does not seem to have bee written in on order to make this easy.
 
Old 11-26-2006, 12:12 AM   #6
zaxonus
Member
 
Registered: Jul 2005
Posts: 53

Original Poster
Rep: Reputation: 15
Here is where I am at this point :

The boot process starts OK.
The following line (in loadpupsfsfunc()) is as far as I can tell, seing the boot messages, executing OK.
"Creating tmpfs for myDirectory/pup_211.sfs on (/initrd)/mnt/tmpfs... "

But problems start to happen with this one :
"Copying myDirectory/pup_211.sfs to tmpfs... mounting on (/initrd)/pup_ ,,,,"
where I get a failure.

Then after a couple of other various messages; I get this one :
"/mnt/tmpfs/myDirectory/pup_211.sfs : No such file or directoty"

Something has obviously been lost on the way.

Any help from Puppy or other experts in the field is welcome.

Thanks in advance.
 
Old 11-27-2006, 12:27 PM   #7
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
you can probably try creating the directory of "/mnt/tmpfs/myDirectory" inside the initrd.gz of your puppy first

and/or/may need

change your tmpfs variable to "/mnt/tmpfs/myDirectory" ...

but i'm not sure how well your variables stay throughout your puppy bootup and its session ...


if somehow you managed to get it works with whatever method , let know ... probably i may need that too ...



.
 
Old 11-28-2006, 09:02 AM   #8
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
this seems to work for me ...

at around lines 290 on my editor ::

if [ -f /mnt/data/000/pup_$PUPPYVERSION.sfs ];then
PUPSFS="000/pup_$PUPPYVERSION.sfs"


and inside that loadpupsfsfunc() after the copying of PUPSFS to tmpfs , i need to reset the variable back to just "pup_$PUPPYVERSION.sfs" ::

...
cp -f ${1}/$PUPSFS /mnt/tmpfs/
sync
PUPSFS="pup_$PUPPYVERSION.sfs"
...


ofcourse , as i mentioned , this probably only works on my puppy and it could break things , may need to check the PUPMODE/PUPSTATE case block at around lines 930 ... so beware ...



.
 
Old 12-01-2006, 02:20 AM   #9
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
ok , actually you can create and pass your own parameters from grub , and maybe also any other booting cfg file on your whatever disk ... like ::

PUPSFSDIR=/SFS
EXTRASFSDIR=/EXTRA

but you have to handle these parameters yourself as an enviroment variables passed into the init script ...



//just another possible way of doing things ...


.
 
Old 12-01-2006, 08:31 PM   #10
zaxonus
Member
 
Registered: Jul 2005
Posts: 53

Original Poster
Rep: Reputation: 15
Hi,

It finally worked following your advice (not the last one, the one before) thanks a lot.

I have the feeling it would be useful to spend some time trying to understand how the /sbin/init (inside Puppy-initrd) is working.

Bye
 
Old 12-02-2006, 10:22 AM   #11
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
glad to know that you finally get it to work but i think the second method one would be better because we are not hard-coding something into the init script , we do it from the "outside" which is either grub or maybe other *.cfg files on disk ... probably by that way we can have different multiple configurations on only one same init script with some ease ...

>> "trying to understand how the /sbin/init (inside Puppy-initrd) is working ..."

frankly speaking , i can only do guessing on it most of the time for i'm not really into linux scripting in anyway ...



.

Last edited by alred; 12-02-2006 at 11:23 AM.
 
Old 12-04-2006, 03:36 AM   #12
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
ok , finally found a way to do that grub thing ...

against the original init script ::

line 267 ::
Code:
  if [ -f /mnt/data${PUPSFSDIR}/pup_$PUPPYVERSION.sfs ];then
   PUPSFS="${PUPSFSDIR}/pup_$PUPPYVERSION.sfs"
line 541 ::
Code:
   cp -f ${1}$PUPSFS /mnt/tmpfs/
   sync
   PUPSFS="pup_$PUPPYVERSION.sfs"
after line 1061(i'm not too sure about this one , probably dont need it) ::
Code:
if [ ! "$EXTRASFSDIR" = "" ];then
 EXTRASFS="${EXTRASFS}$EXTRASFSDIR"
fi
line 232 ::
Code:
CHOICES3FS="`ls -1 /mnt/data$PUPSAVEDIR/pup_save*.3fs 2>/dev/null | sed -e 's/\/mnt\/data\///g'`"
after 766 ::
Code:
if [ ! "$PDEV1" = "" ];then
    findpupfunc $PDEV1
    else
...
...
...
# and on line 840 , double check this one , i can be wrong ...

fi

PUPSFSDIR = /SFS
EXTRASFSDIR = /EXTRA
PUPSAVE = ext3,hdf3,/pup_save_crypt-hdf3-212.3fs
or
PUPSAVEDIR = /PUPSAVE
PDEV1 = hde1


note :: these seems to work ok *only* on my puppy but i cant and donno how to test it on every possible PUPSTATE scenario and that ntfs stuffs , so it is not "robust" and its still kind of "hard-coded" with mistakes ... beware , backup your previous working init script oftenly when you edit ...


.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Puppy on USB Jumpdrive Chasman Puppy 0 08-18-2006 04:54 PM
puppy 2 and usb after harddisk install happyhippo Puppy 2 06-28-2006 09:26 AM
puppy linux on a usb stick box_l Linux - General 1 06-25-2006 10:05 PM
puppy can't find cram.fs on usb install bernied Puppy 3 06-25-2006 07:09 PM


All times are GMT -5. The time now is 01:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration