From 4d9f2e369272d66193c32d9e12a4731a045b3a2b Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Thu, 28 Dec 2023 15:44:54 +0800 Subject: [PATCH] optional argument for generated ROMFS file path. existing headerfile path is used when argument is missing. Signed-off-by: Yanfeng Liu --- tools/mkromfsimg.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/mkromfsimg.sh b/tools/mkromfsimg.sh index fde95c965..1287ef68e 100755 --- a/tools/mkromfsimg.sh +++ b/tools/mkromfsimg.sh @@ -36,6 +36,12 @@ fsdir=${topdir}/bin romfsimg=romfs.img headerfile=boot_romfsimg.h +if [ -n "$1" ]; then # output file path + _path=$(dirname "$1") + # ensure output path exists + mkdir -p $_path 2>/dev/null && headerfile=$1 +fi + # Sanity checks if [ ! -d "${fsdir}" ]; then