1 |
i've added a new USE=sep-usr flag to busybox. when enabled, this will install |
2 |
a static busybox at /ginit (and have the other busybox paths symlink to that |
3 |
so there's no overhead). this new applet has a hand written set of commands |
4 |
to automatically mount /dev /proc /sys /usr and seed /dev, and then execute |
5 |
the real init (defaulting to /sbin/init). |
6 |
|
7 |
to use it, update your kernel command line (in grub.conf or whatever) with: |
8 |
init=/ginit |
9 |
if you want to use a different init from /sbin/init, then just do: |
10 |
init=/ginit /some/other/init |
11 |
|
12 |
this code does not require an initramfs, but if you happen to use one anyways, |
13 |
it should be handled automatically. same goes for any other automatic mount |
14 |
aspects of the boot process. |
15 |
|
16 |
this also address the /usr-merge issue since busybox has all the programs it |
17 |
executes built into itself (it's a multicall binary). this is where the |
18 |
openrc early-init scripts failed (they still relied on things in /bin etc...). |
19 |
|
20 |
this also keeps intact the rescue shell scenario. the new applet allows you |
21 |
to execute other applets. so booting the kernel with a command line like so: |
22 |
init=/ginit bb |
23 |
will launch our standard static rescue shell. since it's static, you quite |
24 |
literally don't need any other path in the system other than /. |
25 |
|
26 |
finally, since the recent udev-mount init.d script is completely brain dead and |
27 |
refuses to execute unless devtmpfs is enabled, this code will also |
28 |
automatically mount+seed /dev (via mdev) if need be. |
29 |
|
30 |
note: the automatic mounting of /usr applies only to filesystems that (1) the |
31 |
kernel can natively mount (i.e. no module autoloading) and (2) do not require |
32 |
external mount helpers (i.e. `mount.ntfs3g` or `mount.cifs`). i don't think |
33 |
either of these are a big deal. if they are, well, use an initramfs :P. |
34 |
|
35 |
this should address the council's requirement (sep-/usr w/out initramfs) while |
36 |
allowing the general craziness to proceed w/out forking projects ourselves. |
37 |
|
38 |
this is all in busybox-1.20.0 which is now in the tree. if people want to try |
39 |
it out before i unmask it, that'd be great. seems to work in my qemu setup, |
40 |
and on the s390/s390x systems which really don't have a choice when it comes |
41 |
to a sep-/usr (due to limitations in the s390 hardware env). |
42 |
-mike |