[PATCH] 3 small patches for the 6.3 build scripts

From: Woody Suwalski
Date: Fri Mar 31 2023 - 10:15:47 EST


1. Fix a spell typo in mkdebian script.

Fixes: spelling error in scripts/package/mkdebian
Signed-off-by: Woody Suwalski <terraluna977@xxxxxxxxx>

--- a/scripts/package/mkdebian    2023-03-30 18:46:06.008350787 -0400
+++ b/scripts/package/mkdebian    2023-03-31 09:31:28.063637332 -0400
@@ -175,7 +175,7 @@ EOF

 # Generate copyright file
 cat <<EOF > debian/copyright
-This is a packacked upstream version of the Linux kernel.
+This is a packaged upstream version of the Linux kernel.

 The sources may be found at most Linux archive sites, including:
 https://www.kernel.org/pub/linux/kernel


2. Fix an invalid user-mode subarch architecture name.
The x86 32-bit architecture name should be i386, not x86.
The SUBARCH tag is used in UM arch check in scripts/tags.sh.

Fixes: incorrect user mode subarch tag in scripts/subarch.include
Signed-off-by: Woody Suwalski <terraluna977@xxxxxxxxx>

--- a/scripts/subarch.include    2023-02-19 17:24:22.000000000 -0500
+++ b/scripts/subarch.include    2023-03-30 11:18:05.357082494 -0400
@@ -4,7 +4,7 @@
 # then ARCH is assigned, getting whatever value it gets normally, and
 # SUBARCH is subsequently ignored.

-SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/x86_64/x86/ \
                   -e s/sun4u/sparc64/ \
                   -e s/arm.*/arm/ -e s/sa110/arm/ \
                   -e s/s390x/s390/ \

3.In 6.3 the mkdebian script started to wipe the debian directory.
On my build system I have been installing a "real" changelog file with build history
into the unpacked/patched kernel tree before calling "make bindeb-pkg".
It seems that a workaround could be to copy the real changelog into another directory,
e.g. patches/, and then if the patches/changelog file exists, move it to the debian/
directory and skip creation of a stock changelog file.

Fixes: in Debian packaging use a real changelog file if provided
Signed-off-by: Woody Suwalski <terraluna977@xxxxxxxxx>

--- a/scripts/package/mkdebian    2023-03-31 09:38:14.620023584 -0400
+++ b/scripts/package/mkdebian    2023-03-31 09:38:55.704050033 -0400
@@ -164,14 +164,18 @@ echo $debarch > debian/arch
 extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev:native)"
 extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)"

-# Generate a simple changelog template
-cat <<EOF > debian/changelog
+if [ ! -s patches/changelog ]; then
+    # Generate a simple changelog template
+    cat <<EOF > debian/changelog
 $sourcename ($packageversion) $distribution; urgency=low

   * Custom built Linux kernel.

  -- $maintainer  $(date -R)
 EOF
+else
+    mv patches/changelog debian
+fi

 # Generate copyright file
 cat <<EOF > debian/copyright

Thanks, Woody


Fixes: spelling error in scripts/package/mkdebian
Signed-off-by: Woody Suwalski <terraluna977@xxxxxxxxx>

--- a/scripts/package/mkdebian 2023-03-30 18:46:06.008350787 -0400
+++ b/scripts/package/mkdebian 2023-03-31 09:31:28.063637332 -0400
@@ -175,7 +175,7 @@ EOF

# Generate copyright file
cat <<EOF > debian/copyright
-This is a packacked upstream version of the Linux kernel.
+This is a packaged upstream version of the Linux kernel.

The sources may be found at most Linux archive sites, including:
https://www.kernel.org/pub/linux/kernel
Fixes: incorrect user mode subarch tag in scripts/subarch.include
Signed-off-by: Woody Suwalski <terraluna977@xxxxxxxxx>

--- a/scripts/subarch.include 2023-02-19 17:24:22.000000000 -0500
+++ b/scripts/subarch.include 2023-03-30 11:18:05.357082494 -0400
@@ -4,7 +4,7 @@
# then ARCH is assigned, getting whatever value it gets normally, and
# SUBARCH is subsequently ignored.

-SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/x86_64/x86/ \
-e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ \
Fixes: in Debian packaging use a real changelog file if provided
Signed-off-by: Woody Suwalski <terraluna977@xxxxxxxxx>

--- a/scripts/package/mkdebian 2023-03-31 09:38:14.620023584 -0400
+++ b/scripts/package/mkdebian 2023-03-31 09:38:55.704050033 -0400
@@ -164,14 +164,18 @@ echo $debarch > debian/arch
extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev:native)"
extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)"

-# Generate a simple changelog template
-cat <<EOF > debian/changelog
+if [ ! -s patches/changelog ]; then
+ # Generate a simple changelog template
+ cat <<EOF > debian/changelog
$sourcename ($packageversion) $distribution; urgency=low

* Custom built Linux kernel.

-- $maintainer $(date -R)
EOF
+else
+ mv patches/changelog debian
+fi

# Generate copyright file
cat <<EOF > debian/copyright