How to force PUPMODE 13 (flash drive) when using hd install

How to do things, solutions, recipes, tutorials
Message
Author
Fractal
Posts: 8
Joined: Wed 08 Dec 2010, 11:54

#16 Post by Fractal »

My SBC doesn't have a HDD - it has a 512MB CF drive, so it's important that Puppy protects it with minimal writes.
I am using 4.2.1, because 5.x doesn't seem to want to let me use the serial port, which I need.
Here are my findings:

PMEDIA=ataflash does NOT WORK. This might be because the CF cards I am using all register as non-removable.

To force PUPMODE=13, I edited my init script in the root of initrd using the "editinit" script from Pizzagood. I added the line "PUPMODE=13" at an appropriate point to force it to use PUPMODE=13.

However, this does mean editing the init script and permanently knobbling it.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#17 Post by jamesbond »

Fractal, Sylvander uses Lupu 5.2 - so it pmedia=ataflash should work (I think).

Sylvander - when you say "live CD-RW" - I assume you just burn puppy ISO to your CD-RW and boot from there. Now, I don't usually use live-CD-RW, so no guarantee that this will work. The file you would need to edit isolinux.cfg. Change the last line from "pmedia=cd" to "pmedia=ataflash". The easiest way to do this is:
a) extract isolinux.cfg from Lupu 5.2
b) edit the file as above
c) get a version of puppy that has ISOMaster in it.
d) use isomaster to replace the isolinux.cfg in the puppy iso with the one you just edited
e) save the new iso, and then burn it.

Good luck.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#18 Post by Sylvander »

Job done, altered ISO file made as per your instructions. :D

Here's greater detail on what I did:
1. Extract isolinux.cfg file from lupu-520.iso file.
(a) Using Xfe, I navigated to the folder holding the ISO file.
(b) Clicked on the icon [in Xfe] to "Lauch Terminal" that applies to the contents of that "Active" window.
(c) Typed the first few characters of the command filemnt [e.g. filem] and hit <Tab> to complete the name of the command.
[There should be a space after the command name]
(d) Type the first few characters of the name of the ISO file = lupu-520.iso [e.g. lu], and hit <Tab> to complete the name.
(e) Hit <Enter> to activate the command upon the named file.
(f) The ISO file mounted successfully at folder = /mnt/[name of file] = /mnt/lupu-520.iso

2. Edit the file as above.
(a) Right-clicked on the isolinux.cfg file within the /mnt/lupu-520.iso folder, and copied it to a handy folder = /00
(b) Right-clicked on that file, chose "Open with...", chose "Leafpad", and the file opened in Leafpad.
(c) Edited as you'd instructed, closed the file, and saved the changes when offered.
(d) Right-clicked on /mnt/lupu-520.iso folder, and chose "unmount".
An error was reported as though it had failed, but it actually succeeded in the unmount.

3. Ran ISOMaster.
(a) Went to "Menu->Multimedia->ISOMaster", and clicked that to run it.
(b) Clicked "File->Open", and navigated to the ISO file, made sure it was selected [highlighted], and clicked the "Open" button.
(c) The ISO file opened, and all the included files were listed in the bottom window.

4. Use isomaster to replace the isolinux.cfg in the puppy iso with the one you just edited.
(a) Highlighted the isolinux.cfg file in the lower pane and clicked the "Remove" icon.
It was removed.
(b) Used the "Go back" icon above the upper pane to navigate to the /00 folder holding the edited isolinux.cfg file, highlighted the file, clicked the "Add" icon above the lower pane, it was added to the lower pane.

5. Save the new iso, and then burn it.
(a) Used "File->Save as..." to navigate to the folder location of the original ISO file, and saved it with the name lupu-520-ataflash.
The program auto-added the .iso extension.
(b) Used "Menu->Multimedia->burniso2cd" to burn the ISO image to a new CD-RW disk.

6. Still to try the new CD-RW; wish me luck. :D
SUCCESS! :D
IT WORKS! 8)

Jasper

#19 Post by Jasper »

Hi Sylvander and jamesbond,

It's good to see a job well done.

My regards

Bruce B

#20 Post by Bruce B »

Fractal wrote:To force PUPMODE=13, I edited my init script in the root of initrd using the "editinit" script from Pizzagood. I added the line "PUPMODE=13" at an appropriate point to force it to use PUPMODE=13.

However, this does mean editing the init script and permanently knobbling it.
You can make backups of init, for example cp init init.BAK. When you repack it, leave init.BAK inside the newly compressed initrd.gz

You might not know for sure if the modifications do as you want until you reboot. If not, open initrd.gz and cp init.BAK init. Now you have a fresh geunine init to play with.


~

User avatar
DocSalvage
Posts: 11
Joined: Sat 30 Jun 2012, 18:59
Location: Tallahassee, FL, USA
Contact:

#21 Post by DocSalvage »

Running 5.2.8 Lupu on some fairly old hardware with slower IDE(PATA) drives and have been looking to maximize performance. It appears that just just changing the kernel boot paramter from...

Code: Select all

PMEDIA=atahd
to

Code: Select all

PMEDIA=ideflash
causes Puppy to boot in PUPMODE=13, treating the HDD like a flashdrive by putting the savefile in RAM and mounting it instead of mounting the disk image to the top layer.

On boot, the 'save' desktop icon is present and seems to work normally. /etc/rc.d/PUPSTATE shows PUPMODE=13 but has changed PMEDIA from 'ideflash' to 'ataflash'. I got the 'ideflash' from http://puppylinux.org/wikka/BootParametersPuppy

Reduced the save interval from the default 30min to 10min and may reduce it furrther.

