Skip to content

Commit

Permalink
refactor(Makefile): Revert fixed Image download.
Browse files Browse the repository at this point in the history
* This reverts imolement of fixed download of
* Raspberry Pi OS Image.

* Since there is an "latest" download URL
* for "buster" based Images it uses that URL.

* Updated .gitignore

Signed-off-by: Stephan Wendel <me@stephanwe.de>
  • Loading branch information
KwadFan committed Dec 26, 2021
1 parent a94a276 commit f7e157b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 28 deletions.
20 changes: 6 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
src/config.local
src/custompios_path
src/image/*.zip
src/image-variants/*.zip
**/key.json
src/nightly_build_scripts/index.html
src/nightly_build_scripts/node_modules
src/workspace-*
# Ignore workspace
src/workspace

# Ignore src/image
src/image/**

# Ignore build.log
src/build.log
src/vagrant/*.log
src/vagrant/.vagrant
.vscode
.idea
build.log
.DS_Store
33 changes: 20 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,29 @@ build: verifyimage
docker-compose down

verifyimage:
@if [ ! -f "src/image/2021-12-02-raspios-buster-armhf-lite.zip" ]; \
then echo "Raspberry Pi OS image does not exist. Starting Download..."; \
curl -J -L https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip > src/image/2021-12-02-raspios-buster-armhf-lite.zip; else \
echo "Raspberry Pi OS image found. Starting checksum verification"; \
curl -J -L https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip.sha256 > src/image/2021-12-02-raspios-buster-armhf-lite.zip.sha256; \
IMAGE_SHA1=`sha256sum src/image/2021-12-02-raspios-buster-armhf-lite.zip | awk '{print $$1}'`; \
DL_SHA1=`awk '{print $$1}' src/image/2021-12-02-raspios-buster-armhf-lite.zip.sha256`; \
if [ "$$IMAGE_SHA256" != "$$DL_SHA256" ]; then echo "SHAs do not match."; \
echo "Got $$IMAGE_SHA256"; echo "Expected $$DL_SHA256"; \
echo "SHA256 Sums dont match! Aborting"; \
exit 1; else echo "SHA256 Sums matched! Continue..."; fi; fi
@if [ ! -f "src/image/raspios-oldstable-lite.zip" ]; then \
echo -e "\nRaspberry Pi OS image does not exist. Starting Download...\n"; \
curl https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf_latest \
-JLo src/image/raspios-oldstable-lite.zip; fi;

@if [ ! -f "src/image/raspios-oldstable-lite.zip.sha256" ]; then \
echo -e "Get sha256 Checksum file\n"; \
curl https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf_latest.sha256 \
-JLo src/image/raspios-oldstable-lite.zip.sha256; fi; \

@echo -e "Starting checksum verification\n"
@IMAGE_SHA256=`sha256sum src/image/raspios-oldstable-lite.zip | awk '{print $$1}'` ; \
DL_SHA256=`awk '{print $$1}' ./src/image/raspios-oldstable-lite.zip.sha256` ; \
if [ $$IMAGE_SHA256 != $$DL_SHA256 ]; then echo -e "SHAs do not match.\n"; \
echo -e "Image has checksum:\t $$IMAGE_SHA256"; \
echo -e "Expected checksum:\t $$DL_SHA256"; \
echo -e "\nSHA256 Sums dont match! Aborting\n"; exit 1; \
else echo -e "SHA256 Sums matched! Continue...\n"; fi;

clean:
rm -rf src/workspace
rm -f src/build.log
rm -f src/image/*.zip.sha1
rm -f src/image/*.zip.sha*

# dist clean should contain clean as usual
distclean:
Expand All @@ -37,7 +44,7 @@ distclean:

# /src/workspace is blocked by file Permissions from Docker Container and you are not building as root user
cleanfix:
sudo chmod -R 0777 ./src/workspace
sudo chmod -R 0777 src/workspace

test:
./run.sh
1 change: 0 additions & 1 deletion src/image/2021-12-02-raspios-buster-armhf-lite.zip.sha256

This file was deleted.

0 comments on commit f7e157b

Please sign in to comment.