Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
dracut
> 0286-strip-kernel-modules-in-the-initramfs-by-default.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0286-strip-kernel-modules-in-the-initramfs-by-default.patch of Package dracut
From 90689543da155c9cbc84a32082e7c6f9c90ea5c0 Mon Sep 17 00:00:00 2001 From: Harald Hoyer <harald@redhat.com> Date: Thu, 6 Sep 2012 11:55:37 +0200 Subject: [PATCH] strip kernel modules in the initramfs by default https://bugzilla.redhat.com/show_bug.cgi?id=854416 Do not strip binaries which have a .<bin>.hmac file --- dracut | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/dracut b/dracut index 525f1ce..3c3a926 100755 --- a/dracut +++ b/dracut @@ -50,8 +50,8 @@ Creates initial ramdisk images for preloading modules firmwares, separated by : --kernel-only Only install kernel drivers and firmware files --no-kernel Do not install kernel drivers and firmware files - --strip Strip binaries in the initramfs - --nostrip Do not strip binaries in the initramfs (default) + --strip Strip binaries in the initramfs (default) + --nostrip Do not strip binaries in the initramfs --mdadmconf Include local /etc/mdadm.conf --nomdadmconf Do not include local /etc/mdadm.conf --lvmconf Include local /etc/lvm/lvm.conf @@ -161,7 +161,7 @@ fi [[ $lvmconf_l ]] && lvmconf=$lvmconf_l [[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut [[ $fw_dir ]] || fw_dir=/lib/firmware -[[ $do_strip ]] || do_strip=no +[[ $do_strip ]] || do_strip=yes # eliminate IFS hackery when messing with fw_dir fw_dir=${fw_dir//:/ } @@ -309,18 +309,14 @@ fi if [[ $do_strip = yes ]] ; then for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '*/lib/modules/*.ko' \) ); do - dinfo "Stripping $f" - strip -g "$f" 2>/dev/null|| : - # - # FIXME: only strip -g for now - # - #strip -g --strip-unneeded "$f" || : - #note="-R .note" - #if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \ - # grep -q ALLOC; then - # note= - #fi - #strip -R .comment $note "$f" || : + # do not strip files with a .hmac file, + # because that would alter the checksum + if ! [[ -f "${f%/*}/.${f##*/}.hmac" ]]; then + dinfo "Stripping '$f'" + strip -g "$f" 2>/dev/null|| : + else + dinfo "Not stripping '$f', because it has a hmac checksum file." + fi done fi -- 1.8.3.1