[pacman-dev] [PATCH v3] makepkg: implement support for stripping kernel modules

Allan McRae allan at archlinux.org
Sun Feb 9 23:32:25 EST 2014


On 10/02/14 09:26, Steven Noonan wrote:
> I noticed when I built a kernel package with options 'strip' and 'debug' that
> the debug package was missing the debug information for the kernel modules.
> This patch adds kernel modules to the targets for 'strip' and is compatible
> with the split-out debug information packages.
> 
> v2: Correct logic error -- did a 'continue' after the 2nd-level case statement
>     instead of in the default case.
> v3: Oops, forgot to terminate outer case. Ran this version through the test
>     suite and all tests passed.
> 

For future reference, put comments like these ....

> Signed-off-by: Steven Noonan <steven at uplinklabs.net>
> ---

... under this line.  That way they are ignored when committing the patch.

>  scripts/makepkg.sh.in | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 940e947..027fcc3 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -1659,6 +1659,13 @@ tidy_install() {
>  					strip_flags="$STRIP_SHARED";;
>  				*application/x-archive*)    # Libraries (.a)
>  					strip_flags="$STRIP_STATIC";;
> +				*application/x-object*)
> +					case "$binary" in
> +						*.ko)                   # Kernel module
> +							strip_flags="$STRIP_SHARED";;
> +						*)
> +							continue;;
> +					esac;;

This looks fine to me.

I notice the Arch Linux kernel package uses options=('!strip').  I am
lead to believe that stripping vmlinux lead to issues with building
modules.  Also the Arch PKGBUILD compresses the modules before it gets
to stripping the files.

So, I guess my question is...  Well, I'm not sure!  I think I just need
a more complete picture to asses this.  Is my interpretation of the
issue with stripping vmlinux right? Does having separate debug symbols
for vmlinux still allow modules be built?  How do compressed modules and
separate debug symbols interact?

Allan



More information about the pacman-dev mailing list