Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] udev and /usr
Date: Tue, 20 Sep 2011 02:51:21
Message-Id: 4E77FF66.3030308@gentoo.org
In Reply to: Re: [gentoo-dev] udev and /usr by Joshua Kinard
1 On Mon, Sep 19, 2011 at 7:08 PM, Joshua Kinard <kumba@g.o> wrote:
2 > That's what I take issue with -- the whims of a commercial enterprise
3 > ultimately deciding, at some possible, future point, what path we take. In
4 > other words, those of us not running cluster farms shouldn't have to change
5 > things, even slightly (like using an initramfs if needed) for those that do.
6 > Linux's greatest asset is its extreme configurability -- a single source
7 > tree can be compiled to run on super computers or cable boxes.
8
9 For what it's worth, I've got a simple alternative to the initramfs
10 approach, that may be handy for people like you. The idea is to enable
11 CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y in the kernel, pass
12 something like init=/sbin/linuxrc as a kernel parameter via the
13 bootloader, and have /sbin/linuxrc be a simple shell script that mounts
14 /proc, /sys, and /usr before calling 'exec /sbin/init'.
15
16 You can use whatever shell you want for /sbin/linuxrc, as long as it
17 doesn't have some kind of dependency on /usr. For example, if you want
18 your script to run using a really minimal shell with the fewest possible
19 dependencies, you can put '#!/sbin/busybox ash' in the shebang so that
20 it will use your statically linked busybox.
21
22 Something like this should do the trick in /sbin/linuxrc:
23
24 #!/sbin/busybox ash
25 mount -t proc proc /proc
26 mount -t sysfs sysfs /sys
27 mount /usr
28 exec /sbin/init
29
30 --
31 Thanks,
32 Zac