FS#17298 - [mkinitcpio] remove klibc dependency
Attached to Project:
Arch Linux
Opened by Thomas Bächler (brain0) - Friday, 27 November 2009, 10:42 GMT
Last edited by Thomas Bächler (brain0) - Sunday, 14 February 2010, 13:37 GMT
Opened by Thomas Bächler (brain0) - Friday, 27 November 2009, 10:42 GMT
Last edited by Thomas Bächler (brain0) - Sunday, 14 February 2010, 13:37 GMT
|
Details
klibc is mostly unmaintained and doesn't build properly with
newer kernels. Fixing it all the time is a waste of time.
Also, first attempts with uclibc yielded different, but as
annoying problems. So I decided to use glibc in initramfs.
What needs to be done is this:
1) Configure and build busybox - this is mostly done, it just needs to be moved to glibc instead of uclibc: http://repos.archlinux.org/wsvn/packages/mkinitcpio-busybox/trunk/ 2) Remove klibc'isms from mkinitcpio and make it work with the normal tools. 3) Make sure latest udev and other non-busybox tools get proper hooks, make sure they all work. 4) Move away from kinit, use busybox's switch_root instead. 5) Add the missing stuff, like NFS support, that gets lost in the removal of kinit. 1) to 4) is the work of an afternoon, no idea about 5). |
This task depends upon
Closed by Thomas Bächler (brain0)
Sunday, 14 February 2010, 13:37 GMT
Reason for closing: Implemented
Sunday, 14 February 2010, 13:37 GMT
Reason for closing: Implemented
7) replace raid hook and use mdadm hook instead
8) remove firmware hook, modules should have proper firmware entries, if not it's a bug!
9) remove dsdt hook, we don't support the dsdt patch anymore.
You could start with mkinitcpio.git then:
a) Replace the shebang of /init from #!/bin/sh to #!/bin/busybox sh
b) Make the first command in /init "/bin/busybox -s" (then everything will be populated with the proper tools by creating symlinks to busybox)
c) Adjust the /lib/initcpio/install files to not install klibc stuff, but rather busybox and glibc (glibc should be autodetected with mkinitcpio's "BINARIES" stuff I guess)
d) Replace the call to "kinit" in /init with some mount-and-switch_root code (switch_root is part of busybox)
e) Do some magic with the udev hook to install the usual udev to the initramfs
After that, it might already boot in a standard setup. Maybe I can get to this myself this weekend, but I have doubts this will happen now. What I outlined here is basically a start for steps 2-4 from the abover bug report.
I did this instead:
for i in $(/bin/busybox --help | /bin/busybox grep -v Copyright | /bin/busybox grep , | /bin/busybox tr , " "); do
/bin/busybox ln -s /bin/busybox /bin/$i
done
This does mean that anything that would be in /sbin folder will be in /bin folder but it works. I hope this helps.
[kill-klibc]
Server = http://dev.archlinux.org/~thomas/kill-klibc/i686/
or
[kill-klibc]
Server = http://dev.archlinux.org/~thomas/kill-klibc/x86_64/
The standard hooks work, so do keymap, lvm2, encrypt. What does NOT work is raid/mdadm/dmraid and root on NFS. I would appreciate any input and patches w.r.t. those, as well as any testing. The v86d package also needs to be fixed, but that is trivial.
device-mapper, lvm2 and cryptsetup have a weird "1.local" pkgrel so they won't collide with the ones from the repo, sorry if that bothers anyone.
If you upgrade to this repositories, your existing mkinitcpio will be replaced and all klibc packages will be gone too. So, if you try it, please save your existing initramfs to a different filename as a fallback, and do not perform kernel upgrades until you either confirmed that it works, or downgraded to the klibc-based mkinitcpio.
...
/lib/initcpio/functions: line 175: which: command not found
...
2) We can add losetup to mkinitcpio-busybox, as commited for -2 here: http://repos.archlinux.org/wsvn/packages/?compare[]=%2Fmkinitcpio-busybox%2Ftrunk%2F%4067221&compare[]=%2Fmkinitcpio-busybox%2Ftrunk%2F%4062602&comparesubmit=Compare+Revisions&op=comp
* Use build() and package() avoiding usage of fakeroot for build.
* Update checksum for current config in trunk.
tested on archiso hook
PS1="ramfs$ " openvt -w -s -- /bin/sh -i
will switch to tty1 automatically, then wehn shell exits , will switch back ;)
* You can remove -s then (to avoid auto-switch), add a small message like "press alt+f1 to go to rescue shell" or something like this.
* This should be used only when no "console=" parameter is used, (for example if you boot from serial console, I use a serial console (stdin) very frequently in KVM)
* Keep things like now, but keep openvt in initramfs to take the advantages.
Another note, maybe is redundant or not, because there are no nss services at this stage, and no delays are experimented in udev, but maybe can add "--resolve-names=never" when launch udevd. I say this because the some of rules files contains GROUP="something", and maybe udev try to resolve them, with this avoid lookups. Another option is removing GROUP from rules.
otherwise will access to /sys/block//sys/block/sda/sda1/dev (for example)
Also remove comment about "modload" in conf.
[PATCH] Fix module name in usb/usbinput install hook
There is no module named sl1811-hcd, must be sl811-hcd