All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linux-kernel@vger.kernel.org, Michal Marek <mmarek@suse.cz>,
	linux-kbuild@vger.kernel.org,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	uclinux-dist-devel@blackfin.uclinux.org,
	Jonas <jonas.bonn@gmail.com>
Subject: Re: [PATCH 1/1] depmod: pass -P $CONFIG_SYMBOL_PREFIX
Date: Tue, 5 Feb 2013 10:33:19 +0000	[thread overview]
Message-ID: <5110DFEF.8000505@imgtec.com> (raw)
In-Reply-To: <201302030117.26295.vapier@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 2338 bytes --]

Hi Mike,

On 03/02/13 06:17, Mike Frysinger wrote:
> 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

arch/openrisc/Kconfig now defines SYMBOL_PREFIX as "", so this isn't
sufficient (arguably it probably shouldn't be defined empty like that?)

> 
> 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.

Yep, I could do this, but depmod.sh would need modifying to drop it if
the prefix is empty, otherwise you get the following from depmod:
FATAL: -P only takes a single char

I don't mind adding that, but what do you think?

> 
>> --- 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

neat, thanks

> 
>> +# 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)

yep, definitely better, thanks

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

ok

Thanks for the suggestions

Cheers
James


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: <linux-kernel@vger.kernel.org>, Michal Marek <mmarek@suse.cz>,
	<linux-kbuild@vger.kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	<uclinux-dist-devel@blackfin.uclinux.org>,
	Jonas <jonas.bonn@gmail.com>
Subject: Re: [PATCH 1/1] depmod: pass -P $CONFIG_SYMBOL_PREFIX
Date: Tue, 5 Feb 2013 10:33:19 +0000	[thread overview]
Message-ID: <5110DFEF.8000505@imgtec.com> (raw)
In-Reply-To: <201302030117.26295.vapier@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 2338 bytes --]

Hi Mike,

On 03/02/13 06:17, Mike Frysinger wrote:
> 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

arch/openrisc/Kconfig now defines SYMBOL_PREFIX as "", so this isn't
sufficient (arguably it probably shouldn't be defined empty like that?)

> 
> 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.

Yep, I could do this, but depmod.sh would need modifying to drop it if
the prefix is empty, otherwise you get the following from depmod:
FATAL: -P only takes a single char

I don't mind adding that, but what do you think?

> 
>> --- 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

neat, thanks

> 
>> +# 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)

yep, definitely better, thanks

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

ok

Thanks for the suggestions

Cheers
James


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-02-05 10:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-31  9:41 [PATCH 1/1] depmod: pass -P $CONFIG_SYMBOL_PREFIX James Hogan
2013-01-31  9:41 ` James Hogan
2013-01-31 10:37 ` Michal Marek
2013-01-31 10:50   ` James Hogan
2013-01-31 10:50     ` James Hogan
2013-01-31 11:11     ` Michal Marek
2013-02-03  6:17 ` Mike Frysinger
2013-02-05 10:33   ` James Hogan [this message]
2013-02-05 10:33     ` James Hogan
2013-02-05 23:18     ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5110DFEF.8000505@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=jonas.bonn@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.