Patchwork [v5,1/4] deb-pkg: use KCONFIG_CONFIG instead of .config file directly

login
register
mail settings
Submitter Anisse Astier
Date June 14, 2013, 9:46 a.m.
Message ID <1371203217-19572-2-git-send-email-anisse@astier.eu>
Download mbox | patch
Permalink /patch/251304/
State New
Headers show

Comments

Anisse Astier - June 14, 2013, 9:46 a.m.
Signed-off-by: Anisse Astier <anisse@astier.eu>
Cc: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/builddeb | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
maximilian attems - June 14, 2013, 1:54 p.m.
On Fri, Jun 14, 2013 at 11:46:54AM +0200, Anisse Astier wrote:
> Signed-off-by: Anisse Astier <anisse@astier.eu>
> Cc: Ben Hutchings <ben@decadent.org.uk>
Acked-by: maximilian attems <max@stro.at>
> ---
>  scripts/package/builddeb | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index acb8650..6f21ad8 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -41,9 +41,9 @@ create_package() {
>  	parisc*)
>  		debarch=hppa ;;
>  	mips*)
> -		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;;
> +		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el) ;;
>  	arm*)
> -		debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;;
> +		debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el) ;;
>  	*)
>  		echo "" >&2
>  		echo "** ** **  WARNING  ** ** **" >&2
> @@ -106,12 +106,12 @@ fi
>  if [ "$ARCH" = "um" ] ; then
>  	$MAKE linux
>  	cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
> -	cp .config "$tmpdir/usr/share/doc/$packagename/config"
> +	cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config"
>  	gzip "$tmpdir/usr/share/doc/$packagename/config"
>  	cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version"
>  else 
>  	cp System.map "$tmpdir/boot/System.map-$version"
> -	cp .config "$tmpdir/boot/config-$version"
> +	cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version"
>  	# Not all arches include the boot path in KBUILD_IMAGE
>  	if [ -e $KBUILD_IMAGE ]; then
>  		cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
> @@ -120,7 +120,7 @@ else
>  	fi
>  fi
>  
> -if grep -q '^CONFIG_MODULES=y' .config ; then
> +if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
>  	INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install
>  	rm -f "$tmpdir/lib/modules/$version/build"
>  	rm -f "$tmpdir/lib/modules/$version/source"
> @@ -245,7 +245,7 @@ fi
>  # Build header package
>  (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
>  (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
> -(cd $objtree; find arch/$SRCARCH/include .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
> +(cd $objtree; find arch/$SRCARCH/include $KCONFIG_CONFIG Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
>  destdir=$kernel_headers_dir/usr/src/linux-headers-$version
>  mkdir -p "$destdir"
>  (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)
> -- 
> 1.8.3.rc1
>
Ben Hutchings - June 15, 2013, 3:11 a.m.
On Fri, 2013-06-14 at 11:46 +0200, Anisse Astier wrote:
> Signed-off-by: Anisse Astier <anisse@astier.eu>
> Cc: Ben Hutchings <ben@decadent.org.uk>
[...]
> @@ -245,7 +245,7 @@ fi
>  # Build header package
>  (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
>  (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
> -(cd $objtree; find arch/$SRCARCH/include .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
> +(cd $objtree; find arch/$SRCARCH/include $KCONFIG_CONFIG Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
[...]

I think $KCONFIG_CONFIG needs to be handled specially here - it should
be installed as .config in the linux-headers package, since you can't
assume the environment variable is set when that package is used.

Ben.

Patch

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index acb8650..6f21ad8 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -41,9 +41,9 @@  create_package() {
 	parisc*)
 		debarch=hppa ;;
 	mips*)
-		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;;
+		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el) ;;
 	arm*)
-		debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;;
+		debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el) ;;
 	*)
 		echo "" >&2
 		echo "** ** **  WARNING  ** ** **" >&2
@@ -106,12 +106,12 @@  fi
 if [ "$ARCH" = "um" ] ; then
 	$MAKE linux
 	cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
-	cp .config "$tmpdir/usr/share/doc/$packagename/config"
+	cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config"
 	gzip "$tmpdir/usr/share/doc/$packagename/config"
 	cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version"
 else 
 	cp System.map "$tmpdir/boot/System.map-$version"
-	cp .config "$tmpdir/boot/config-$version"
+	cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version"
 	# Not all arches include the boot path in KBUILD_IMAGE
 	if [ -e $KBUILD_IMAGE ]; then
 		cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
@@ -120,7 +120,7 @@  else
 	fi
 fi
 
-if grep -q '^CONFIG_MODULES=y' .config ; then
+if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
 	INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install
 	rm -f "$tmpdir/lib/modules/$version/build"
 	rm -f "$tmpdir/lib/modules/$version/source"
@@ -245,7 +245,7 @@  fi
 # Build header package
 (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
 (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
-(cd $objtree; find arch/$SRCARCH/include .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
+(cd $objtree; find arch/$SRCARCH/include $KCONFIG_CONFIG Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
 mkdir -p "$destdir"
 (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)