diff options
author | Colin Watson <cjwatson@ubuntu.com> | 2010-03-26 13:00:28 +0100 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2010-03-27 16:39:49 +0100 |
commit | 9588c32006983fda80f393458e36fe3d7e590598 (patch) | |
tree | 557a7d29d44c190bc5888e38b650ce8bcc006d6b /mkinitramfs | |
parent | 261811b5d0524c7fe579bf4ca22915c2dc4b636f (diff) | |
download | initramfs-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-x | mkinitramfs | 4 |
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: |