From 49c4af162bc0a48a9526a659b08b2e149fa2bb37 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Thu, 26 Dec 2013 10:54:54 +0100 Subject: [PATCH] linuxrc: create /etc/ld.so.cache if it's not in the initramfs --- defaults/initrd.d/00-common.sh | 10 ++++++++++ defaults/linuxrc | 2 ++ 2 files changed, 12 insertions(+) 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 || {