All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] builddeb: put the dbg files into the correct directory
@ 2014-08-19  5:49 Darrick J. Wong
  2014-08-22 13:56 ` Michal Marek
  0 siblings, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2014-08-19  5:49 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kernel, linux-kbuild

Since the conversion of objtree to use relative pathnames (commit
7e1c04779e, "kbuild: Use relative path for $(objtree)"), the debug
info files have been ending up in /debian/dbgtmp/ in the regular
linux-image package instead of the debug files package.  Fix up the
paths so that the debug files end up in the -dbg package.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 scripts/package/builddeb |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 5707466..0456322 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -153,15 +153,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
 	fi
 	if [ -n "$BUILD_DEBUG" ] ; then
 		(
+			old_dir="$(pwd)"
 			cd $tmpdir
 			for module in $(find lib/modules/ -name *.ko); do
-				mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
+				mkdir -p $(dirname $old_dir/$dbg_dir/usr/lib/debug/$module)
 				# only keep debug symbols in the debug file
-				$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
+				$OBJCOPY --only-keep-debug $module $old_dir/$dbg_dir/usr/lib/debug/$module
 				# strip original module from debug symbols
 				$OBJCOPY --strip-debug $module
 				# then add a link to those
-				$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
+				$OBJCOPY --add-gnu-debuglink=$old_dir/$dbg_dir/usr/lib/debug/$module $module
 			done
 		)
 	fi

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] builddeb: put the dbg files into the correct directory
  2014-08-19  5:49 [PATCH] builddeb: put the dbg files into the correct directory Darrick J. Wong
@ 2014-08-22 13:56 ` Michal Marek
  2014-08-22 17:10   ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Marek @ 2014-08-22 13:56 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-kernel, linux-kbuild

On Mon, Aug 18, 2014 at 10:49:28PM -0700, Darrick J. Wong wrote:
> Since the conversion of objtree to use relative pathnames (commit
> 7e1c04779e, "kbuild: Use relative path for $(objtree)"), the debug
> info files have been ending up in /debian/dbgtmp/ in the regular
> linux-image package instead of the debug files package.  Fix up the
> paths so that the debug files end up in the -dbg package.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  scripts/package/builddeb |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 5707466..0456322 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -153,15 +153,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
>  	fi
>  	if [ -n "$BUILD_DEBUG" ] ; then
>  		(
> +			old_dir="$(pwd)"
>  			cd $tmpdir

Can you try the patch below? I'd rather get rid of the directory change,
if possible.

Michal

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 35d5a58..dcfdbda 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
 		rmdir "$tmpdir/lib/modules/$version"
 	fi
 	if [ -n "$BUILD_DEBUG" ] ; then
-		(
-			cd $tmpdir
-			for module in $(find lib/modules/ -name *.ko); do
-				mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
-				# only keep debug symbols in the debug file
-				$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
-				# strip original module from debug symbols
-				$OBJCOPY --strip-debug $module
-				# then add a link to those
-				$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
-			done
-		)
+		for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
+			module=lib/modules/$module
+			mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
+			# only keep debug symbols in the debug file
+			$OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module
+			# strip original module from debug symbols
+			$OBJCOPY --strip-debug $tmpdir/$module
+			# then add a link to those
+			$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
+		done
 	fi
 fi
 
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] builddeb: put the dbg files into the correct directory
  2014-08-22 13:56 ` Michal Marek
@ 2014-08-22 17:10   ` Darrick J. Wong
  2014-08-26 13:40     ` Michal Marek
  2014-08-26 14:05     ` Michal Marek
  0 siblings, 2 replies; 5+ messages in thread
From: Darrick J. Wong @ 2014-08-22 17:10 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kernel, linux-kbuild

