diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2018-07-19 16:44:06 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-07-19 16:51:46 +0100 |
commit | 4e1f80ede95f4ea51996f31b6646fa9eed07658c (patch) | |
tree | 3280f265bbb5d396c794624b45d340624e93c866 | |
parent | 01e2d7011c52231f3fb919d9d83ab228a2cee1c2 (diff) |
mkinitramfs: Don't try to remove nonexistent /var/cache/ldconfig
"rmdir --ignore-fail-on-non-empty" won't report an error if there
is ever another file in /var/cache/ldconfig, but it will report an
error if the directory doesn't exist at all.
"rm -df" has the opposite problem.
Add a test for directory existence around the aux-cache removal.
Closes: #904065
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rwxr-xr-x | mkinitramfs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mkinitramfs b/mkinitramfs index 89a61a3..58a9ff7 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -340,8 +340,10 @@ if ! ldconfig -r "$DESTDIR" ; then fi # The auxiliary cache is not reproducible and is always invalid at boot # (see #845034) -rm -f "${DESTDIR}"/var/cache/ldconfig/aux-cache -rmdir --ignore-fail-on-non-empty "${DESTDIR}"/var/cache/ldconfig +if [ -d "${DESTDIR}"/var/cache/ldconfig ]; then + rm -f "${DESTDIR}"/var/cache/ldconfig/aux-cache + rmdir --ignore-fail-on-non-empty "${DESTDIR}"/var/cache/ldconfig +fi # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then |