From 0ff8660dc27166ce5af2e7641d156ec104908d13 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Fri, 6 May 2022 18:36:47 +0800 Subject: [PATCH] mkfirmware.sh: Avoid touching extra partitions without source dir Tested with: export RK_EXTRA_PARTITIONS="/dev/sda1:/mnt/usb_storage:vfat:defaults::" Check: 1/ no errors in mkfirmware.sh 2/ etc/fstab got: /dev/sda1 /mnt/usb_storage vfat defaults 0 2 Change-Id: I2f567a9084b14a951d243276c742b0a1667576e9 Signed-off-by: Jeffy Chen --- common/mkfirmware.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/common/mkfirmware.sh b/common/mkfirmware.sh index b56f058..38287fc 100755 --- a/common/mkfirmware.sh +++ b/common/mkfirmware.sh @@ -202,7 +202,22 @@ pack_extra_partitions() { MOUNT="$(partition_arg "$part" 2 "/$PART_NAME")" FS_TYPE="$(partition_arg "$part" 3)" - SRC="$DEV_DIR/$PART_NAME/$(partition_arg "$part" 5 "$PART_NAME")" + + SRC="$(partition_arg "$part" 5)" + + # Src is either none or relative path to device/rockchip// + # or absolute path + case "$SRC" in + "") + continue + ;; + /*) + ;; + *) + SRC="$DEV_DIR/$PART_NAME/$SRC" + ;; + esac + SIZE="$(partition_arg "$part" 6 auto)" OPTS="$(partition_arg "$part" 7)" LABEL=