Changeset 14839


Ignorieren:
Zeitstempel:
25.08.2018 14:11:37 (vor 4 Wochen)
Autor:
er13
Nachricht:

packing/signing image: simplify debugging by providing an option to keep the intermediate image files (.unsigned/.signed)

Datei:
1 bearbeitet

Legende:

Unverändert
Hinzugefügt
Entfernt
  • trunk/fwmod

    r14838 r14839  
    17751775 
    17761776    echo0 "packing ${img_name}" 
    1777     "${TAR_FOR_IMAGE_TARBALL}" ${TAR_FOR_IMAGE_TARBALL_FORMAT_OPT} -C "$FIRMWARE_MOD_DIR" -cf "${img_name}" ./var 
    1778     if [ $? -ne 0 ] || ! is_valid_tarball "${img_name}"; then 
    1779         mv "${img_name}" "${img_name}.corrupted" 2>/dev/null 
     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 
    17801780        error 1 "packing of firmware image failed" 
    17811781    fi 
    1782     echo1 "image file size: $(byte_to_mb $(wc -c < "${img_name}"))" 
     1782    echo1 "unsigned image file size: $(byte_to_mb $(wc -c < "${img_name}.unsigned")) ($(wc -c < "${img_name}.unsigned") bytes)" 
    17831783 
    17841784    if [ "$DO_SIGN" -gt 0 ]; then 
     
    17871787            # be verbose if no private key password provided 
    17881788            YF_SIGNIMAGE_TAR="${TAR_FOR_IMAGE_TARBALL}" \ 
    1789             "${TOOLS_DIR}/yf/signimage/sign_image" "${img_name}" "${FREETZ_FWMOD_SIGN_PRIVATE_KEY_PASSWORD}"                               > "${img_name}.signed" 
     1789            "${TOOLS_DIR}/yf/signimage/sign_image" "${img_name}.unsigned" "${FREETZ_FWMOD_SIGN_PRIVATE_KEY_PASSWORD}"                               > "${img_name}.signed" 
    17901790        else 
    17911791            YF_SIGNIMAGE_TAR="${TAR_FOR_IMAGE_TARBALL}" \ 
    1792             "${TOOLS_DIR}/yf/signimage/sign_image" "${img_name}" "${FREETZ_FWMOD_SIGN_PRIVATE_KEY_PASSWORD}" 2>"${MOD_DIR}/sign_image.log" > "${img_name}.signed" 
     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" 
    17931793        fi 
    17941794        if [ $? -ne 0 ] || ! is_valid_tarball "${img_name}.signed"; then 
     
    17961796            error 1 "signing of firmware image failed, see console output or ${MOD_DIR}/sign_image.log for details" 
    17971797        fi 
    1798  
    1799         mv "${img_name}.signed" "${img_name}" 
    1800         echo1 "signed image file size: $(byte_to_mb $(wc -c < "${img_name}"))" 
    1801     fi 
     1798        echo1 "signed image file size: $(byte_to_mb $(wc -c < "${img_name}.signed")) ($(wc -c < "${img_name}.signed") bytes)" 
     1799    fi 
     1800 
     1801    [ "$DO_SIGN" -gt 0 ] && final_img_suffix=signed || final_img_suffix=unsigned 
     1802    echo0 "using ${final_img_suffix} image as the final one" 
     1803    cp -a "${img_name}.${final_img_suffix}" "${img_name}" 
     1804 
     1805    # delete temporary unsigned/signed files unless we're debugging 
     1806    [ "$DEBUG" != "1" ] && rm -f "${img_name}.unsigned" "${img_name}.signed" 
    18021807fi 
    18031808 
Hinweis: Hilfe zur Verwendung der Changeset-Ansicht finden Sie unter TracChangeset.