summaryrefslogtreecommitdiff
path: root/mkinitramfs
diff options
context:
space:
mode:
authorColin Watson <cjwatson@ubuntu.com>2010-03-26 13:00:28 +0100
committermaximilian attems <maks@debian.org>2010-03-27 16:39:49 +0100
commit9588c32006983fda80f393458e36fe3d7e590598 (patch)
tree557a7d29d44c190bc5888e38b650ce8bcc006d6b /mkinitramfs
parent261811b5d0524c7fe579bf4ca22915c2dc4b636f (diff)
downloadinitramfs-tools-9588c32006983fda80f393458e36fe3d7e590598.tar.gz
initramfs-tools-9588c32006983fda80f393458e36fe3d7e590598.zip
mkinitramfs: Filter out looping or broken symlinks from the initramfs
they cause cpio to explode (LP: #540686). [ merge from 0.92bubuntu70 ] (closes: #575157) Signed-off-by: maximilian attems <maks@debian.org>
Diffstat (limited to 'mkinitramfs')
-rwxr-xr-xmkinitramfs4
1 files changed, 4 insertions, 0 deletions
diff --git a/mkinitramfs b/mkinitramfs
index e2f5ebe..877dfb4 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -256,6 +256,10 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then
copy_exec "${CONFDIR}/DSDT.aml" /
fi
+# Remove any looping or broken symbolic links, since they break cpio.
+find "${DESTDIR}" -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \
+ | xargs -rL1 rm -f
+
[ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs"
(
# work around lack of "set -o pipefail" for the following pipe: