forked from mainsail-crew/MainsailOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (40 loc) · 1.65 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Makefile
# This file may distributed under GPL v3
# Original written by Raymond Himle, Nomsplease and Paul Greinadus
# revamped by KwadFan
all: build
build: verifyimage
docker-compose up -d
docker exec -it mainsailos-build build
docker-compose down
verifyimage:
@if [ ! -f "src/image/legacy-raspios-lite-latest.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/legacy-raspios-lite-latest.zip; fi;
@if [ ! -f "src/image/legacy-raspios-lite-latest.zip.sha256" ]; then \
echo -e "Get sha256 Checksum file\n"; \
curl https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf_latest.sha256 \
-JLo src/image/legacy-raspios-lite-latest.zip.sha256; fi; \
@echo -e "Starting checksum verification\n"
@IMAGE_SHA256=`sha256sum src/image/legacy-raspios-lite-latest.zip | awk '{print $$1}'` ; \
DL_SHA256=`awk '{print $$1}' ./src/image/legacy-raspios-lite-latest.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.sha*
# dist clean should contain clean as usual
distclean:
rm -rf src/workspace
rm -f src/build.log
rm -rf src/image/*.zip
# /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
test:
./run.sh