Welcome! Log In Create A New Profile

Advanced

Building the uInitrd (initramfs) with dracut and the rescue shell

Posted by gnexus 
Building the uInitrd (initramfs) with dracut and the rescue shell
October 27, 2012 03:03PM
A10 really needs an initramfs. That is the only way to do multi-boot on Allwinner SoCs. The crappy default u-boot has no support for booting other devices such as SATA, USB or network devices. That support should have been included by Allwinner. We should at least have PHY support for netconsole, if nothing else. Marvell has support for all these devices in their uboot. For the A10 we must have a workaround. The initrd is needed regardless. It really should not be needed for multi-boot, however. But hey, that's all there is. . .

So we need a way to build a decent uInitrd. You can use the standard Debian initramfs tools. But they are quite limited. Dracut is the new tool for building an initramfs. It is available in Debian and Ubuntu, and is already the default tool in other major Linux distributions such as Fedora and Gentoo. It is much more advanced, and is easier to use. It is what I use.

In my case I also want network boot support to be available. I also want a fallback rescue shell if the device fails to boot. Dracut has a rudimentary rescue shell. But it is extremely limited. It has a busybox module. But the dracut busybox is very limited and does not suffice. By adding a busybox we have an almost complete Linux distro right inside the rescue shell. By also adding dropbear it also possible to SSH into the rescue shell (although currently you have to really work at it). The dropbear support is there for future use in an add-on dracut module that will help everyone that uses dracut in their distro. It does not work currently unless you add a lot of your own initscripts into the dracut image. But hey, it's there to play with if you wish. It would be nice to have help with the dracut module. So if you have experience with initscripts please help out. I hopefully will have a dracut-druid (Dracut Rescue Utililty and Installer Disk) git repo up soon if you would like to help with the project. Please note that, since rescue shell net scripts are missing, the rescue shell is only available in a serial console.

Anyway, here is all the stuff you need to build the uInitrd as currently supplied in the kernel archive. This archive needs to be extracted to your home directory on your A10 device. Please note that the script manipulates your entire /bin directory, and the reboot and poweroff binaries in your /sbin. If you interrupt the script during execution it may leave those directories, or files in them, corrupted. So back up your system. Be careful, and don't hit Ctl-C while running the script!

BTW, this busybox and script can also be used to build dracut for other armv7 platforms. Just edit to suit your needs.

Here is the archive: http://download.doozan.com/a10/dracut-build.tar.bz2
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: