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

How to do things, solutions, recipes, tutorials
Message
Author
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