From 4a92768ba19b4a3fe73f32d7478a9f6e532543d1 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Wed, 9 Oct 2024 12:07:13 -0400 Subject: [PATCH] hvk: add option to specify deploy folder Can be usefull when deploying to local NFS server, for example. --- scripts/hvk-compile.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/hvk-compile.sh b/scripts/hvk-compile.sh index cdc4470..b915b87 100755 --- a/scripts/hvk-compile.sh +++ b/scripts/hvk-compile.sh @@ -14,6 +14,7 @@ print_usage() echo "Usage: ${PROG_NAME} [OPTIONS...] [IP ADDRESS]" echo echo "Options:" + echo " -f deploy folder (default is ./rootfs)" echo " -h display this help and exit" echo " -r reboot after deploying files" echo " -w compile with W=1" @@ -24,13 +25,17 @@ print_usage() reboot=0 warnings_opts="" archive=0 +deploydir=${DEPLOYDIR} -while getopts "hrwz" flag ;do +while getopts "f:hrwz" flag ;do case ${flag} in h) print_usage exit 0 ;; + f) + deploydir=${OPTARG} + ;; r) reboot=1 ;; @@ -97,21 +102,20 @@ elif [ x"${mode}" = x"uboot" ]; then fi function rootfs_install() { - rm -rf ${DEPLOYDIR}/lib - mkdir -p ${DEPLOYDIR} + mkdir -p ${deploydir} if [ x"${CONFIG_MODULES}" = x"1" ]; then - ${KMAKE} INSTALL_MOD_PATH=${DEPLOYDIR} modules_install + ${KMAKE} INSTALL_MOD_PATH=${deploydir} modules_install fi - mkdir -p ${DEPLOYDIR}/boot + mkdir -p ${deploydir}/boot - cp ${BOOT_SRC}/Image ${DEPLOYDIR}/boot/Image-latest - cp ${DTB_SRC} ${DEPLOYDIR}/boot/latest.dtb + cp ${BOOT_SRC}/Image ${deploydir}/boot/Image-latest + cp ${DTB_SRC} ${deploydir}/boot/latest.dtb } function rootfs_archive() { - pushd ${DEPLOYDIR} + pushd ${deploydir} tar cf - * | xz > ../${ARCHIVE} popd } -- 2.20.1