On Fri, Aug 22, 2014 at 03:56:07PM +0200, Michal Marek wrote:
> On Mon, Aug 18, 2014 at 10:49:28PM -0700, Darrick J. Wong wrote:
> > Since the conversion of objtree to use relative pathnames (commit
> > 7e1c04779e, "kbuild: Use relative path for $(objtree)"), the debug
> > info files have been ending up in /debian/dbgtmp/ in the regular
> > linux-image package instead of the debug files package.  Fix up the
> > paths so that the debug files end up in the -dbg package.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  scripts/package/builddeb |    7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> > index 5707466..0456322 100644
> > --- a/scripts/package/builddeb
> > +++ b/scripts/package/builddeb
> > @@ -153,15 +153,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
> >  	fi
> >  	if [ -n "$BUILD_DEBUG" ] ; then
> >  		(
> > +			old_dir="$(pwd)"
> >  			cd $tmpdir
> 
> Can you try the patch below? I'd rather get rid of the directory change,
> if possible.
> 
> Michal
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 35d5a58..dcfdbda 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
>  		rmdir "$tmpdir/lib/modules/$version"
>  	fi
>  	if [ -n "$BUILD_DEBUG" ] ; then
> -		(
> -			cd $tmpdir
> -			for module in $(find lib/modules/ -name *.ko); do
> -				mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
> -				# only keep debug symbols in the debug file
> -				$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
> -				# strip original module from debug symbols
> -				$OBJCOPY --strip-debug $module
> -				# then add a link to those
> -				$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
> -			done
> -		)
> +		for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
> +			module=lib/modules/$module
> +			mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
> +			# only keep debug symbols in the debug file
> +			$OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module
> +			# strip original module from debug symbols
> +			$OBJCOPY --strip-debug $tmpdir/$module
> +			# then add a link to those
> +			$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module

This should read:

$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module

(The last argument needs "$tmpdir/".)

but otherwise it's ok, so you can add:
Tested-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] builddeb: put the dbg files into the correct directory
  2014-08-22 17:10   ` Darrick J. Wong
@ 2014-08-26 13:40     ` Michal Marek
  2014-08-26 14:05     ` Michal Marek
  1 sibling, 0 replies; 5+ messages in thread
From: Michal Marek @ 2014-08-26 13:40 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-kernel, linux-kbuild

On 2014-08-22 19:10, Darrick J. Wong wrote:
> On Fri, Aug 22, 2014 at 03:56:07PM +0200, Michal Marek wrote:
>> On Mon, Aug 18, 2014 at 10:49:28PM -0700, Darrick J. Wong wrote:
>>> Since the conversion of objtree to use relative pathnames (commit
>>> 7e1c04779e, "kbuild: Use relative path for $(objtree)"), the debug
>>> info files have been ending up in /debian/dbgtmp/ in the regular
>>> linux-image package instead of the debug files package.  Fix up the
>>> paths so that the debug files end up in the -dbg package.
>>>
>>> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
>>> ---
>>>  scripts/package/builddeb |    7 ++++---
>>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
>>> index 5707466..0456322 100644
>>> --- a/scripts/package/builddeb
>>> +++ b/scripts/package/builddeb
>>> @@ -153,15 +153,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
>>>  	fi
>>>  	if [ -n "$BUILD_DEBUG" ] ; then
>>>  		(
>>> +			old_dir="$(pwd)"
>>>  			cd $tmpdir
>>
>> Can you try the patch below? I'd rather get rid of the directory change,
>> if possible.
>>
>> Michal
>>
>> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
>> index 35d5a58..dcfdbda 100755
>> --- a/scripts/package/builddeb
>> +++ b/scripts/package/builddeb
>> @@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
>>  		rmdir "$tmpdir/lib/modules/$version"
>>  	fi
>>  	if [ -n "$BUILD_DEBUG" ] ; then
>> -		(
>> -			cd $tmpdir
>> -			for module in $(find lib/modules/ -name *.ko); do
>> -				mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
>> -				# only keep debug symbols in the debug file
>> -				$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
>> -				# strip original module from debug symbols
>> -				$OBJCOPY --strip-debug $module
>> -				# then add a link to those
>> -				$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
>> -			done
>> -		)
>> +		for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
>> +			module=lib/modules/$module
>> +			mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
>> +			# only keep debug symbols in the debug file
>> +			$OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module
>> +			# strip original module from debug symbols
>> +			$OBJCOPY --strip-debug $tmpdir/$module
>> +			# then add a link to those
>> +			$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
> 
> This should read:
> 
> $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module
> 
> (The last argument needs "$tmpdir/".)

Oops, you are right.


> but otherwise it's ok, so you can add:
> Tested-by: Darrick J. Wong <darrick.wong@oracle.com>

Thanks!

Michal


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] builddeb: put the dbg files into the correct directory
  2014-08-22 17:10   ` Darrick J. Wong
  2014-08-26 13:40     ` Michal Marek
@ 2014-08-26 14:05     ` Michal Marek
  1 sibling, 0 replies; 5+ messages in thread
From: Michal Marek @ 2014-08-26 14:05 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-kbuild, linux-kernel

Since the conversion of objtree to use relative pathnames (commit
7e1c04779e, "kbuild: Use relative path for $(objtree)"), the debug
info files have been ending up in /debian/dbgtmp/ in the regular
linux-image package instead of the debug files package. Fix up the
paths so that the debug files end up in the -dbg package.

This is based on a similar patch by Darrick.

Reported-and-tested-by: "Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 scripts/package/builddeb | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 35d5a58..7c0e6e4 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
 		rmdir "$tmpdir/lib/modules/$version"
 	fi
 	if [ -n "$BUILD_DEBUG" ] ; then
-		(
-			cd $tmpdir
-			for module in $(find lib/modules/ -name *.ko); do
-				mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
-				# only keep debug symbols in the debug file
-				$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
-				# strip original module from debug symbols
-				$OBJCOPY --strip-debug $module
-				# then add a link to those
-				$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
-			done
-		)
+		for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
+			module=lib/modules/$module
+			mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
+			# only keep debug symbols in the debug file
+			$OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module
+			# strip original module from debug symbols
+			$OBJCOPY --strip-debug $tmpdir/$module
+			# then add a link to those
+			$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module
+		done
 	fi
 fi
 
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-26 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-19  5:49 [PATCH] builddeb: put the dbg files into the correct directory Darrick J. Wong
2014-08-22 13:56 ` Michal Marek
2014-08-22 17:10   ` Darrick J. Wong
2014-08-26 13:40     ` Michal Marek
2014-08-26 14:05     ` Michal Marek

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.