Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
fix: image build (#25)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Co-authored-by: Mathis Mensing <matmen@dreadful.tech>
  • Loading branch information
pedrolamas and matmen authored Feb 25, 2022
1 parent 103659c commit f9db381
Showing 11 changed files with 39 additions and 32 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/BuildRaspiOS.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ on:
push:
branches:
- '**'
tags-ignore:
tags-ignore:
- '**'
pull_request:
types: [ opened, edited ]
@@ -17,24 +17,24 @@ jobs:

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 coreutils p7zip-full qemu-user-static zip

- name: Checkout CustomPiOS
uses: actions/checkout@v2
with:
repository: 'guysoft/CustomPiOS'
path: CustomPiOS

- name: Checkout FluiddPI Project
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
path: repository
submodules: true

- name: Download Raspbian Source Image
- name: Download Raspberry Pi OS Source Image
run: aria2c -d repository/src/image/ --seed-time=0 https://downloads.raspberrypi.org/raspios_lite_armhf_latest.torrent

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

@@ -43,11 +43,11 @@ jobs:

- name: Copy output image
run: cp ${{ github.workspace }}/repository/src/workspace/*-raspios-*-lite.img fluiddpi-raspios-lite-latest.img

- name: Compress the image
run: zip fluiddpi-raspios-lite-latest.zip fluiddpi-raspios-lite-latest.img

- uses: actions/upload-artifact@v1
with:
name: fluiddpi-raspios-lite-latest.zip
path: fluiddpi-raspios-lite-latest.zip
path: fluiddpi-raspios-lite-latest.zip
10 changes: 5 additions & 5 deletions .github/workflows/ReleaseRaspiOS.yml
Original file line number Diff line number Diff line change
@@ -16,17 +16,17 @@ jobs:
with:
repository: 'guysoft/CustomPiOS'
path: CustomPiOS

- name: Checkout FluiddPI Project
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
path: repository
submodules: true

- name: Download Raspbian Source Image
- name: Download Raspberry Pi OS Source Image
run: aria2c -d repository/src/image/ --seed-time=0 https://downloads.raspberrypi.org/raspios_lite_armhf_latest.torrent

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

@@ -35,7 +35,7 @@ jobs:

- name: Copy output image
run: cp ${{ github.workspace }}/repository/src/workspace/*-raspios-*-lite.img fluiddpi-raspios-lite-latest.img

- name: Compress the image
run: zip fluiddpi-raspios-lite-latest.zip fluiddpi-raspios-lite-latest.img

@@ -52,4 +52,4 @@ jobs:
upload_url: ${{ github.event.release.upload_url }}
asset_path: fluiddpi-raspios-lite-latest.zip
asset_name: fluiddpi-rpi-lite-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip
asset_content_type: application/zip
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -6,16 +6,16 @@ build: verifyimage
docker-compose down

verifyimage:
@if [ ! -f "src/image/raspbian_latest-raspbian.zip" ]; then echo "Raspbian image does not exist. Starting Download..."; curl -J -L https://downloads.raspberrypi.org/raspios_lite_armhf_latest > src/image/raspbian_latest-raspbian.zip; else \
echo "Raspbian image found. Starting checksum verification"; curl -J -L https://downloads.raspberrypi.org/raspios_lite_armhf_latest.sha1 > src/image/raspbian_latest-raspbian.zip.sha1; \
IMAGE_SHA1=`sha1sum src/image/raspbian_latest-raspbian.zip | awk '{print $$1}'`; \
DL_SHA1=`awk '{print $$1}' src/image/raspbian_latest-raspbian.zip.sha1`; \
if [ "$$IMAGE_SHA1" != "$$DL_SHA1" ]; then echo "SHAs do not match."; echo "Got $$IMAGE_SHA1"; echo "Expected $$DL_SHA1"; echo "Starting image download"; curl -J -L https://downloads.raspberrypi.org/raspios_lite_armhf_latest > src/image/raspbian_latest-raspbian.zip; else echo "SHAs Matched"; fi; fi
@if [ ! -f "src/image/raspberry_pi_os-latest.zip" ]; then echo "Raspbian image does not exist. Starting Download..."; curl -J -L https://downloads.raspberrypi.org/raspios_lite_armhf_latest > src/image/raspberry_pi_os.zip; else \
echo "Raspberry Pi OS image found. Starting checksum verification"; curl -J -L https://downloads.raspberrypi.org/raspios_lite_armhf_latest.sha1 > src/image/raspberry_pi_os-latest.zip.sha1; \
IMAGE_SHA1=`sha1sum src/image/raspberry_pi_os-latest.zip | awk '{print $$1}'`; \
DL_SHA1=`awk '{print $$1}' src/image/raspberry_pi_os-latest.zip.sha1`; \
if [ "$$IMAGE_SHA1" != "$$DL_SHA1" ]; then echo "SHAs do not match."; echo "Got $$IMAGE_SHA1"; echo "Expected $$DL_SHA1"; echo "Starting image download"; curl -J -L https://downloads.raspberrypi.org/raspios_lite_armhf_latest > src/image/raspberry_pi_os-latest.zip; else echo "SHAs Matched"; fi; fi

clean:
rm -rf src/workspace
rm -f src/build.log
rm -f src/image/raspbian_latest-raspbian.zip.sha1
rm -f src/image/raspberry_pi_os-latest.zip.sha1

distclean:
rm -rf src/image/*.zip
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

A pi image with Klipper, Moonraker and Fluidd pre-installed.

This repository contains the necessary code to generate the distribution from an existing Raspbian lite distro image.
This repository contains the necessary code to generate the distribution from an existing Raspberry Pi OS lite distro image.

## Where to download?

@@ -44,8 +44,6 @@ Recommended environment is Ubuntu or similar, with docker and docker-compose ins
- [docker](https://docs.docker.com/engine/install/ubuntu/)
- [docker-compose](https://docs.docker.com/compose/install/)
- [qemu-arm-static](http://packages.debian.org/sid/qemu-user-static)
- [CustomPiOS](https://github.com/guysoft/CustomPiOS)
- [Downloaded Raspbian Image](http://www.raspbian.org/)
- QEMU for emulation
- around ~5gb free space

@@ -86,7 +84,7 @@ make distclean
```bash
fluiddpi/
/emulation - Contains dependencies for emulation testing
/src/image - Contains our base raspbian image
/src/image - Contains our base Raspberry Pi OS image
/src/workspace - Created during build, and output for compiled images
```

4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Build FluiddPI From within FluiddPI / OctoPi / Raspbian / Debian / Ubuntu
FluiddPI can be built from Debian, Ubuntu, Raspbian, OctoPi, or even FluiddPI. Build requires about 5 GB of free space available. You can build it by issuing the following commands:
Build FluiddPI From within FluiddPI / OctoPi / Raspberry Pi OS / Debian / Ubuntu
FluiddPI can be built from Debian, Ubuntu, Raspberry Pi OS, OctoPi, or even FluiddPI. Build requires about 5 GB of free space available. You can build it by issuing the following commands:

sudo apt-get install gawk util-linux qemu-user-static git p7zip-full python3

2 changes: 1 addition & 1 deletion src/config
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@ export DIST_NAME=FluiddPI
export DIST_VERSION=0.4.0
export BASE_IMAGE_ENLARGEROOT=2500
export BASE_IMAGE_RESIZEROOT=500
export MODULES="base(network,raspicam,klipper,moonraker,fluidd,mjpgstreamer,password-for-sudo)"
export MODULES="base,releaseinfochange(network,raspicam,klipper,moonraker,fluidd,mjpgstreamer,password-for-sudo)"
2 changes: 1 addition & 1 deletion src/image/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Place zipped Rasbian image here.

If not otherwise specified, the build script will always use the most
recent zip file matching the file name pattern "*-raspbian.zip" located
recent zip file matching the file name pattern "*.zip" located
here.
2 changes: 1 addition & 1 deletion src/modules/klipper/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ -n "$KLIPPER_SRC_DIR" ] || KLIPPER_SRC_DIR=/home/pi/klipper
[ -n "$KLIPPER_PYTHON_DIR" ] || KLIPPER_PYTHON_DIR=/home/pi/klippy-env

[ -n "$KLIPPER_REPO_SHIP" ] || KLIPPER_REPO_SHIP=https://github.com/KevinOConnor/klipper.git
[ -n "$KLIPPER_REPO_SHIP" ] || KLIPPER_REPO_SHIP=https://github.com/Klipper3d/klipper.git
[ -n "$KLIPPER_REPO_BRANCH" ] || KLIPPER_REPO_BRANCH=master
4 changes: 2 additions & 2 deletions src/modules/klipper/start_chroot_script
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ apt update
apt install wget git gpiod -y

# Packages for python cffi
apt install python-virtualenv virtualenv python-dev libffi-dev build-essential -y
apt install virtualenv python-dev libffi-dev build-essential -y

# kconfig requirements
apt install libncurses-dev -y
@@ -33,7 +33,7 @@ apt install libusb-dev -y
# AVR chip installation and building
apt install avrdude gcc-avr binutils-avr avr-libc -y
apt install stm32flash dfu-util libnewlib-arm-none-eabi -y
apt install gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0 -y
apt install gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0-0 -y

#Make sure user pi has access to serial ports
usermod -a -G tty pi
6 changes: 3 additions & 3 deletions src/modules/mjpgstreamer/start_chroot_script
Original file line number Diff line number Diff line change
@@ -16,18 +16,18 @@ install_cleanup_trap
unpack /filesystem/home/pi /home/pi pi

apt update
apt install -y --allow-downgrades git cmake=3.13.4-1 cmake-data=3.13.4-1
apt install -y --allow-downgrades git cmake cmake-data
cd /home/pi
#mjpg-streamer
if [ "$MJPGSTREAMER_INCLUDE_MJPGSTREAMER" == "yes" ]
then
echo "--- Installing mjpg-streamer"
if [ $( is_in_apt libjpeg62-turbo-dev ) -eq 1 ]; then
apt-get -y --force-yes install libjpeg62-turbo-dev
elif [ $( is_in_apt libjpeg8-dev ) -eq 1 ]; then
elif [ $( is_in_apt libjpeg8-dev ) -eq 1 ]; then
apt-get -y --force-yes install libjpeg8-dev
fi

apt-get -y --allow-downgrades --allow-remove-essential --allow-change-held-packages --no-install-recommends install imagemagick ffmpeg libv4l-dev
gitclone MJPGSTREAMER_MJPGSTREAMER_REPO mjpg-streamer
pushd mjpg-streamer
9 changes: 9 additions & 0 deletions src/modules/releaseinfochange/start_chroot_script
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -xe

source /common.sh
install_cleanup_trap

apt update --allow-releaseinfo-change
apt full-upgrade --yes

0 comments on commit f9db381

Please sign in to comment.