diff --git a/.dockerignore b/.dockerignore index 987626ca..395d457b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,7 +4,6 @@ Readme.md Makefile .github/ .git/ -.git* dist dist.zip out/ diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6c867d29..20c9bcc8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,12 +21,15 @@ jobs: run: make dist - uses: sigstore/gh-action-sigstore-python@v2.1.1 with: - inputs: dist.zip + inputs: out/uefi.zip + - uses: sigstore/gh-action-sigstore-python@v2.1.1 + with: + inputs: out/sdcard.img - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: dist.zip* + file: out/* file_glob: true tag: ${{ github.ref }} overwrite: true diff --git a/Dockerfile b/Dockerfile index 53ad70fc..22bda4be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,5 +29,37 @@ RUN bash build.sh # Final artifact output -FROM scratch -COPY --from=builder /build/Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd /RPI_EFI.fd +FROM scratch as dist +WORKDIR / +COPY --from=builder /build/Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd . +COPY --from=builder /build/rpi-firmware/boot/fixup4.dat . +COPY --from=builder /build/rpi-firmware/boot/start4.elf . +COPY --from=builder /build/rpi-firmware/boot/bcm2711-rpi-4-b.dtb . +COPY --from=builder /build/rpi-firmware/boot/bcm2711-rpi-cm4.dtb . +COPY --from=builder /build/rpi-firmware/boot/bcm2711-rpi-400.dtb . +COPY --from=builder /build/rpi-firmware/boot/overlays overlays +COPY --from=builder /build/firmware firmware +COPY config.txt . + + +FROM ubuntu:22.04 AS image-build +RUN apt-get update && apt-get install -y \ + dosfstools \ + mtools \ + zip + +WORKDIR /sdcard/files +COPY --from=dist / /sdcard/files + +WORKDIR /sdcard + +RUN fallocate -l 64M sdcard.img && \ + mkfs.vfat -F 32 sdcard.img && \ + mcopy -i sdcard.img files/* :: && \ + mdir -i sdcard.img :: + +RUN zip -r uefi.zip files/* + +FROM scratch as image +COPY --from=image-build /sdcard/sdcard.img . +COPY --from=image-build /sdcard/uefi.zip . diff --git a/Makefile b/Makefile index 4b4a3871..a0771eeb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: all -all: dist +all: build .PHONY: init init: @@ -9,19 +9,3 @@ init: .PHONY: build build: init docker buildx build --progress=plain . -o out --no-cache - -.PHONY: dist -dist: init build - mkdir -p dist - cp out/* dist/ - cp rpi-firmware/boot/fixup4.dat dist/ - cp rpi-firmware/boot/start4.elf dist/ - cp rpi-firmware/boot/bcm2711-rpi-4-b.dtb dist/ - cp rpi-firmware/boot/bcm2711-rpi-cm4.dtb dist/ - cp rpi-firmware/boot/bcm2711-rpi-400.dtb dist/ - cp -rf rpi-firmware/boot/overlays dist/ - mkdir -p dist/firmware - cp -rf firmware/* dist/firmware/ - cp config.txt dist/ - zip -r dist.zip dist - diff --git a/Readme.md b/Readme.md index ffbe3b55..ea7e521a 100644 --- a/Readme.md +++ b/Readme.md @@ -1,11 +1,15 @@ # ComputeBlade/CM4 optimized UEFI Firmware Images > [!CAUTION] -> ** THE CONFIGURATION IS PROBABLY NOT SANE FOR ALL USERS ** +> THE CONFIGURATION IS PROBABLY NOT SANE FOR ALL USERS. This is a fork of the amazing [pftf/RPi4](https://github.com/pftf/RPi4) project, which brings a UEFI images for the RaspberryPi 4 Model B. # Adaptations compared to the pftf/RPi4 proejct +## Adjustments +- server-workload oriented -> limit GPU mem to 64MB +- overclock ComputeModule 4 to 2.0GHz + ## Ease of use improvements - Allow easy local builds using `make dist` diff --git a/build.sh b/build.sh index 8e07828d..80039732 100644 --- a/build.sh +++ b/build.sh @@ -29,5 +29,3 @@ build -a AARCH64 -t GCC5 -b RELEASE \ --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor=L"${PROJECT_URL}" \ --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString=L"UEFI Firmware ${VERSION}" \ ${BUILD_FLAGS} ${DEFAULT_KEYS} - -cp Build/RPi4/RELEASE_GCC5/FV/RPI_EFI.fd . diff --git a/config.txt b/config.txt index 12489f44..719690f4 100644 --- a/config.txt +++ b/config.txt @@ -18,3 +18,8 @@ dtoverlay=tpm-slb9670 dtparam=i2c_arm=on dtoverlay=i2c-rtc,ds3231 dtparam=sd=off + +[cm4] +over_voltage=6 +arm_freq=2000 +gpu_mem=64