Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy home page: puppylinux.com
 
 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 08 Feb 2010, 18:18
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Boot from SD card reader no BIOS support? (Solved)
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Author Message
Snail

Joined: 18 Oct 2009
Posts: 22

PostPosted: Sun 18 Oct 2009, 20:48    Post_subject:  Boot from SD card reader no BIOS support? (Solved)  

I would like to be able to boot Puppy from the internal SD card reader of my laptop. I do this with my Asus EEE 4G notebook and it is great to be able to have a a removable, bootable media that I can plug in and basically forget. Using a USB stick for the same job is not as good because, as long as the stick is plugged in, there is a risk of knocking the drive and damaging the stick and the computer.

Unfortunately, many laptops, including my Compaq Presario C793, do not have BIOS support for booting from the internal card reader. I have searched this forum and have been unable to find sufficiently complete information on how to overcome this problem. However, my Googling indicates that a work-around should be possible. I need some support from this forum to do it, if it is in fact possible.

Once Puppy is loaded, from a USB or hard-drive install, the SD drive is fully accessible. PMOUNT sees it under the "usbdrv" tag as "Generic-Multi_Card" "sdb1". The problem is that the kernel cannot see the drive at boot time, only after Puppy is fully loaded are the drivers for the card available.

Although a total direct boot from SD can't be done without BIOS support, it is apparently possible to boot, via GRUB mounted on a BIOS supported device, e.g. the hard drive. The trick is, apparently, to add an entry for the SD installed OS to menu.lst on the hard drive. The initrd line in this entry must point to a specially modified copy of initrd.gz, also on the hard drive. The modified initrd.gz needs to have the SD and MMC drivers included, so that the kernal can see the SD card and access the copy of Puppy on the card at boot.

The instructions for creating the modified initrd I have found on the web do not work for Puppy, because Puppy doesn't have the mkinitrd or initramfs-tools helper scripts they use. Instead I need to edit initrd.gz directly. There are several pages on this forum showing how to open initrd.gz for editing. I have done that. It seems reasonably straightforward to copy the driver modules into initrd. However, it is also necessary to edit the init script file to instruct the kernal to load these drivers. This is beyond me at present.

Can anyone please help?

What I am trying to do seems sufficiently generally useful that I was a bit surprised not to find a howto here. Or even an option in the universal installer. Have I missed something or is it a much harder task than it seems?

Edited_time_total
Back to top
View user's profile Send_private_message 
Snail

Joined: 18 Oct 2009
Posts: 22

PostPosted: Sun 25 Oct 2009, 18:54    Post_subject: It's working but I am not sure why
Sub_title: (EDIT "Why" solved. See end of this post)
 

What, 90 views and no help yet? Well I kept on trying and now I have a working SD install. However, I am not sure why the GRUB setup I have works at all, so this may not work for everybody.

From an existing, bootable install of Puppy 430, I installed 430 to an SD card, using the universal installer. (Note, I did this from an Asus EEE 4G, using Puppy 430 on a USB stick as the bootable medium and the internal card reader. The EEE does have BIOS support for booting from SD. I am not sure that BIOS support is really necessary for this stage, I have yet to test it. It does make it easy to check that the SD install is good.)

I followed Pizzasgood's instructions on how to unpack a copy of initrd.gz into a sub-directory called initrd-tree.