Do not know if this is as-designed or a minor bug. I'm new here (but many years Unix/Linux experience) so please advise if I'm overlooking some critical downside.
[i][color=blue]DocSalvager (a.k.a. DocSalvage)[/color][/i]
[url]http://www.docsalvage.info[/url], [url]http://www.softwarerevisions.net[/url]

User avatar
MyPuppysaysWauWau
Posts: 162
Joined: Thu 20 Feb 2014, 10:12
Location: Austria/Vienna

I had this problem in TurbopupXtreme too

#22 Post by MyPuppysaysWauWau »

I'm interested to use a fast Linux to stream Radio on an old and slow P1333 Mhz 256Mb RAM Notebook. So I found out that TurbopupXtreme is perfect to do this job. I solved a few small problems, but at least I can't stop the automatic saving at shutdown. For radio streaming saving isn't necessary.
I searched in this forum, but the solutions are a bit complicated. My girlfriend Petra had an idea how to change easily the argument Pupmode=12 to 13 in the PUPSTATE file permanently.

We created a file (we called it PUPSTATE13) with the same text as in the PUPSTATE file. But with the argument Pupmode=13 then we added the line...
cp /root/.etc/rc.d/PUPSTATE13 /root/.etc/rc.d/PUPSTATE
...in the rc.local file.

Thats all :)

Regards,
Walter
[size=100][color=darkblue][b]Don't[/b] start because it's [i]easy.[/i] [b]Start[/b] because it's [i]worth trying[/i]. [b]Don't [/b]stop because it's [i]hard[/i]. [b]Stop[/b] because you tried your [i]Best[/i].[/color][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#23 Post by rufwoof »

I'm pretty sure, but not certain, that I've seen code that deduces the pupmode rather than inspecting the pupmode from the PUPSTATE file. Might have been something like petget - that writes direct to the savefile/folder if found. So fooling the pupstate either via pmedia=ataflash or changing PUPSTATE content isn't perhaps 100% reliable/stable ???

For a more reliable method to fix the savefile/folder either make it into a adrv sfs and run with a empty savefolder, or remaster the savefolder/file into the main puppy.

Personally I prefer to configure puppy as I like and remaster (or create a puppy sfs with the changes incorporated into it) and boot pfix=ram (no savefile, prompted to save at shutdown which I usually answer no to (unless I want a save of the changes made so that I can add those to the existing read only version))
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
DocSalvage
Posts: 11
Joined: Sat 30 Jun 2012, 18:59
Location: Tallahassee, FL, USA
Contact:

#24 Post by DocSalvage »

Rufwoof, that may very well be for some versions of Puppy.

I can only say that I've been using the 'pmedia=ideflash / pmedia=ataflash' method ever since my original post on version 5.2.8 (Lucid) and it has been reliable.
[i][color=blue]DocSalvager (a.k.a. DocSalvage)[/color][/i]
[url]http://www.docsalvage.info[/url], [url]http://www.softwarerevisions.net[/url]

User avatar
MyPuppysaysWauWau
Posts: 162
Joined: Thu 20 Feb 2014, 10:12
Location: Austria/Vienna

#25 Post by MyPuppysaysWauWau »

rufwoof wrote:Might have been something like petget - that writes direct to the savefile/folder if found.
Yep, I know! The first time, that this happened, I was very surprised. But I had a working copy of my Precise safefile. Since then I always install a new software only with a backup.
[size=100][color=darkblue][b]Don't[/b] start because it's [i]easy.[/i] [b]Start[/b] because it's [i]worth trying[/i]. [b]Don't [/b]stop because it's [i]hard[/i]. [b]Stop[/b] because you tried your [i]Best[/i].[/color][/size]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#26 Post by Karl Godt »

For myself I have altered the init script in initrd.gz to accept the kernel parameters

Code: Select all

# pupmode=NUMBER parameter to force PUPMODE ie 13 on hd install
[ $pmode ]    && FPUPMODE=$pmode
[ $pupmode ]  && FPUPMODE=$pupmode
[ $ppupmode ] && FPUPMODE=$ppupmode
FPUPMODE stands for FORCE_PUPMODE .

This function returns either 13 or 12 :

Code: Select all

_redefine12(){
 case $FPUPMODE in 11|12|13) return $FPUPMODE;; esac
 case $PMEDIA in *flash*) return 13;; esac
 _check_removable "$PUPSAVE"
 case $? in 1) [ "$PMEDIA" = usbhd ] || return 13;;esac
 return 12
}
This function is used by above function :

Code: Select all

_check_removable(){
 test "$*" || case $PUPMODE in 12) set - "$PUPSAVE";; 6) set - "$PDEV1";; esac
 local DRVSAVE REMOVABLEDRVSAVE=0
 DRVSAVE="`echo -n "$*" | cut -f 1 -d ',' | sed -e 's/[0-9]*$//' -e 's/p$//'`" #ex: sda  110126 mmcblk0p1 becomes mmcblk0
 [ -f /sys/block/$DRVSAVE/removable ] && read REMOVABLEDRVSAVE </sys/block/$DRVSAVE/removable
 return $REMOVABLEDRVSAVE
}
Here is the code that defines the final PUPMODE :

Code: Select all

case $PUPMODE in
# case 2,3,6,7 here
12) #4=puppy.sfs found, 8=${DISTRO_FILE_PREFIX}save.2fs found.  total=12
_redefine12
   PUPMODE=$?
   [ "$PUPMODE" ] || PUPMODE=13 #precaution
 ;;
76|77) #v3.01 64+8+4 multisession cd.
  PUPMODE=77 #yes, want tmpfs top layer.
 ;;
 *) [ "$FPUPMODE" ] && PUPMODE=$FPUPMODE || PUPMODE=5;;
esac
And that kind of code structure works also to change PUPMODE from 2 to 3
in case of a normal HDD full install,
with the right function syntax at the right places.
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

Post Reply