Booting from SD
From A110 Wiki
Warning: This is an advanced topic and bears some risks, please only attempt to follow this HOWTO if you know what you are doing!
Unfortunately, it seems that the BIOS on the A110 does not allow booting from an SD card.
However, using a little trick involving GRUB, some files on the SSD, and the kexec utility it's still possible to boot into a root filesystem on an SD card indirectly.
Note: This is work in progress!
Contents |
Requirements
- A working Linux installation on the SSD.
- The kernel of this Linux install needs kexec support.
- You must have the kexec-tools installed.
- The GRUB bootloader must be installed on the MBR of the SSD.
- You must already have a working Linux installation on your SD card, including the kernel and initrd etc. of that Linux installation.
- The kernel on the SD card must have built-in SD card drivers (not as a kernel module!) as it needs to mount the SD card root filesystem.
Setup
kexec script
On the SSD Linux distribution install the kexec-tools. e.g.:
$ apt-get install kexec-tools
Then, place the following shell script somewhere on your root file system on the SSD, e.g. as /kexec-sd:
#!/bin/sh # Small script to allow booting from SD card on the One A110 laptop via kexec. # Copyright (C) 2008 Uwe Hermann <uwe@hermann-uwe.de> # Licensed under the GNU GPL, version 2 or later. # Uncomment this line to get a shell (useful for debugging). # /bin/sh # Start udevd so that new /dev/mmcblk* devices appear dynamically. udevd & # Load the required modules for SD card access. modprobe mmc_core modprobe mmc_block modprobe vcrdrm # Wait until the /dev/mmcblk* devices appeared (but at most 10 seconds). udevsettle --timeout=10 # Mount the /boot partition of the SD card on /mnt. mount -t ext3 /dev/mmcblk0p1 /mnt # Load the kernel and the respective initrd from the SD card. kexec -l /mnt/vmlinuz-2.6.25-2sdcard-686 --append="root=/dev/mapper/a110sd-root cryptopts=target=crypt0,source=/dev/mmcblk0p2,lvm=vg--whole-lv--root" --initrd=/mnt/initrd.img-2.6.25-2sdcard-686 # Now boot the kernel. kexec -e
Note that the script will likely need various updates for you own setup, e.g. you have to change the kernel/initrd to load, the filesystem and location of you SD card's /boot partition etc. etc. Do not just blindly copy the script!
GRUB
Now edit /boot/grub/menu.lst of your SSD Linux installation and add the following stanza at the very end of the file:
title Boot Linux from SD card root (hd0,0) kernel /vmlinuz-2.6.25-2sdcard-686 root=/dev/mapper/a110-root ro init=/kexec-sd initrd /initrd.img-2.6.25-2sdcard-686
This will add a menu item to GRUB which will load your SSD kernel (which must have SD drivers), then run the /kexec-sd script, which will in turn mount the SD card, and kexec to the kernel on the SD card.
Testing
If everything is set up, reboot and put your SD card into the A110.
The BIOS should remain configured to boot from SSD as usual. GRUB's menu should now have a Boot Linux from SD card entry, which will do just that.
