From: Mark Knecht <markknecht@gmail.com>
To: Gentoo User <gentoo-user@lists.gentoo.org>
Subject: [gentoo-user] Building an initramfs into the kernel
Date: Wed, 26 Dec 2012 07:58:34 -0800 [thread overview]
Message-ID: <CAK2H+ee+R9EgWBkbiv7c+uAtuc+XRkPgh7XQ+feLb08+2YmM+A@mail.gmail.com> (raw)
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
next reply other threads:[~2012-12-26 16:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-26 15:58 Mark Knecht [this message]
2012-12-26 17:09 ` [gentoo-user] Building an initramfs into the kernel Neil Bothwick
2012-12-26 20:48 ` Mark Knecht
2012-12-26 21:49 ` Mark Knecht
2012-12-26 22:09 ` Mark Knecht
2012-12-26 23:03 ` Neil Bothwick
2012-12-26 23:50 ` Mark Knecht
2012-12-27 17:33 ` Mark Knecht
2012-12-27 23:24 ` Mark Knecht
2012-12-28 23:07 ` Mark Knecht
2012-12-29 0:41 ` Neil Bothwick
2012-12-26 23:02 ` Neil Bothwick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK2H+ee+R9EgWBkbiv7c+uAtuc+XRkPgh7XQ+feLb08+2YmM+A@mail.gmail.com \
--to=markknecht@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox