diff --git a/.gitmodules b/.gitmodules index 4fe0f7539..920894a05 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "libopencm3"] path = vendor/libopencm3 url = https://github.com/libopencm3/libopencm3.git +[submodule "vendor/nanopb"] + path = vendor/nanopb + url = https://github.com/nanopb/nanopb.git diff --git a/Dockerfile b/Dockerfile index ad05037a6..00cd4a039 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,5 @@ RUN apt-get update # install build tools and dependencies -RUN apt-get install -y build-essential git python python-ecdsa gcc-arm-none-eabi +RUN apt-get install -y build-essential git python python-ecdsa gcc-arm-none-eabi protobuf-compiler \ + libprotobuf-dev python-protobuf python3-protobuf diff --git a/build-firmware.sh b/build-firmware.sh index a045e7cb8..6543b7fc5 100755 --- a/build-firmware.sh +++ b/build-firmware.sh @@ -13,6 +13,8 @@ docker run -t -v $(pwd)/build:/build:z $IMAGE /bin/sh -c "\ git checkout $TAG && \ git submodule update --init && \ make -C vendor/libopencm3 && \ + make -C vendor/nanopb/generator/proto && \ + make -C firmware/protob && \ make && \ make -C firmware sign && \ cp firmware/trezor.bin /$BINFILE && \ diff --git a/firmware/protob/Makefile b/firmware/protob/Makefile index 38486526c..6897debd1 100644 --- a/firmware/protob/Makefile +++ b/firmware/protob/Makefile @@ -1,7 +1,7 @@ all: messages.pb.c storage.pb.c types.pb.c messages_map.h %.pb.c: %.pb %.options - nanopb_generator.py $< -L '#include "%s"' -T + ../../vendor/nanopb/generator/nanopb_generator.py $< -L '#include "%s"' -T %.pb: %.proto protoc -I/usr/include -I. $< -o $@ diff --git a/vendor/nanopb b/vendor/nanopb new file mode 160000 index 000000000..54c34a9fd --- /dev/null +++ b/vendor/nanopb @@ -0,0 +1 @@ +Subproject commit 54c34a9fda152937d4cd0c7fd85c067fca23af75