From df0c231cec95cc80a201c6ec3c51edcb0cc4bf2e Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Wed, 9 Oct 2024 12:19:41 -0400 Subject: [PATCH] hvk: autodetermine archive name based on release --- scripts/hvk-compile.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/hvk-compile.sh b/scripts/hvk-compile.sh index b915b87..836000c 100755 --- a/scripts/hvk-compile.sh +++ b/scripts/hvk-compile.sh @@ -6,7 +6,6 @@ SCRIPTPATH=$(dirname ${SCRIPT}) source ${SCRIPTPATH}/hvk-common.sh DEPLOYDIR=rootfs -ARCHIVE=kernel.tar.xz print_usage() { @@ -115,8 +114,17 @@ function rootfs_install() { } function rootfs_archive() { + if [ -f "include/config/kernel.release" ]; then + archive="linux-$(cat include/config/kernel.release).tar.xz" + fi + + if [ "${archive}" = "" ]; then + echo "${PROG_NAME}: Unable to determine kernel release" + exit 1 + fi + pushd ${deploydir} - tar cf - * | xz > ../${ARCHIVE} + tar cf - * | xz > ../${archive} popd } @@ -129,8 +137,8 @@ if [ "${EVK_IP}" != "" ]; then rootfs_install rootfs_archive - scp ${ARCHIVE} root@${EVK_IP}:/tmp - ssh root@${EVK_IP} "cd / && tar -xf /tmp/${ARCHIVE}" + scp ${archive} root@${EVK_IP}:/tmp + ssh root@${EVK_IP} "cd / && tar -xf /tmp/${archive}" # Determine if using extlinux on target: ssh -q root@${EVK_IP} [[ -f /boot/extlinux/extlinux.conf ]] && EXTLINUX=1 || EXTLINUX=0; -- 2.20.1