Skip to content

Commit f0b0da7

Browse files
committed
Import MNT build from josch
1 parent dd5de9c commit f0b0da7

File tree

10 files changed

+93
-35
lines changed

10 files changed

+93
-35
lines changed

.github/workflows/test-build.yml

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,11 @@ jobs:
4444
fail-fast: false
4545
matrix:
4646
host_release:
47-
- bookworm
4847
- trixie
4948
extra_classes:
50-
- ""
51-
- "GRML_GHACI_CLOUD"
49+
- "REFORM"
5250
arch:
53-
- amd64
5451
- arm64
55-
exclude:
56-
- host_release: bookworm
57-
extra_classes: "GRML_GHACI_CLOUD"
58-
- arch: arm64
59-
host_release: bookworm
60-
- arch: arm64
61-
extra_classes: "GRML_GHACI_CLOUD"
6252

6353
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
6454
steps:
@@ -81,19 +71,19 @@ jobs:
8171
path: |
8272
results-initial/*
8373
84-
- run: ./test/gha-build-iso.sh build-only-twice
85-
name: "Repack ISO twice on ${{matrix.host_release}} ${{matrix.arch}}${{matrix.extra_classes && format(' with {0}', matrix.extra_classes) || ''}}"
86-
env:
87-
HOST_RELEASE: ${{matrix.host_release}}
88-
EXTRA_CLASSES: ${{matrix.extra_classes}}
89-
ARCH: ${{matrix.arch}}
74+
# - run: ./test/gha-build-iso.sh build-only-twice
75+
# name: "Repack ISO twice on ${{matrix.host_release}} ${{matrix.arch}}${{matrix.extra_classes && format(' with {0}', matrix.extra_classes) || ''}}"
76+
# env:
77+
# HOST_RELEASE: ${{matrix.host_release}}
78+
# EXTRA_CLASSES: ${{matrix.extra_classes}}
79+
# ARCH: ${{matrix.arch}}
9080

91-
- name: Archive repacked ISO
92-
if: always()
93-
uses: actions/upload-artifact@v4
94-
with:
95-
name: grml-live-build-result-repack-${{matrix.host_release}}-${{matrix.arch}}${{matrix.extra_classes && format('-{0}', matrix.extra_classes) || ''}}
96-
if-no-files-found: error
97-
retention-days: 15
98-
path: |
99-
results-build-only-second/*
81+
# - name: Archive repacked ISO
82+
# if: always()
83+
# uses: actions/upload-artifact@v4
84+
# with:
85+
# name: grml-live-build-result-repack-${{matrix.host_release}}-${{matrix.arch}}${{matrix.extra_classes && format('-{0}', matrix.extra_classes) || ''}}
86+
# if-no-files-found: error
87+
# retention-days: 15
88+
# path: |
89+
# results-build-only-second/*

build-driver/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ def install_debian_dependencies():
303303
git ,
304304
curl ,
305305
dosfstools ,
306+
e2fsprogs ,
307+
fdisk ,
306308
jo ,
307309
mmdebstrap ,
308310
moreutils ,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Section "Device"
2+
Identifier "eDP-1"
3+
Driver "modesetting"
4+
Option "kmsdev" "/dev/dri/card0"
5+
Option "AccelMethod" "glamor"
6+
Option "Atomic" "On"
7+
EndSection
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Package: *
2+
Pin: origin "reform.debian.net"
3+
Pin-Priority: 999

config/files/REFORM/etc/apt/sources.list.d/.gitkeep

Whitespace-only changes.

config/package_config/REFORM

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PACKAGES skip
2+
linux-image-arm64
3+
4+
PACKAGES install
5+
reform-tools
6+
linux-image-mnt-reform-arm64
7+
linux-headers-mnt-reform-arm64
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
set -eu
3+
fcopy -M -v /etc/X11/xorg.conf.d/etnaviv.conf

grml-live

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,8 @@ else
986986
fi
987987
fi
988988

989+
ls -la "$BUILD_OUTPUT/boot/dtbs/"
990+
989991
# we need to set "$BOOTID" before we invoke adjust_boot_files for the
990992
# first time, being inside grub_setup below
991993
if [ -n "$NO_BOOTID" ] ; then
@@ -1058,6 +1060,10 @@ else
10581060

10591061
mkdir -p "${BUILD_OUTPUT}"/boot/addons
10601062

1063+
mkdir -p "${BUILD_OUTPUT}"/boot/extlinux
1064+
cp "${TEMPLATE_DIRECTORY}"/boot/extlinux/extlinux.conf "${BUILD_OUTPUT}"/boot/extlinux/
1065+
adjust_boot_files "${BUILD_OUTPUT}"/boot/extlinux/extlinux.conf
1066+
10611067
if [ "$ARCH" != "arm64" ] ; then
10621068
# copy _required_ isolinux files
10631069
mkdir -p "${BUILD_OUTPUT}"/boot/isolinux
@@ -1476,7 +1482,7 @@ generate_build_info() {
14761482

14771483
# ISO_OUTPUT - mkisofs {{{
14781484
[ -n "$ISO_OUTPUT" ] || ISO_OUTPUT="$OUTPUT/grml_isos"
1479-
[ -n "$ISO_NAME" ] || ISO_NAME="${GRML_NAME}_${VERSION}.iso"
1485+
[ -n "$ISO_NAME" ] || ISO_NAME="${GRML_NAME}_${VERSION}.img"
14801486

14811487
BOOT_ARGS="-no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -isohybrid-mbr ${CHROOT_OUTPUT}/usr/lib/ISOLINUX/isohdpfx.bin"
14821488
EFI_ARGS="-eltorito-alt-boot -e boot/efi.img -no-emul-boot -isohybrid-gpt-basdat"
@@ -1515,14 +1521,20 @@ else
15151521

15161522
cap_timestamps "$BUILD_OUTPUT"
15171523

1518-
log "$MKISOFS -V '${GRML_NAME} ${VERSION}' -publisher 'grml-live | grml.org' -l -r -J $BOOT_ARGS $EFI_ARGS -o ${ISO_OUTPUT}/${ISO_NAME} ."
1519-
einfo "Generating ISO file..."
1520-
touch -d @"$SOURCE_DATE_EPOCH" "$BUILD_OUTPUT"/
1521-
# shellcheck disable=SC2086 # BOOT_ARGS and EFI_ARGS need splitting
1522-
$MKISOFS -V "${GRML_NAME} ${VERSION}" -publisher 'grml-live | grml.org' \
1523-
-l -r -J $BOOT_ARGS $EFI_ARGS \
1524-
-o "${ISO_OUTPUT}/${ISO_NAME}" "$BUILD_OUTPUT"/ ; RC=$?
1525-
eend $RC
1524+
einfo "Generating ext4 disk image..."
1525+
/sbin/mke2fs -q -F -o Linux -E offset=16777216 -T ext4 -b 4096 -d "$BUILD_OUTPUT"/ "${ISO_OUTPUT}/${ISO_NAME}" 260000
1526+
eend $?
1527+
einfo "Resizing disk image to make space for MBR..."
1528+
truncate --size=+512 "${ISO_OUTPUT}/${ISO_NAME}"
1529+
eend $?
1530+
einfo "Making MBR ..."
1531+
MBRTMP=$(mktemp)
1532+
echo 'label: dos
1533+
start=32768, size=2080000, type=83' > "$MBRTMP"
1534+
cat "$MBRTMP"
1535+
/sbin/sfdisk "${ISO_OUTPUT}/${ISO_NAME}" < "$MBRTMP"
1536+
eend $?
1537+
rm -f "$MBRTMP"
15261538

15271539
# do not continue on errors, otherwise we might generate/overwrite the ISO with dd if=... stuff
15281540
if [ "$RC" != 0 ] ; then
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
default l0
2+
menu title Grml Live Linux
3+
prompt 0
4+
timeout 50
5+
6+
label l0
7+
menu label Grml Live Linux
8+
linux /boot/%SHORT_NAME%/vmlinuz
9+
initrd /boot/%SHORT_NAME%/initrd.img
10+
fdtdir /boot/%SHORT_NAME%/dtbs/
11+
append ro no_console_suspend cryptomgr.notests \${bootargs} fbcon=font:TER16x32 console=tty1 boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID%
12+

test/gha-build-iso.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ cat >build-gha-ci-test-config-initial <<EOT
1818
last_release: "2024.12"
1919
EOT
2020

21+
mkdir -p config/files/REFORM/etc/apt/sources.list.d/
22+
/usr/lib/apt/apt-helper \
23+
download-file \
24+
https://reform.debian.net/reform_trixie.sources \
25+
config/files/REFORM/etc/apt/sources.list.d/reform_trixie.sources \
26+
"SHA1:3d453dbf355beebf494ce6f61d2110b98e92fcf5"
27+
2128
run_build() {
2229
local config_filename
2330
config_filename=$1
@@ -32,7 +39,22 @@ run_build() {
3239
&& git config --global --add safe.directory /source \
3340
&& /source/build-driver/build /source ${build_mode} /source/${config_filename} ghaci $ARCH testing"
3441

42+
/usr/lib/apt/apt-helper \
43+
download-file \
44+
https://source.mnt.re/reform/reform-boundary-uboot/-/jobs/artifacts/2024-07-19/raw/imx8mq-mnt-reform2-flash.bin?job=build \
45+
flash.bin \
46+
"SHA1:60ecf649038ebd92bfb6676bdf746daa30825dbf"
47+
3548
sudo chmod -R a+rX results
49+
sudo chmod -R a+rwX results/grml_isos
50+
51+
( set -e ; cd results &&
52+
name=$(echo ./grml_isos/*.iso)
53+
imgname=${name//.iso/.img}
54+
dd if=../flash.bin of="${name}" oseek=66 bs=512 conv=notrunc
55+
mv "${name}" "${imgname}"
56+
)
57+
rm flash.bin
3658
sudo mv results "${results_directory}"
3759
}
3860

0 commit comments

Comments
 (0)