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 25 Jul 2016, 18:21
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to force PUPMODE 13 (flash drive) when using hd install
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [26 Posts]   Goto page: Previous 1, 2
Author Message
Fractal

Joined: 08 Dec 2010
Posts: 8

PostPosted: Thu 17 Feb 2011, 11:48    Post subject:  

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.
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2855
Location: The Blue Marble

PostPosted: Fri 18 Feb 2011, 06:14    Post subject:  

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, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 4155
Location: West Lothian, Scotland, UK

PostPosted: Fri 18 Feb 2011, 12:47    Post subject:  

Job done, altered ISO file made as per your instructions. Very Happy

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. Very Happy
SUCCESS! Very Happy
IT WORKS! Cool
Back to top
View user's profile Send private message 
Jasper

Joined: 25 Apr 2010
Posts: 1350
Location: England

PostPosted: Fri 18 Feb 2011, 14:09    Post subject:  

Hi Sylvander and jamesbond,

It's good to see a job well done.

My regards
Back to top
View user's profile Send private message 
Bruce B


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

PostPosted: Mon 10 Sep 2012, 22:09    Post subject:  

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.


~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
DocSalvage


Joined: 30 Jun 2012
Posts: 11
Location: Tallahassee, FL, USA

PostPosted: Sat 29 Dec 2012, 19:21    Post subject:  

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:
PMEDIA=atahd

to
Code:
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.

_________________
DocSalvage (a.k.a. DocSalvager)
www.docsalvage.info, www.softwarerevisions.net
Back to top
View user's profile Send private message Visit poster's website 
MyPuppysaysWauWau


Joined: 20 Feb 2014
Posts: 146
Location: Austria/Vienna

PostPosted: Mon 04 Jan 2016, 17:57    Post subject:  I had this problem in TurbopupXtreme too
Subject description: but I got a simple solution!
 

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...

Quote:
cp /root/.etc/rc.d/PUPSTATE13 /root/.etc/rc.d/PUPSTATE


...in the rc.local file.

Thats all Smile

Regards,
Walter

_________________
Don't start because it's easy. Start because it's worth trying. Don't stop because it's hard. Stop because you tried your Best.
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 1406
Location: UK

PostPosted: Mon 04 Jan 2016, 18:49    Post subject:  

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))
Back to top
View user's profile Send private message 
DocSalvage


Joined: 30 Jun 2012
Posts: 11
Location: Tallahassee, FL, USA

PostPosted: Tue 05 Jan 2016, 06:41    Post subject:  

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.

_________________
DocSalvage (a.k.a. DocSalvager)
www.docsalvage.info, www.softwarerevisions.net
Back to top
View user's profile Send private message Visit poster's website 
MyPuppysaysWauWau


Joined: 20 Feb 2014
Posts: 146
Location: Austria/Vienna

PostPosted: Tue 05 Jan 2016, 15:59    Post subject:  

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.

_________________
Don't start because it's easy. Start because it's worth trying. Don't stop because it's hard. Stop because you tried your Best.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4182
Location: Kiel,Germany

PostPosted: Thu 14 Jan 2016, 20:06    Post subject:  

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

Code:
# 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:
_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:
_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:
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 Razz
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [26 Posts]   Goto page: Previous 1, 2
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.0854s ][ Queries: 12 (0.0038s) ][ GZIP on ]