[OE-core] [PATCH 37/61] lib/oe/package: Ensure strip breaks hardlinks

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Wed Feb 18 18:25:45 UTC 2015


Armin Kuster <akuster808-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
writes:

> Normally, strip preserves hardlinks which in the case of the way our
> hardlink rather than copy functionality works,

This breaks stripping of hardlinked files.  'package.bbclass' contains
logic to run 'strip' only once per hardlinked file.  With this patch,
only one instance gets stripped.

E.g. the 'e2fsprogs-mke2fs' package contains now

-rwxr-xr-x    4 root     root        350025 Feb 18 01:42 /sbin/mke2fs
-rwxr-xr-x    4 root     root        350025 Feb 18 01:42 /sbin/mkfs.ext2
-rwxr-xr-x    4 root     root        350025 Feb 18 01:42 /sbin/mkfs.ext3
-rwxr-xr-x    4 root     root        350025 Feb 18 01:42 /sbin/mkfs.ext4
-rwxr-xr-x    1 root     root         84700 Feb 18 01:42 /sbin/mkfs.ext4dev

where the first 4 programs (which are one inode with 4 hardlinks) are
not stripped.



> -    stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
> +    # Use mv to break hardlinks
> +    stripcmd = "'%s' %s '%s' -o '%s.tmp' && mv '%s.tmp' '%s'" % (strip, extraflags, file, file, file, file)

How are these files then merged again?



Enrico



More information about the Openembedded-core mailing list