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 Fri 25 Jul 2014, 16:02
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Booting and running with CF card in IDE adaptor (Solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
playdayz


Joined: 25 Apr 2008
Posts: 3788

PostPosted: Tue 29 Apr 2008, 13:31    Post subject:  Booting and running with CF card in IDE adaptor (Solved)
Subject description: How does Puppy determine that it is booting from a CF (flash card) in an IDE adaptor?
 

Is anyone interested in how Puppy determines that it is booting from a CF (flash card) in an IDE adaptor? I am interested because that is what I have, a Sandisk Extreme IV 4GB in an Addonics CF to IDE adaptor. Everything works great except that Puppy doesn’t seem to be able to distinguish this CF/IDE (ideflash) arrangement from a physical hard disk (idehd) no matter what I do. At least I don’t think it does. The reason I am interested is that I understand that Puppy will minimize writes to a flash disk but not to a physical hard disk.

The funny thing about this, is that the Addonics CF to IDE plus the Sandisk is supposed to look and behave exactly like a physical hard disk—and it does. I’ve installed XP-SP2 and Mandriva 2008 and both installed and ran with no problems, just as with a physical disk. Puppy does too, except for the writes (which may even be a bogus issue with an advanced card like the Sandisk IV???).

I installed Puppy 3.01 with the CF card in IDE adaptor option from the Universal Installer. It installed and ran perfectly (it installed as with a CD with extlinux, etc, instead of Grub). In /etc/rc.d/PUPSTATE the PUPMODE=12 and the pmedia=ideflash. I was told in a question in the Newbie Forum that with a CF card in an IDE adaptor the PUPMODE should be 13, and that makes sense from looking at the documentation (the +1 comes from mounting a third layer and not writing pup_sav.2fs directly to the disk in real time). This seems like a separate, more advanced problem so I am introducing it here (I have tried to avoid any typos Wink

I can also install with the Hard Disk option. That installs with Grub in the MBR and the PUPMODE=12 and pmedia=idehd. From the two installs, it looks like maybe pmedia is set at install time—but that PUPMODE is determined while booting???

Elsewhere in the docs I have seen that pfix=nodma is recommended for CF cards in IDE (and also for usbflash). Maybe that is a clue because the Sandisk IV is a “udma” card and works about as fast as a udma 4 drive. This is not the most important problem in the forums I know, but these little things help to learn the guts of the OS. Thanks.

Last edited by playdayz on Tue 29 Apr 2008, 19:21; edited 1 time in total
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Tue 29 Apr 2008, 17:26    Post subject:  

I think I have isolated the problem code in init
Code:
#do we want a tmpfs top unionfs layer?...
#only if pup_save (or PDEV1 for DEV1PUP=yes, or first boot) on a flash drive, usb or internal...
case $PUPMODE in
 4) #so far have only got a pup_xxx.sfs. this is first boot or pfix=ram.
  PUPMODE=5 #`expr $PUPMODE + 1` #yes, want tmpfs top layer (PUPMODE=5).
  ;;
 12) #4=pup_xxx.sfs found, 8=pup_save.2fs found.  total=12
  DRVSAVE="`echo -n "$PUPSAVE" | cut -b 1-3`"
  REMOVABLEDRVSAVE="`cat /sys/block/$DRVSAVE/removable`"
  [ "$REMOVABLEDRVSAVE" = "1" ] && PUPMODE=13 #`expr $PUPMODE + 1`
  ;;
I suspect that your device has a zero in /sys/block/$DRVSAVE/removable I'm guessing that on your system it is either /sys/block/sda/removable or /sys/block/hda/removable. If this is the case then I am amazed that no-one else with an ideflash install has had a similar problem. It would seem much safer to test the PMEDIA variable as well to determine what pupmode should be set. I also imagine that there are some people that might be willing to trust the inbuilt wear leveling on their flash controller in exchange for getting immediate writes. If you can confirm what you get for
Code:
cat /sys/block/hda/removable
we can see if we can patch init to work properly. If you want to edit init then PizzasGood gives instructions here: http://www.murga-linux.com/puppy/viewtopic.php?p=187357#187357or a can send you a patched initrd.gz for you to try tomorrow.

<edit>this has been reported before http://www.murga-linux.com/puppy/viewtopic.php?t=26800 so you are not the only one affected </edit>

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
playdayz


