[arch-projects] [mkinitcpio][PATCH 1/4] add 'strip' install hook
dreisner at archlinux.org
Sun Jul 15 10:33:49 EDT 2012
Mostly a convenience for myself, and anyone else who runs builds of
things like util-linux or kmod, where having debug symbols on these
libraries can add a large amount of weight to the image.
Signed-off-by: Dave Reisner <dreisner at archlinux.org>
install/strip | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 install/strip
diff --git a/install/strip b/install/strip
new file mode 100644
@@ -0,0 +1,32 @@
+ find "$BUILDROOT" -type f -perm -u+w -print0 2>/dev/null | while read -d '' bin; do
+ case $(file -bi "$bin") in
+ # Libraries (.so)
+ strip --strip-unneeded "$bin"
+ # Libraries (.a)
+ strip --strip-debug "$bin"
+ # Binaries
+ strip --strip-all "$bin"
+ cat <<HELPEOF
+This hook will locate and strip binaries on your image before archival and
+compression. This hook should be last, as any binaries added to the image after
+this hook runs will not be stripped. This is mostly useful for users who run
+local debug builds but whom do not want or need the extra weight of debug
+symbols on their image.
+# vim: set ft=sh ts=4 sw=4 et:
More information about the arch-projects