Quote:
To edit initrd.gz, open a terminal in the same location as it (make sure it's a linux partition), and run this:

Code:
mkdir initrd-tree
cd initrd-tree
zcat ../initrd.gz | cpio -i -d

That will make a directory initrd-tree that contains the contents of the initrd.gz file. Go inside and edit away. When you're finished, from inside the initrd-tree directory, run these commands:

Code:
find . | cpio -o -H newc | gzip -9 > ../initrd.gz


I copied the mmc directory from /lib/modules/2.6.30.5/kernel/drivers to
-----/initrd-tree/lib/modules/2.6.30.5/kernel/drivers

I opened the file init in the initrd-tree directory as text and added the lines

Code:
#Snail's modification to allow booting from SD without BIOS support##########
modprobe mmc_block
modprobe mmc_core
modprobe sdhci
modprobe sdhci_pci


just above the existing lines

Code:
check_status 0 #END STEP ONE
##############END MODULE LOADING TO ACCESS DRIVES####################


I saved and exited and then used pizzagood's instructions to make a new initrd file called pup430-sd-initrd.gz

I copied this file to /mnt/home. There are now two initrd files in the root of the bootable puppy partition, together with pup-430.sfs, pupsave-peter.2fs and vmlinuz.

Now I needed to setup Grub to boot the SD. This is a bit complicated on my laptop, as I am already multibooting Vista, PCLinuxOS 2009 and Puppy 430 from the hard disk. I use the PCLinuxOS GRUB, stating from the MBR. (I'd like to test the Puppy GRUB installer but an a bit wary of this). Here are the Puppy parts of my menu.list on the PCLinuxOS /boot/grub/:

Code:
title Puppy Linux 430 frugal
rootnoverify (hd0,8)
kernel /vmlinuz pmedia=atahd nosmp
initrd /initrd.gz

title Puppy Linux 430 frugal SD
rootnoverify (hd0,8)
kernel /vmlinuz pmedia=usb nosmp
initrd /pup430-sd-initrd.gz


This appears to work perfectly! The setup was only meant to test the new initrd and it surprises me that it "knows" to use the right pup-430.sfs and pupsave files. However I have tested and I am sure that it is working. Adding things like rootnoverify (sd1,0) or adding (hd0,8) to the initrd statement just result in Grub errors. Will need to find out more about GRUB. I have not tested what happens when a USB stick with puppy is added to the mix. (EDIT it is not GRUB directly that is sorting out which version of the Puppy files to load, it's the pmedia parameter that passes the information to the kernel. See the discussion at the bottom of this page.)

Edited_time_total
Back to top
View user's profile Send_private_message 
kayan


Joined: 14 Feb 2008
Posts: 64
Location: India

PostPosted: Tue 10 Nov 2009, 04:05    Post_subject:  

I am a newbee ,but i wanted to boot from sd ram or from usb ,but my laptop does not support usb booting ...i wish you all the best ,so that people like me can use your initrd .gz to boot puppy
thanks for trying Very Happy

_________________
SAHARA laptop intel celeron M 1.4 GHz/ 768Mb Ram /40GB ,SIS 661 chipset,
Back to top
View user's profile Send_private_message Send_email 
jemimah


Joined: 26 Aug 2009
Posts: 1076
Location: Tampa, FL/McLean, VA

PostPosted: Tue 10 Nov 2009, 12:47    Post_subject:  

This will not help people who can't boot at all from usb, but if your goal is simply to be able to remove the USB stick drive so it doesn't get snagged on stuff, you can try my Ramboot script. It will load everything to RAM, so you can remove the drive. Then if you put the drive back during shutdown, it will put your save file back on the drive.

http://www.murga-linux.com/puppy/viewtopic.php?t=48465
Back to top
View user's profile Send_private_message Send_email Visit_website 
disciple

Joined: 20 May 2006
Posts: 3803
Location: Auckland, New Zealand

PostPosted: Tue 10 Nov 2009, 16:16    Post_subject:  

If you can't boot from USB you can always use a wakepup floppy disk. But you're better off to boot from the hard drive.
_________________
Probably posting from Colinux (if I'm at work)
Root forever! (Link courtesy of Nathan F)
Back to top
View user's profile Send_private_message 
Snail

Joined: 18 Oct 2009
Posts: 22

PostPosted: Thu 12 Nov 2009, 01:59    Post_subject:  

Hi Kayan,

I don't know how much computer expertise you have, so please excuse me if the first bit seems too basic. I assume that you have already tried to select the USB media as the first boot option in your BIOS setup? If you have tried that and confirmed that that is not possible, it may be possible to download a more up to date BIOS from the laptop manufacturer and flash the BIOS to make USB booting work. (Never flashed one myself however, it seems a bit scary to try something that could "Brick" the system.) If you can't make the either the USB or the SD boot the "proper" way, then either my trick or, as Disciple points out, an install to the internal drive are options. Or you could boot from the CD or floppy, if your laptop has them.

What my trick actually does is allow you to run Puppy that is loaded onto an un-bootable sd card. You are actually booting from your internal hard drive. To access the Puppy on the sd card, you therefore have to have to load GRUB, my initrd and the kernel(the vmlinuz file) on the internal drive. These are all really small files compared to even a small Puppy system, so if you don't want to make space for the main Puppy files on the internal drive, or if you want to use same Puppy setup on other computers this is useful. So really its a sort of pseudo-SD-boot, or a combined un-bootable_SD/bootable-media trick.

Nothing I did seems to require a USB at all. However, you obviously have to be able to boot Puppy somewhere to install onto the SD and to make the initrd. You also need to be able to install GRUB or some other multi-bootloader to your hard drive.

Presumably if the USB is not bootable, you have another way of booting, like a CD drive, or maybe even a floppy, as Disciple suggested? You only need that alternative boot media during the setup stages. Or you could try doing the set-up work on another machine and then copying the files to the laptop.

Incidentally, you could use my approach to allow a pseudo_USB boot on your system. In that case, you wouldn't have to make a special initrd at all, just copy the normal one to your hard drive along with the kernel and setup GRUB as described. If that was done, I'd be inclined to use Jemima's clever script as well.

As I noted above, I have not tested doing the actual initial install on the SD card using a non-bootable card-reader. I read somewhere that that wasn't possible, but I can't see why. Make sure that the SD card partition has the bootable flag set though.
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 3803
Location: Auckland, New Zealand

PostPosted: Thu 12 Nov 2009, 06:10    Post_subject:  

Of course if you're computer doesn't normally support USB booting it probably means it is old and it would be painfully slow to boot from USB anyway... why don't you want to boot from CD or hard drive?
_________________
Probably posting from Colinux (if I'm at work)
Root forever! (Link courtesy of Nathan F)
Back to top
View user's profile Send_private_message 
ICPUG

Joined: 24 Jul 2005
Posts: 596
Location: UK

PostPosted: Thu 12 Nov 2009, 09:34    Post_subject:  

Snail

I am pretty dumb regarding this but it looks interesting.

The key to getting your SD card to boot seems to be modifying the initrd.gz by
(a) copying the mmc directory
(b) adding those lines in init

Do you happen to know the equivalent steps for getting a usb stick, rather than an SD card to boot?
Back to top
View user's profile Send_private_message 
Snail

Joined: 18 Oct 2009
Posts: 22

PostPosted: Thu 12 Nov 2009, 16:44    Post_subject:  

ICPUG

As I noted in my last post, using the same process as for the SD should work. The difference is that there is no need to produce a modified initrd.gz. This is because the standard one already contains and loads the USB modules. So you would just need to copy it. NOTE, I think that works, haven't actually tested it.

Disciple, there are a few reasons to do this. If you set up the USB in the normal way, you can cart it around much more conveniently than a CD and it will run on any modern PC. This trick essentially just modifies the old PC to be able to behave more like a modern one. I agree however that it may well be very slow to boot and save on a USB 1.0 port. I have read that older SD card setups are even slower but I don't know the specifics. On the other hand, provided the system has more than 256Meg of RAM, it should actually run OK once loaded, since Puppy itself runs entirely in RAM. There are ways to force the Pupsave into ram as well, and you can turn off the automatic Pupsave backup during sessions if you want.
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 3803
Location: Auckland, New Zealand

PostPosted: Fri 13 Nov 2009, 02:33    Post_subject:  

Quote:
If you set up the USB in the normal way, you can cart it around much more conveniently than a CD and it will run on any modern PC.

Yes.
I think you could also set up the USB in the normal way but on that particular PC boot from an unmodified Puppy (on CD or hard drive) - I think he will still find your save file on the USB disk if there isn't one on the hard drive. Can anyone confirm that?

_________________
Probably posting from Colinux (if I'm at work)
Root forever! (Link courtesy of Nathan F)
Back to top
View user's profile Send_private_message 
mcewanw

Joined: 16 Aug 2007
Posts: 1238
Location: psychologically in Alba

PostPosted: Fri 13 Nov 2009, 07:09    Post_subject: (pseudo) booting from a usb flash drive on an old computer
Sub_title: No usb boot option in its BIOS
 

Snail wrote:

As I noted in my last post, using the same process as for the SD should work. The difference is that there is no need to produce a modified initrd.gz. This is because the standard one already contains and loads the USB modules. So you would just need to copy it. NOTE, I think that works, haven't actually tested it.


I tried your suggestion, and it worked fine (assuming I have correctly interpreted what you expected to occur that is). No modified initrd.gz was required in the following:

Basically, what I did was that I kept a copy of the unmodified initrd.gz and also vmlinuz on my harddrive (in directory puppy431 relative to the partition root, which was hda4 i.e. hd0,3) and put puppy431.sfs onto my sdb1 (usb stick). I used the following stanza in my menu.lst:

Code:

title Puppy431 frugal on sdb1
kernel (hd0,3)/puppy431/vmlinuz root=/dev/ram0 PMEDIA=usb waitusb=10 psubdir=puppy431
initrd (hd0,3)/puppy431/initrd.gz
boot


The PMEDIA=usb part did the trick such that the puppy431.sfs booted from and copied into RAM at boot time was from the usb stick (rather than from the other copy I kept on hda4 in directory puppy431). My old machine just uses USB 1.1 so booting was indeed very slow; /mnt/home definitely became the sdb1 usb stick though! Since I didn't put any pupsave.2fs on sdb1, none was found (since no pupsave.2fs had been previously stored in sdb1/puppy431 directory) - i.e. it was like booting with pfix=RAM (though once I created a pupsave on the sdb1 that was found on next boot of course).

Note that changing PMEDIA=usb to PMEDIA=idehd on the kernel line of menu.lst, and rebooting, resulted in /mnt/home reverting to hda4, and my original pupsave.2fs now being found at boot time (since I had that stored on my hard drive in hda4/puppy431).

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Back to top
View user's profile Send_private_message Visit_website 
mcewanw

Joined: 16 Aug 2007
Posts: 1238
Location: psychologically in Alba

PostPosted: Fri 13 Nov 2009, 08:04    Post_subject:  

I have since tried without waitusb=10 and my old Dell CPx laptop (with no USB Bios support) still booted fine with the pup431.sfs on the USB stick as described above. It actually wasn't too slow on the second boot (after the pupsave file had been created (probably because the RAM is only 256 MB on my system, so I suspect not much gets copied into RAM at boot time).

One good thing about running from the USB stick is that I should be able to let the harddrive spin down (less noise and power usage).

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Back to top
View user's profile Send_private_message Visit_website 
ICPUG

Joined: 24 Jul 2005
Posts: 596
Location: UK

PostPosted: Fri 13 Nov 2009, 08:50    Post_subject:  

mcewanw

Thanks for running the test and posting the successful result of booting a non bios bootable USB based Puppy.

I am going to keep a reference of this thread as I am sure this question will be asked again!
Back to top
View user's profile Send_private_message 
Snail

Joined: 18 Oct 2009
Posts: 22

PostPosted: Fri 13 Nov 2009, 15:34    Post_subject: OK I think we have solved this one  

Yes, it seems that the pmedia parameter is the answer to how the correct distro and save files are found. In the unlikely event that you wanted to attach several usb sticks at the same time, each with their own Puppy, you would need to get a bit clever with psubdir or the likes in order to distinguish between them. Note cards in card readers seem to be detected as usb as well, so duplication is not that impossible if you tend to just leave a puppy in the reader, as I do. I'll leave working that out "as an exercise for the reader".

So I will change the title to this thread to "SOLVED"
Back to top
View user's profile Send_private_message 
Snail

Joined: 18 Oct 2009
Posts: 22

PostPosted: Fri 13 Nov 2009, 16:00    Post_subject:
Sub_title: Boot Parameters
 

mcewanw,

A bit off topic - You are obviously a lot more knowledgeable about the puppy parameters than I am. Do you know if there is a good page that covers them in detail? I have searched around this forum and can't find anything definitive. Also, it's a minor point, but somewhere I saw some comments that "ram0" isn't needed on later versions of Puppy. Is that right?
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
hot copy
[ Time: 0.3694s ][ Queries: 9 (0.0701s) ][ Debug on ]