diff --git a/defaults/initrd.d/00-common.sh b/defaults/initrd.d/00-common.sh index 9bee958..72b0ac1 100755 --- a/defaults/initrd.d/00-common.sh +++ b/defaults/initrd.d/00-common.sh @@ -88,3 +88,13 @@ rundebugshell() { do_rundebugshell fi } + +maybe_setup_ld_cache() { + # This calls ldconfig if /etc/ld.so.cache was not + # created at initramfs build time. This may happen + # if the initramfs was generated by an unprivileged user + # since running ldconfig -r requires root privileges. + if [ ! -e "/etc/ld.so.cache" ]; then + ldconfig + fi +} \ No newline at end of file diff --git a/defaults/linuxrc b/defaults/linuxrc index fe0423d..81f30b3 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -257,6 +257,8 @@ done quiet_kmsg +maybe_setup_ld_cache + real_init_init is_livecd || {