Hi,
   OK, it's the day after Christmas and this little kid wants to play
with the new toys Uncle Neil gave us yesterday - a copy of his well
worn setup file for building an initramfs into the kernel - a copy of
which I place here:

[QUOTE]

This is the file I use on a system that has / on a LUKS filesystem on top
of LVM. The format is documented in the kernel docs at
Documentation/filesystems/ramfs-rootfs-initramfs.txt


dir /bin 755 0 0
file /bin/busybox /bin/busybox 755 0 0
slink /bin/sh busybox 777 0 0

dir /realroot 755 0 0
dir /etc 755 0 0
dir /proc 755 0 0
dir /sys 755 0 0

dir /sbin 755 0 0
file /sbin/lvm.static /sbin/lvm.static 755 0 0
#file /sbin/mdadm /sbin/mdadm 755 0 0
file /sbin/cryptsetup /sbin/cryptsetup 755 0 0

file /sbin/e2fsck /sbin/e2fsck 755 0 0
dir /lib 755 0 0
file /lib/libext2fs.so /usr/lib64/libext2fs.so 755 0 0

dir /dev 755 0 0
nod /dev/console 600 0 0 c 5 1
nod /dev/null 666 0 0 c 1 3
nod /dev/tty 666 0 0 c 5 0
nod /dev/urandom 666 0 0 c 1 9

file /init /usr/src/init.sh 755 0 0

[/QUOTE]


   OK, so reading through this it seems moderately straight forward. My reading:

a) Create some directories
b) Populate them with some executables
c) Make some nodes
d) Execute a script


I do have a few questions:

1) dir /realroot 755 0 0

Is this something required to make the machine boot? Or is it possibly
a mount point in case of problems and just used inside the initramfs
if trouble arises? Something else? Google didn't point me toward
anything meaningful.

2) Contained executables, as I understand them, either need to be
built with the static flag or you have to include all the libraries.
Static seems simpler so (in my case) should I rebuild mdadm &
e2fsprogs with +static? (I don't currently use lvm or any crypt stuff)
I assume from the line

file /lib/libext2fs.so /usr/lib64/libext2fs.so 755 0 0

that running ldd on the new mdadm is still going to require this one
library be in the initramfs?

3) My system uses RAID today. Is there any significant risk in
rebuilding mdadm with static support, rebooting the existing kernel
without an initramfs and then mdadm having trouble?

4) What's in /usr/src/init.sh ? From the Gentoo initramfs wiki I find
this as an example:

rescue_shell() {
    echo "Something went wrong. Dropping you to a shell."
    busybox --install -s
    exec /bin/sh
}

I wonder what Uncle Neil uses? (Or anyone else...)

   Yipee!!! Better than the Red Ryder BB gun complete with a compass
and a sundial I was hoping for! ;-)

   (And if it's not clear, I'm hoping this thread might possibly help
others in the future move from one place about initramfs to another
place about initramfs. We'll see.)

Cheers,
Mark

Reply via email to