diff mbox series

update_kernel.sh: fix unified version file updates

Message ID 20220208132830.914-1-rsalvaterra@gmail.com
State Accepted
Delegated to: Rui Salvaterra
Headers show
Series update_kernel.sh: fix unified version file updates | expand

Commit Message

Rui Salvaterra Feb. 8, 2022, 1:28 p.m. UTC
The previous commit broke the kernel-version.mk automated update, since the
kernel version files are now split. However, older branches still use the
unified file, so compatibility must be kept.

Check for the presence of the kernel version-specific file. If it doesn't exist,
assume we're using the unified file and do the version update accordingly.

Fixes: cbb9d08 ("update_kernel.sh: update it to new kernel hash/version file way")

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
---
 update_kernel.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/update_kernel.sh b/update_kernel.sh
index 2c4bb09..a74f91d 100755
--- a/update_kernel.sh
+++ b/update_kernel.sh
@@ -155,7 +155,15 @@  if [ "$UPDATE" -eq 1 ]; then
 		CHECKSUM=$(./staging_dir/host/bin/mkhash sha256 dl/linux-$PATCHVER.tar.xz)
 	fi
 
-	$CMD ./staging_dir/host/bin/sed -i include/kernel-${KERNEL} \
+	if [ -f include/kernel-${KERNEL} ]; then
+		# split version files
+		KERNEL_VERSION_FILE=include/kernel-${KERNEL}
+	else
+		# unified version file
+		KERNEL_VERSION_FILE=include/kernel-version.mk
+	fi
+
+	$CMD ./staging_dir/host/bin/sed -i ${KERNEL_VERSION_FILE} \
 		-e "s|LINUX_VERSION-${KERNEL} =.*|LINUX_VERSION-${KERNEL} = ${NEWVER}|" \
 		-e "s|LINUX_KERNEL_HASH-${KERNEL}.*|LINUX_KERNEL_HASH-${PATCHVER} = ${CHECKSUM}|"
 fi