Changeset 14840


Ignorieren:
Zeitstempel:
25.08.2018 14:30:06 (vor 4 Wochen)
Autor:
er13
Nachricht:

packing/signing image: simplify debugging a little bit more

Datei:
1 bearbeitet

Legende:

Unverändert
Hinzugefügt
Entfernt
  • trunk/fwmod

    r14839 r14840  
    17701770 
    17711771    # Pack firmware image 
    1772     TAR_FOR_IMAGE_TARBALL="$TAR"       # use busybox tar for compatibility 
    1773 #   TAR_FOR_IMAGE_TARBALL="$TAR_GNU"   # GNU tar requires --format=gnu option 
    1774     [ "$TAR_FOR_IMAGE_TARBALL" = "$TAR_GNU" ] && TAR_FOR_IMAGE_TARBALL_FORMAT_OPT="--format=gnu" 
     1772    TAR_FOR_IMAGE_TARBALL="$TAR" # use busybox tar for compatibility (DEBUG COMMENT: change to TAR_GNU for GNU tar) 
     1773    if [ "$TAR_FOR_IMAGE_TARBALL" == "$TAR_GNU" ]; then 
     1774        TAR_FOR_IMAGE_TARBALL_FORMAT_OPT="--format=gnu" # GNU tar requires --format=gnu option 
     1775        img_name_infix=".gnu-tar" 
     1776    fi 
    17751777 
    17761778    echo0 "packing ${img_name}" 
    1777     "${TAR_FOR_IMAGE_TARBALL}" ${TAR_FOR_IMAGE_TARBALL_FORMAT_OPT} -C "$FIRMWARE_MOD_DIR" -cf "${img_name}.unsigned" ./var 
    1778     if [ $? -ne 0 ] || ! is_valid_tarball "${img_name}.unsigned"; then 
    1779         mv "${img_name}.unsigned" "${img_name}.unsigned.corrupted" 2>/dev/null 
     1779    "${TAR_FOR_IMAGE_TARBALL}" ${TAR_FOR_IMAGE_TARBALL_FORMAT_OPT} -C "$FIRMWARE_MOD_DIR" -cf "${img_name}${img_name_infix}.unsigned" ./var 
     1780    if [ $? -ne 0 ] || ! is_valid_tarball "${img_name}${img_name_infix}.unsigned"; then 
     1781        mv "${img_name}${img_name_infix}.unsigned" "${img_name}${img_name_infix}.unsigned.corrupted" 2>/dev/null 
    17801782        error 1 "packing of firmware image failed" 
    17811783    fi 
    1782     echo1 "unsigned image file size: $(byte_to_mb $(wc -c < "${img_name}.unsigned")) ($(wc -c < "${img_name}.unsigned") bytes)" 
     1784    echo1 "unsigned image file size: $(byte_to_mb $(wc -c < "${img_name}${img_name_infix}.unsigned")) ($(wc -c < "${img_name}${img_name_infix}.unsigned") bytes)" 
    17831785 
    17841786    if [ "$DO_SIGN" -gt 0 ]; then 
     
    17871789            # be verbose if no private key password provided 
    17881790            YF_SIGNIMAGE_TAR="${TAR_FOR_IMAGE_TARBALL}" \ 
    1789             "${TOOLS_DIR}/yf/signimage/sign_image" "${img_name}.unsigned" "${FREETZ_FWMOD_SIGN_PRIVATE_KEY_PASSWORD}"                               > "${img_name}.signed" 
     1791            "${TOOLS_DIR}/yf/signimage/sign_image" "${img_name}${img_name_infix}.unsigned" "${FREETZ_FWMOD_SIGN_PRIVATE_KEY_PASSWORD}"                                                > "${img_name}${img_name_infix}.signed" 
    17901792        else 
    17911793            YF_SIGNIMAGE_TAR="${TAR_FOR_IMAGE_TARBALL}" \ 
    1792             "${TOOLS_DIR}/yf/signimage/sign_image" "${img_name}.unsigned" "${FREETZ_FWMOD_SIGN_PRIVATE_KEY_PASSWORD}" 2>"${MOD_DIR}/sign_image.log" > "${img_name}.signed" 
    1793         fi 
    1794         if [ $? -ne 0 ] || ! is_valid_tarball "${img_name}.signed"; then 
    1795             mv "${img_name}.signed" "${img_name}.signed.corrupted" 2>/dev/null 
     1794            "${TOOLS_DIR}/yf/signimage/sign_image" "${img_name}${img_name_infix}.unsigned" "${FREETZ_FWMOD_SIGN_PRIVATE_KEY_PASSWORD}" 2>"${MOD_DIR}/sign_image${img_name_infix}.log" > "${img_name}${img_name_infix}.signed" 
     1795        fi 
     1796        if [ $? -ne 0 ] || ! is_valid_tarball "${img_name}${img_name_infix}.signed"; then 
     1797            mv "${img_name}${img_name_infix}.signed" "${img_name}${img_name_infix}.signed.corrupted" 2>/dev/null 
    17961798            error 1 "signing of firmware image failed, see console output or ${MOD_DIR}/sign_image.log for details" 
    17971799        fi 
    1798         echo1 "signed image file size: $(byte_to_mb $(wc -c < "${img_name}.signed")) ($(wc -c < "${img_name}.signed") bytes)" 
     1800        echo1 "signed image file size: $(byte_to_mb $(wc -c < "${img_name}${img_name_infix}.signed")) ($(wc -c < "${img_name}${img_name_infix}.signed") bytes)" 
    17991801    fi 
    18001802 
    18011803    [ "$DO_SIGN" -gt 0 ] && final_img_suffix=signed || final_img_suffix=unsigned 
    18021804    echo0 "using ${final_img_suffix} image as the final one" 
    1803     cp -a "${img_name}.${final_img_suffix}" "${img_name}" 
     1805    cp -a "${img_name}${img_name_infix}.${final_img_suffix}" "${img_name}${img_name_infix}" 
    18041806 
    18051807    # delete temporary unsigned/signed files unless we're debugging 
    1806     [ "$DEBUG" != "1" ] && rm -f "${img_name}.unsigned" "${img_name}.signed" 
     1808    [ "$DEBUG" != "1" ] && rm -f "${img_name}${img_name_infix}.unsigned" "${img_name}${img_name_infix}.signed" 
    18071809fi 
    18081810 
Hinweis: Hilfe zur Verwendung der Changeset-Ansicht finden Sie unter TracChangeset.