Joined: 25 Apr 2008
Posts: 3788

PostPosted: Tue 29 Apr 2008, 19:17    Post subject: Determining PUPMODE for some CF to IDE Adaptors (Solved)  

Yes, that's it. It works.

There was a 0 in cat /sys/block/hda/removable

I followed pizzasgood's instructions to edit the initrd.gz.

I used this patch because I thought it was less easy for me to misunderstand.

http://www.murga-linux.com/puppy/viewtopic.php?t=13430
Quote:

Find the following line of
Code:

case $PUPMODE in

then add before it this line of
Code:

PUPMODE=13


When I rebooted the first thing I saw was a new icon on the desktop--the target that says SAVE. Then I checked /etc/X11/PUPSTATE and sure enough we had a PUPMODE of 13.

Well, the first time I rebooted I had a PUPMODE of 5, then when I quit and saved I booted in 13.

This has been great fun guys, please let me know if I can be of use testing for CF cards or other patches for this condition etc. I am very tenacious Wink Thanks much for your time.
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Wed 30 Apr 2008, 02:17    Post subject:  

Excellent.
That will work for you but not as a generic solution as it hardcodes PUPMODE=13
For future puppy releases I recommend the following as a patch the line at the bottom checks the state of the PMEDIA boot parm
Code:

 12) #4=pup_xxx.sfs found, 8=pup_save.2fs found.  total=12
  DRVSAVE="`echo -n "$PUPSAVE" | cut -b 1-3`"
  REMOVABLEDRVSAVE="`cat /sys/block/$DRVSAVE/removable`"
  [ "$REMOVABLEDRVSAVE" = "1" ] && PUPMODE=13 #`expr $PUPMODE + 1`
[ "$PMEDIA" = "ideflash" ] && PUPMODE=13
  ;;

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 2246
Location: New Zealand

PostPosted: Tue 27 May 2008, 00:15    Post subject: won't boot if I tell it PMEDIA=ideflash  

I haven't tried modifying initrd.gz as yet, but have simply tried putting PMEDIA=ideflash on my menu.lst kernel line.
Unfortunately, it won't then boot: says it can't find the pup_400.sfs file
If I use PMEDIA=usbflash it boots fine.
You can find my full menu.lst contents here:

http://www.murga-linux.com/puppy/viewtopic.php?t=29580
Back to top
View user's profile Send private message Visit poster's website 
mcewanw

Joined: 16 Aug 2007
Posts: 2246
Location: New Zealand

PostPosted: Tue 27 May 2008, 04:24    Post subject: booting from flash drive on Classmate  

Hairy Will wrote:
If you want to edit init then PizzasGood gives instructions here: http://www.murga-linux.com/puppy/viewtopic.php?p=187357#187357


I couldn't get the Intel Classmate to boot Puppy Dingo at all with PMEDIA=ideflash, so I just used PMEDIA=usbflash and modified initrd.gz to:

Code:

 12) #4=pup_xxx.sfs found, 8=pup_save.2fs found.  total=12
  DRVSAVE="`echo -n "$PUPSAVE" | cut -b 1-3`"
  REMOVABLEDRVSAVE="`cat /sys/block/$DRVSAVE/removable`"
  [ "$REMOVABLEDRVSAVE" = "1" ] && PUPMODE=13 #`expr $PUPMODE + 1`
PUPMODE=13
  ;;


i.e. on the last line above, I forced $PUPMODE to 13 should it otherwise have been 12. So, if no pup_save file created, the system still starts off booting to PUPMODE 5.
That worked for me; now I get the big SAVE icon on the desktop and so on.

I guess it might have been better to make the last line:
[ "$PMEDIA" = "usbflash" ]
since then I'd have some control over it, but I haven't tried that. Don't know why PMEDIA=ideflash wouldn't boot at all or I would have used Hairy Will's suggestion.
Back to top
View user's profile Send private message Visit poster's website 
magerlab

Joined: 08 Jul 2007
Posts: 731

PostPosted: Thu 19 Jun 2008, 16:46    Post subject:  

is there a way to change init to force looking for puppyfiles or modem if we know that all the files are on eee's ssd and there's no modem present
or no version upgrade?

thank you

_________________
skype: desafimager
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
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.0702s ][ Queries: 12 (0.0043s) ][ GZIP on ]