Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored Build Chain #66

Merged
merged 6 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/BuildRaspiOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@ on:
push:
branches:
- '**'
paths:
- 'src/**'
- 'emulation/**'
- '.github/workflows/BuildRaspiOS.yml'
tags-ignore:
- '**'
pull_request:
types: [ opened, edited ]
paths:
- 'src/**'
- 'emulation/**'
- '.github/workflows/BuildRaspiOS.yml'

jobs:
raspiosbuild:
runs-on: ubuntu-latest

steps:
- name: Install Dependencies
run: sudo apt update; sudo apt install coreutils p7zip-full qemu-user-static zip
run: sudo apt update; sudo apt install --yes coreutils p7zip-full qemu-user-static zip

- name: Checkout CustomPiOS
uses: actions/checkout@v2
Expand All @@ -30,7 +38,12 @@ jobs:
submodules: true

- name: Download Raspberry Pi OS Source Image
run: aria2c -d repository/src/image/ --seed-time=0 https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip.torrent
run: aria2c -d repository/src/image/ --seed-time=0 https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf_latest.torrent

- name: Comparing Checksums
run: |
cd repository/src/image
curl -JL https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf_latest.sha256 | awk '{print $1" "$2}' | sha256sum -c

- name: Update CustomPiOS Paths
run: cd repository/src && ../../CustomPiOS/src/update-custompios-paths
Expand All @@ -44,7 +57,7 @@ jobs:
- name: Compress the image
run: zip mainsailos-raspios-lite-latest.zip mainsailos-raspios-lite-latest.img

- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v2
with:
name: mainsailos-raspios-lite-latest.zip
path: mainsailos-raspios-lite-latest.zip
5 changes: 5 additions & 0 deletions .github/workflows/ReleaseRaspiOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
- name: Download Raspberry Pi OS Source Image
run: aria2c -d repository/src/image/ --seed-time=0 https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip.torrent

- name: Comparing Checksums
run: |
cd repository/src/image
curl -JL https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf_latest.sha256 | awk '{print $1" "$2}' | sha256sum -c

- name: Update CustomPiOS Paths
run: cd repository/src && ../../CustomPiOS/src/update-custompios-paths

Expand Down
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
56 changes: 0 additions & 56 deletions docs/CHANGELOG.md

This file was deleted.

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

This file was deleted.