Author Topic: Booting Modern Distros From An Sd Card Using The 2.6.23 Kernel  (Read 9806 times)

danr

  • Full Member
  • ***
  • Posts: 138
    • View Profile
    • http://
Booting Modern Distros From An Sd Card Using The 2.6.23 Kernel
« on: January 21, 2008, 04:20:27 am »
Hi all,

For some time I've tried to get the Angstrom 2.6.23 kernel to work with Debian on my C860, but I've been bitten by the altboot bug (see http://bugs.openembedded.org/show_bug.cgi?id=1718 for example), where the system freezes a few seconds after booting.

I think I've found a solution to this issue.  After doing some experimenting, it looks like the system hang can be prevented by executing /etc/init.d/sysklogd script early on during initialisation.  I don't know why this should stop the hanging, but it does.  So to ensure this is run early in initialisation,

[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
cd /etc/rcS.d
ln -sf ../init.d/sysklogd S01sysklogd
[/div]

Note that you still have to be fast at selecting option 1 (boot from flash) or 3 (boot from SD card) in the altboot menu, and that you usually have to make the selection twice.  I also commented out line 474 of /etc/altboot.func, so that it says

[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
#$FSCK $1 || sleep 2
[/div]

otherwise when booting from SD card, it always checks the filesystem, which takes forever, and may lead to the system freezing because the syslog daemon is not executed in time.

 My current setup is as follows:

Latest Angstrom kernel and console image including altboot installed on flash.
Debian tarball unzipped to SD card (in /debian directory).
Angstrom filesystem unzipped to SD card (in /angstrom directory).

The failsafe mode is to boot Angstrom from flash.  To experiment with the minimum requirements needed for booting, I

[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
cd /media/card
ln -sf angstrom/* .
[/div]

Then I play around with which scripts I keep inside /etc/rcS.d and /etc/rc5.d, run altboot, select option 3, and see if the system boots.  If it doesn't, I remove the power, select altboot option 1, boot from flash, and make further changes.

To boot Debian, I

[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
cd /media/card
ln -sf debian/* .
[/div]

and then boot from the SD card.

At the moment I haven't got the CF card working, so maybe this functionality has been removed from the kernel so that I need to load a module or something.

In theory this technique could also be used for other distros, such as  Android.

I might have missed other dependencies, such as one or two binaries from Angstrom /sbin, but if other people try this method for determining what the boot requirements are, then we would get a definitive answer.  If anyone gets this to work, please add further comments to this thread.

Cheers,

Dan
« Last Edit: January 21, 2008, 04:31:31 am by danr »
SL-C860 running Debian EABI on top of Angstrom 2.6 kernel

kibymo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Booting Modern Distros From An Sd Card Using The 2.6.23 Kernel
« Reply #1 on: January 22, 2008, 10:00:45 am »
I follow your way and it can boot to 2.6.23 on c860, but the wireless module can't load.
so I back 2.6.21 again
Thanks anyway

henrysviper

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • http://prasinos.eu/
Booting Modern Distros From An Sd Card Using The 2.6.23 Kernel
« Reply #2 on: February 15, 2008, 06:23:11 pm »
I have the same problem as kibymo

I tried it with my C750 and now I have no trouble alt-booting in Angstrom (in SD) or Debian armel, but in debian the CF cards are not recognized at all.


Edit: After looking at the output from lsmod in Angstrom, I found that modprobing (in Debian) "pxa2xx_cs" before inserting a CF card fixes the problem. (Maybe a udev rule would help?)
Thanks Dan for the original solution.
« Last Edit: February 15, 2008, 07:27:33 pm by henrysviper »
C750 :: Switching between Angstrom and Debian armel :: SD Kingstron 2GB (ext3) :: SD Toshiba 512MB (ext3) :: CF Transcend 80x 1GB :: CF Lexar 4x 256MB :: Ambicom CF WiFi :: Targus CF Modem :: Brando solar charger

henrysviper

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • http://prasinos.eu/
Booting Modern Distros From An Sd Card Using The 2.6.23 Kernel
« Reply #3 on: February 18, 2008, 07:20:03 am »
Dan,

You do not need this setup with two directories (angstrom/debian) and creating symbolic links. Altboot supports booting loopback images.
If you have the rootfs as a file ending in ".rootfs.tar.gz" in SD, then altboot (through the "Advanced" menu) can create a loopback image out of it for you. When booting, altboot sees all the images and presents you with a menu allowing to choose which one to boot. Thus, if you have a big enough SD card you can have many distributions on it without problems and workarounds.

Also, commenting out line 474 of /etc/altboot.func is not needed. The file /etc/altboot-2.6.cfg contains a variable "FSCK_IMAGES": set it to "no" to disable checking (remember to check them manually from time to time from the NAND installation though).

Edited to add info about FSCK_IMAGES
« Last Edit: February 26, 2008, 06:37:37 pm by henrysviper »
C750 :: Switching between Angstrom and Debian armel :: SD Kingstron 2GB (ext3) :: SD Toshiba 512MB (ext3) :: CF Transcend 80x 1GB :: CF Lexar 4x 256MB :: Ambicom CF WiFi :: Targus CF Modem :: Brando solar charger

danr

  • Full Member
  • ***
  • Posts: 138
    • View Profile
    • http://
Booting Modern Distros From An Sd Card Using The 2.6.23 Kernel
« Reply #4 on: February 19, 2008, 07:24:07 am »
Quote from: henrysviper
Dan,

You do not need this setup with two directories (angstrom/debian) and creating symbolic links. Altboot supports booting loopback images.
If you have the rootfs as a file ending in ".rootfs.tar.gz" in SD, then altboot (through the "Advanced" menu) can create a loopback image out of it for you. When booting, altboot sees all the images and presents you with a menu allowing to choose which one to boot. Thus, if you have a big enough SD card you can have many distributions on it without problems and workarounds.

Are the loopback images read-only or is there support for writing to them as well?

Cheers,

Dan
SL-C860 running Debian EABI on top of Angstrom 2.6 kernel

henrysviper

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • http://prasinos.eu/
Booting Modern Distros From An Sd Card Using The 2.6.23 Kernel
« Reply #5 on: February 20, 2008, 04:54:49 am »
Quote from: danr
Are the loopback images read-only or is there support for writing to them as well?

A loopback image is just like a "normal" filesystem, so it is writable (the only limitation is that is has a fixed size).
Check out the altboot FAQ for more info.
« Last Edit: February 26, 2008, 06:38:25 pm by henrysviper »
C750 :: Switching between Angstrom and Debian armel :: SD Kingstron 2GB (ext3) :: SD Toshiba 512MB (ext3) :: CF Transcend 80x 1GB :: CF Lexar 4x 256MB :: Ambicom CF WiFi :: Targus CF Modem :: Brando solar charger

svs57

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • http://
Booting Modern Distros From An Sd Card Using The 2.6.23 Kernel
« Reply #6 on: October 16, 2008, 06:45:35 am »
Hi
As I understand I need
1. flash Angstrom
2. put Debian rootfs on SD
3. type 3 while booting Angstrom
Thats all?
Do anybody test Andromeda rootfs? I can't use it because kernel doesn't suport 750.
If not where can I get working debian rootfs?