Adding initramfs to the DLDI builds

Ewan Meadows ewan.meadows at
Thu Apr 24 03:08:04 CEST 2008

Hi all,

I'm currently in the process of trying to fit initramfs into the DLDI
builds.  Basically this is pretty much exactly the same method as used
for romfs at the moment, except this 'glues' a filesystem for booting
onto the kernel, rather than one of the arm bins.  The difference is
that the tools to do it are built into the linux source dir already
and it's rewritable, so /dev entries can be modified (for example) and
also the memory/tools used to boot the system can be reclaimed.

The method I'm looking at is building a smaller busybox that only
contains echo, mount, sh, ls, ln and [.

initramfs contents /boot, /dev and /bin/busyboxinitramfs

/boot/rc is used to mount the dldi device using busyboxinitramfs and
then calls /etc/rc.common.
/etc/rc.common removes /bin (using tools not in /bin of course) and
then symlinks it to /media/linux/bin and then carries on as normal.

The reason I want to use two busyboxes is because the current one is
rather larges so it takes up a lot of memory and most of what's in
there isn't needed for boot.

The trouble is the build system has some interesting quirks when it
comes to romfsinst, so some binaries may need moving around (or
putting them in the proper place, depending on which way you look at

I've used the same basic method on my DLDI-EXT2 builds and it works
great but unfortunately I've hit a snag, which pepsiman pointed out.

One of the first things that gets built during a dslinux build is the
kernel.  Initramfs is normally glued to the kernel when it's being
built.  Initramfs requires the busyboxinitramfs binary which doesn't
exist yet.  I've got a few options:

1. Hack the root Makefile to build the busyboxinitramfs first, then the kernel
2. Glue the initramfs on after the kernel and userspace has been built
in the vendors/Nintendo/DLDI/Makefile
3. Make and put a binary busyboxinitramfs into svn

I'm guessing the best method is number 2, but like I said, the tools
to do this are already integrated into the linux kernel build system,
so it's as easy as having
CONFIG_INITRAMFS_SOURCE="directory/with/initramfs/files" in

Ideas?  Suggestions?


More information about the dslinux-devel mailing list