[PATCH 5/8] Adjust Linux build script to work with other major versions

Andrew Cooper posted 8 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH 5/8] Adjust Linux build script to work with other major versions
Posted by Andrew Cooper 8 months, 1 week ago
Also use 'tar o' to decompress based on file name.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
CC: Anthony PERARD <anthony.perard@vates.tech>
---
 scripts/x86_64-kernel-linux.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/x86_64-kernel-linux.sh b/scripts/x86_64-kernel-linux.sh
index 2a816f0b3204..5a0160655bea 100755
--- a/scripts/x86_64-kernel-linux.sh
+++ b/scripts/x86_64-kernel-linux.sh
@@ -11,9 +11,10 @@ WORKDIR="${PWD}"
 COPYDIR="${WORKDIR}/binaries/"
 
 # Build Linux
+MAJOR=${LINUX_VERSION%%.*}
 curl -fsSLO \
-    https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"${LINUX_VERSION}".tar.xz
-tar xJf linux-"${LINUX_VERSION}".tar.xz
+    https://cdn.kernel.org/pub/linux/kernel/v"${MAJOR}".x/linux-"${LINUX_VERSION}".tar.xz
+tar oxf linux-"${LINUX_VERSION}".tar.xz
 cd linux-"${LINUX_VERSION}"
 make ARCH=x86 defconfig
 make ARCH=x86 xen.config
-- 
2.39.5


Re: [PATCH 5/8] Adjust Linux build script to work with other major versions
Posted by Marek Marczykowski-Górecki 8 months, 1 week ago
On Wed, Apr 09, 2025 at 05:36:59PM +0100, Andrew Cooper wrote:
> Also use 'tar o' to decompress based on file name.

Do you mean 'tar a'? -o is --no-same-owner. Anyway, just 'tar xf'
works too, even in alpine.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> CC: Anthony PERARD <anthony.perard@vates.tech>
> ---
>  scripts/x86_64-kernel-linux.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/x86_64-kernel-linux.sh b/scripts/x86_64-kernel-linux.sh
> index 2a816f0b3204..5a0160655bea 100755
> --- a/scripts/x86_64-kernel-linux.sh
> +++ b/scripts/x86_64-kernel-linux.sh
> @@ -11,9 +11,10 @@ WORKDIR="${PWD}"
>  COPYDIR="${WORKDIR}/binaries/"
>  
>  # Build Linux
> +MAJOR=${LINUX_VERSION%%.*}
>  curl -fsSLO \
> -    https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"${LINUX_VERSION}".tar.xz
> -tar xJf linux-"${LINUX_VERSION}".tar.xz
> +    https://cdn.kernel.org/pub/linux/kernel/v"${MAJOR}".x/linux-"${LINUX_VERSION}".tar.xz
> +tar oxf linux-"${LINUX_VERSION}".tar.xz
>  cd linux-"${LINUX_VERSION}"
>  make ARCH=x86 defconfig
>  make ARCH=x86 xen.config
> -- 
> 2.39.5
> 

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
Re: [PATCH 5/8] Adjust Linux build script to work with other major versions
Posted by Andrew Cooper 8 months, 1 week ago
On 09/04/2025 5:57 pm, Marek Marczykowski-Górecki wrote:
> On Wed, Apr 09, 2025 at 05:36:59PM +0100, Andrew Cooper wrote:
>> Also use 'tar o' to decompress based on file name.
> Do you mean 'tar a'? -o is --no-same-owner. Anyway, just 'tar xf'
> works too, even in alpine.

Hmm...  Muscle memory from long enough ago that I don't recall why.

Lets go with just xf then.

~Andrew