Only skip the "ldconfig -r" step, which needs root privileges

Since we now have ldconfig which can run during the boot, make sure we
unconditionally copy all the other configuration files (ld.so.conf and
relatives), while only skipping the "cache" step.
master
Georgi Georgiev 11 years ago
parent 00a83a5f57
commit 517929fe87

@ -690,6 +690,12 @@ append_ld_so_conf() {
# but we need to generate a valid ld.so.conf. So we extract the # but we need to generate a valid ld.so.conf. So we extract the
# current CPIO archive, run ldconfig -r against it and append the # current CPIO archive, run ldconfig -r against it and append the
# last bits. # last bits.
#
# We only do this if we are "root", because "ldconfig -r" requires
# root privileges to chroot. If we are not root we don't generate the
# ld.so.cache here, but expect that ldconfig would regenerate it when the
# machine boots.
if [[ $(id -u) == 0 && -z ${FAKED_MODE:-} ]]; then
local tmp_dir_ext="${tmp_dir}/extracted" local tmp_dir_ext="${tmp_dir}/extracted"
mkdir -p "${tmp_dir_ext}" mkdir -p "${tmp_dir_ext}"
mkdir -p "${tmp_dir}/etc" mkdir -p "${tmp_dir}/etc"
@ -709,6 +715,8 @@ append_ld_so_conf() {
|| gen_die "compressing ld.so.cache cpio" || gen_die "compressing ld.so.cache cpio"
cd "$(dirname "${tmp_dir}")" cd "$(dirname "${tmp_dir}")"
rm -rf "${tmp_dir}" rm -rf "${tmp_dir}"
fi
} }
print_list() print_list()
@ -1001,10 +1009,8 @@ create_initramfs() {
append_data 'overlay' append_data 'overlay'
fi fi
if [[ $(id -u) == 0 && -z ${FAKED_MODE:-} ]]; then
# keep this at the very end, generates /etc/ld.so.conf* and cache # keep this at the very end, generates /etc/ld.so.conf* and cache
append_data 'ld_so_conf' append_data 'ld_so_conf'
fi
# Finalize cpio by removing duplicate files # Finalize cpio by removing duplicate files
print_info 1 " >> Finalizing cpio..." print_info 1 " >> Finalizing cpio..."

Loading…
Cancel
Save