diff mbox

[v4,3/4] deb-pkg: fix installed image path on parisc, mips and powerpc

Message ID 1367941611-12223-4-git-send-email-anisse@astier.eu (mailing list archive)
State New, archived
Headers show

Commit Message

Anisse Astier May 7, 2013, 3:46 p.m. UTC
Signed-off-by: Anisse Astier <anisse@astier.eu>
---
 scripts/package/builddeb | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

Comments

Ben Hutchings May 8, 2013, 3:54 a.m. UTC | #1
On Tue, 2013-05-07 at 17:46 +0200, Anisse Astier wrote:
> Signed-off-by: Anisse Astier <anisse@astier.eu>
> ---
>  scripts/package/builddeb | 25 ++++++++++++++++++-------
>  1 file changed, 18 insertions(+), 7 deletions(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 797484b..73bb551 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -89,6 +89,18 @@ if [ "$ARCH" = "um" ] ; then
>  	packagename=user-mode-linux-$version
>  fi
>  
> +# Not all arches have the same installed path in debian
> +case $ARCH in
> +um)
> +	installed_image_path="usr/bin/linux-$version"
> +	;;
> +parisc|mips|powerpc)
> +	installed_image_path="boot/vmlinux-$version"
> +	;;
> +*)
> +	installed_image_path="boot/vmlinuz-$version"
> +esac
[...]

This certainly matches the naming we use in official Debian kernel
packages.  The intent was, I think, to match what 'make install' would
do, but with the version suffix.  We've diverged from that slightly in
that some MIPS platforms now support compressed kernel images which are
installed as vmlinuz.

So, you can consider this:

Reviewed-by: Ben Hutchings <ben@decadent.org.uk>

However I think we could improve on this by making each architecture
Makefile define the canonical installed name of the kernel image.

Ben.
diff mbox

Patch

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 797484b..73bb551 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -89,6 +89,18 @@  if [ "$ARCH" = "um" ] ; then
 	packagename=user-mode-linux-$version
 fi
 
+# Not all arches have the same installed path in debian
+case $ARCH in
+um)
+	installed_image_path="usr/bin/linux-$version"
+	;;
+parisc|mips|powerpc)
+	installed_image_path="boot/vmlinux-$version"
+	;;
+*)
+	installed_image_path="boot/vmlinuz-$version"
+esac
+
 BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $objtree/$KCONFIG_CONFIG || true)"
 
 # Setup the directory structure
@@ -116,16 +128,15 @@  if [ "$ARCH" = "um" ] ; then
 	cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
 	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 $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"
-	else
-		cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
-	fi
+fi
+# Not all arches include the boot path in KBUILD_IMAGE
+if [ -e $KBUILD_IMAGE ]; then
+	cp $KBUILD_IMAGE "$tmpdir/$installed_image_path"
+else
+	cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/$installed_image_path"
 fi
 
 if grep -q '^CONFIG_MODULES=y' $objtree/$KCONFIG_CONFIG ; then