Files
Ashin Walpola d107534eb2 Keep vanetza-idf in obu-firmware, so a plain clone builds the firmware
obu-firmware builds against the vanetza-idf C-ITS library, which until now
came from the colleague's microbu-esp32c5 tree beside the repository and was
not tracked here, so a clone of this repository could not build the firmware
it ships. The library alone is now part of obu-firmware, as
obu-firmware/external/vanetza-idf: their external/vanetza-idf at commit
cf4b99f, unchanged (9775 files; see its PROVENANCE.md). CMake takes it from
there by default; -DVANETZA_IDF_DIR still points the build elsewhere.

The rest of the colleague's tree (their own VAM firmware, PKI tooling,
station-link Python tools, the V2X2MAP bridge) stays out of this repository
and gitignored; nothing is pushed to their repository. NOTES.md, docs/06,
TODO.md and the pcap verifier's usage line point at the new location.
2026-09-24 10:56:05 +02:00

64 lines
2.7 KiB
CMake

if(NOT OUTPUT_DIRECTORY)
message(FATAL_ERROR "OUTPUT_DIRECTORY variable is undefined")
endif()
file(MAKE_DIRECTORY "${OUTPUT_DIRECTORY}")
if(NOT PATCH_DIRECTORY)
message(FATAL_ERROR "PATH_DIRECTORY variable is undefined")
endif()
macro(download URL OUTPUT_FILE)
file(DOWNLOAD "${URL}" "${OUTPUT_FILE}"
STATUS _status)
list(GET _status 0 _result)
if(NOT _result EQUAL 0)
list(GET _status 1 _log)
message(FATAL_ERROR "Download of ${URL} failed: ${_log}")
endif()
endmacro()
macro(download_ieee1609dot2 ASN1_FILE)
download(
"https://forge.etsi.org/rep/ITS/asn1/ieee1609.2/-/raw/2022-published/${ASN1_FILE}"
"${OUTPUT_DIRECTORY}/${ASN1_FILE}")
endmacro()
macro(download_ieee1609dot2dot1 ASN1_FILE)
download(
"https://forge.etsi.org/rep/ITS/asn1/ieee1609.2.1/-/raw/2022-published/${ASN1_FILE}"
"${OUTPUT_DIRECTORY}/${ASN1_FILE}")
endmacro()
download_ieee1609dot2("Ieee1609Dot2.asn")
download_ieee1609dot2("Ieee1609Dot2BaseTypes.asn")
download_ieee1609dot2("Ieee1609Dot2Crl.asn")
download_ieee1609dot2("Ieee1609Dot2CrlBaseTypes.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1AcaEeInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1AcaLaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1AcaMaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1AcaRaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1Acpc.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1CamRaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1CertManagement.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1EcaEeInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1EeMaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1EeRaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1LaMaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1LaRaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1MaRaInterface.asn")
download_ieee1609dot2dot1("Ieee1609Dot2Dot1Protocol.asn")
file(READ "${OUTPUT_DIRECTORY}/Ieee1609Dot2.asn" _content)
string(REGEX REPLACE " Extension" " IeeeExtension" _content "${_content}")
file(WRITE "${OUTPUT_DIRECTORY}/Ieee1609Dot2.asn" "${_content}")
file(READ "${OUTPUT_DIRECTORY}/Ieee1609Dot2BaseTypes.asn" _content)
string(REGEX REPLACE "([\r\n])Extension" "\\1IeeeExtension" _content "${_content}")
file(WRITE "${OUTPUT_DIRECTORY}/Ieee1609Dot2BaseTypes.asn" "${_content}")
execute_process(COMMAND patch -p1 -i "${PATCH_DIRECTORY}/scoped-certificate-request.patch"
WORKING_DIRECTORY "${OUTPUT_DIRECTORY}"
RESULT_VARIABLE PATCH_RESULT)
if(NOT PATCH_RESULT EQUAL 0)
message(SEND_ERROR "Applying patch on IEEE 1609.2.1 ScopedCertificateRequest failed!")
endif()