--- a/scripts/mk-flash-layout.ori 2021-08-25 17:29:41.404603949 +0200 +++ b/scripts/mk-flash-layout 2021-08-25 17:32:41.177795488 +0200 @@ -195,6 +195,7 @@ echo "FLASH_HW=/dev/$FLASH_HW" echo "FLASH_SW=/dev/$FLASH_SW" [ -z "$FLASH_NV" ] || echo "FLASH_NV=/dev/$FLASH_NV" + [ -z "$FLASH_DBG" ] || echo "FLASH_DBG=/dev/$FLASH_DBG" echo "FOUND_IMG1=$FOUND_IMG1" echo "FOUND_IMG2=$FOUND_IMG2" ) > "$LAYOUT_DIR/$LAYOUT_TMP" @@ -222,6 +223,10 @@ FLASH_NV=$REPLY get_part_size $FLASH_NV && [ $REPLY -ge 4096 ] || FLASH_NV= fi + if get_next_part $FLASH_MBR $FLASH_NV; then + FLASH_DBG=$REPLY + get_part_size $FLASH_DBG && [ $REPLY -ge 0 ] || FLASH_DBG= + fi # now try to mount $FLASH_SW mount_flash && return 0 @@ -236,6 +241,7 @@ FALLBACK_HW=$FLASH_HW FALLBACK_SW=$FLASH_SW FALLBACK_NV=$FLASH_NV + FALLBACK_DBG=$FLASH_DBG fi fi return 1 @@ -267,6 +273,11 @@ get_part_size $FLASH_NV && [ $REPLY -ge 4096 ] || FLASH_NV= fi + if get_next_part $FLASH_MBR $FLASH_NV; then + FLASH_DBG=$REPLY + get_part_size $FLASH_DBG && [ $REPLY -ge 0 ] || FLASH_DBG= + fi + # now try to mount $FLASH_SW if mount_flash; then FLASH_TYPE=PART @@ -283,6 +294,7 @@ FALLBACK_HW=$FLASH_HW FALLBACK_SW=$FLASH_SW FALLBACK_NV=$FLASH_NV + FALLBACK_DBG=$FLASH_DBG fi fi else @@ -328,6 +340,7 @@ FLASH_HW= FLASH_SW= FLASH_NV= + FLASH_DBG= FOUND_IMG1= FOUND_IMG2= @@ -452,6 +465,7 @@ FLASH_HW=$FALLBACK_HW FLASH_SW=$FALLBACK_SW FLASH_NV=$FALLBACK_NV + FLASH_DBG=$FALLBACK_DBG dump_layout [ -z "$QUIET" ] && echo "Found unformatted flash on ${FLASH_SW}"