Bug#586002: initramfs-tools: should work around 'find -printf %Y' bug
Package: initramfs-tools
Version: 0.96.1
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch maverick
The change to filter out looping or broken symlinks from the initramfs,
written by me for Ubuntu and applied to Debian for #575157, tickles a
bug in find (which I think also had an associated Debian bug, but I've
been unable to find it):
https://savannah.gnu.org/bugs/index.php?29460
This was fixed in 4.5.8, which is currently only in experimental. In
any case findutils is very deep in the dependency chain for upgrades and
I believe it would be a good idea to avoid requiring a new version of it
(I've had problems quite recently with strict dependencies on findutils
causing unresolvable dependency loops). The following patch works
around this bug in a reasonably straightforward way.
diff --git a/mkinitramfs b/mkinitramfs
index 1c6ad28..e3b392e 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -304,8 +304,8 @@ fi
# Remove any looping or broken symbolic links, since they break cpio.
[ "${verbose}" = y ] && xargs_verbose="-t"
-find "${DESTDIR}" -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \
- | xargs ${xargs_verbose:-} -rL1 rm -f
+(cd "${DESTDIR}" && find . -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \
+ | xargs ${xargs_verbose:-} -rL1 rm -f)
[ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs"
(
Thanks,
--
Colin Watson [cjwatson@ubuntu.com]
Reply to: