lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 3 Feb 2013 01:17:24 -0500
From:	Mike Frysinger <vapier@...too.org>
To:	James Hogan <james.hogan@...tec.com>
Cc:	linux-kernel@...r.kernel.org, Michal Marek <mmarek@...e.cz>,
	linux-kbuild@...r.kernel.org,
	"Yoshinori Sato" <ysato@...rs.sourceforge.jp>,
	uclinux-dist-devel@...ckfin.uclinux.org
Subject: Re: [PATCH 1/1] depmod: pass -P $CONFIG_SYMBOL_PREFIX

On Thursday 31 January 2013 04:41:43 James Hogan wrote:
> --- a/Makefile
> +++ b/Makefile
> 
> +ifneq ($(patsubst "%",%,$(CONFIG_SYMBOL_PREFIX)),)
> +  depmod_args = -P $(patsubst "%",%,$(CONFIG_SYMBOL_PREFIX))
> +endif
> ...
>  # Run depmod only if we have System.map and depmod is executable
>  quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
>        cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
> -                   $(KERNELRELEASE)
> +                   $(KERNELRELEASE) $(depmod_args)

scripts/Makefile.lib just does:
	ifdef CONFIG_SYMBOL_PREFIX
so you should do the same

that said, cmd_depmod is just a shell command.  and you're running another 
script helper (depmod.sh).  how about passing it unconditionally ?
	cmd_depmod = ... -P "$(CONFIG_SYMBOL_PREFIX)"

since the default will be "no prefix", using -P "" is the same thing.

> --- a/scripts/depmod.sh
> +++ b/scripts/depmod.sh
> 
>  DEPMOD=$1
> -KERNELRELEASE=$2
> +shift
> +KERNELRELEASE=$1
> +shift

you can do:
	DEPMOD=$1
	KERNELRELEASE=$2
	shift 2

> +# older versions of depmod don't support -P <symbol-prefix>
> +# support was added in module-init-tools 3.13
> +if test "$1" = "-P"; then
> +	release=$("$DEPMOD" --version)
> +	package=$(echo "$release" | cut -d' ' -f 1)
> +	if test "$package" = "module-init-tools"; then
> +		version=$(echo "$release" | cut -d' ' -f 2)
> +		later=$({ echo "$version"; echo "3.13"; } | sort -V | tail -n 1)

you could do instead:
	later=$(printf '%s\n' "$version" "3.13" | sort -V | tail -n 1)

> +		if test "$later" != "$version"; then
> +			# module-init-tools < 3.13, drop the next 2 args
> +			shift
> +			shift
> +		fi

shift 2
-mike

Download attachment "signature.asc " of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