0

I want to change the /lib loaded from initramfs to a mounted partition's /lib ideally without having to rm the initramfs' /lib and then symlink-ing to the new /lib.
The problem with this approach is that once I delete the original /lib, my binaries in /bin (particularly busybox) have no libraries to refer to so the subsequent linking would fail.
The reason I need to symlink a new /lib because I need to load additional modules that is too big to be included in the initramfs (as it will bloat the whole kernel)

Is there any tool that I could use to change the /lib directory into a symlink in a single operation?

Or is there any other way I can make my binaries be able to access the other lib directory without overwriting the original /lib?

Rystraum
  • 111
  • 3

1 Answers1

0

There are not a lot of size limitations on initrd (I've put 50 MB of extra stuff in there on occasion). I believe the initrd store is freed after the pivot is complete. So.... a couple things come to mind. You could just wait until the real /lib is available before inserting your special purpose module (you probably thought of this).

Another option would be to load your special purpose module optionally based on a kernel cmdline parameter. In this way you could create a grub-menu that provides booting with or without the special module.

Gregor
  • 541
  • 3
  • 13