[alpine-conf] update-kernel makes broken initramfs when /tmp is symlink
Hello.
I have had an issue with unbootable iso generated from aports. It looked like that during boot:
Error loading shared library libblkid.so.1: No such file or directory (needed by /sbin/nlplug-findfs)
Error loading shared library libkmod.so.2: No such file or directory (needed by /sbin/nlplug-findfs)
Error loading shared library libcryptsetup.so.12: No such file or directory (needed by /sbin/nlplug-findfs)
During my investigation I have found that it was because of the broken initramfs, containing symlinks to libraries, but not libraries itself:
$ ls -lh /tmp/mkinitfs.CLoaFG/lib/libblkid.so*
lrwxrwxrwx 1 build abuild 17 May 15 09:30 /tmp/mkinitfs.CLoaFG/lib/libblkid.so.1 -> libblkid.so.1.1.0
$
And that was caused by me having /tmp symlinked to /mnt/tmp. Because of that lddtree shows different path for those libraries:
$ lddtree -R /tmp/update-kernel.kLMceA/root/
-l --no-auto-root /tmp/update-kernel.kLMceA/root/sbin/nlplug-findfs
/tmp/update-kernel.kLMceA/root/sbin/nlplug-findfs
/tmp/update-kernel.kLMceA/root/lib/ld-musl-x86_64.so.1
/tmp/update-kernel.kLMceA/root/lib/libblkid.so.1
/mnt/tmp/update-kernel.kLMceA/root/lib/libblkid.so.1.1.0
/tmp/update-kernel.kLMceA/root/lib/libuuid.so.1
/mnt/tmp/update-kernel.kLMceA/root/lib/libuuid.so.1.3.0
...
You can see that libblkid.so.1
is shown in /tmp/...
and
libblkid.so.1.1.0
is in /mnt/tmp/...
and I think that causes the
problem.
So I suppose at least to return an error in such case.
(from redmine: issue id 10458, created on 2019-05-15)