Skip to content

Commit

Permalink
Compile custom .dtb file for use in testing
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Jun 22, 2024
1 parent 7f14f13 commit 0b8a332
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
sudo add-apt-repository ppa:canonical-server/server-backports
sudo apt-get update
sudo apt-get install --yes gnupg xz-utils expect systemd-container qemu-user-static qemu-utils qemu-system-arm
echo "::set-output name=imagexz::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_armhf_latest" -s -L -I -o /dev/null -w '%{url_effective}')")"
echo "::set-output name=image::$(echo "$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_armhf_latest" -s -L -I -o /dev/null -w '%{url_effective}')")" | sed -e 's/.xz//')"
echo "imagexz=$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_armhf_latest" -s -L -I -o /dev/null -w '%{url_effective}')")" >> $GITHUB_OUTPUT
echo "image=$(echo "$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_armhf_latest" -s -L -I -o /dev/null -w '%{url_effective}')")" | sed -e 's/.xz//')" >> $GITHUB_OUTPUT
- name: Cache Raspberry Pi OS 32bit image
uses: actions/cache@v4
with:
Expand Down
13 changes: 13 additions & 0 deletions tests/image.bash
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ if [[ $1 == "setup" ]]; then
echo "set enable-bracketed-paste off" >> tests/fs/etc/inputrc # Prevents weird character output
cp tests/fs/boot/kernel* tests/kernel
cp tests/fs/boot/*.dtb tests/dtb
# Compile a customized DTB
git clone https://github.com/raspberrypi/utils.git
# Get utilities
cmake utils/dtmerge
make
sudo make install
cp ../tests/dtb/bcm2710-rpi-3-b.dtb custom.dtb
# (dtparam=uart0=on)
dtmerge custom.dtb merged.dtb - uart0=on
mv merged.dtb custom.dtb
# (dtoverlay=disable-bt)
dtmerge custom.dtb merged.dtb /boot/firmware/overlays/disable-bt.dtbo
mv merged.dtb custom.dtb
imageFile "umount" "$3"
elif [[ $1 == "copy-logs" ]]; then
imageFile "mount" "$2"
Expand Down
2 changes: 1 addition & 1 deletion tests/run.exp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set timeout -1
set loginUser "pi"
set loginPassword "raspberry"

spawn qemu-system-aarch64 -machine "raspi3b" -cpu arm1176 -m 1G -drive "format=raw,file=raspios.img" -dtb "./tests/dtb/bcm2710-rpi-3-b.dtb" -kernel "./tests/kernel/kernel8.img" -append "loglevel=0 quiet console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait init=/bin/bash" -nographic -serial mon:stdio
spawn qemu-system-aarch64 -machine "raspi3b" -cpu arm1176 -m 1G -drive "format=raw,file=raspios.img" -dtb "./custom.dtb" -kernel "./tests/kernel/kernel8.img" -append "loglevel=0 quiet console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait init=/bin/bash" -nographic -serial mon:stdio

# Setup user
expect "root@(none):/# "
Expand Down

0 comments on commit 0b8a332

Please sign in to comment.