Skip to content

Commit 5508056

Browse files
committed
Reserch
1 parent 0a0e5c4 commit 5508056

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

.github/workflows/check-stage3.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@ jobs:
4747
echo "TAG_EXISTS=false" >> $GITHUB_ENV
4848
fi
4949
50+
- name: ROM Cache
51+
if: env.TAG_EXISTS == 'false'
52+
id: ipxe-rom
53+
uses: actions/cache@v5
54+
with:
55+
path: pxe
56+
key: ipxe-rom
57+
58+
- name: Get working version of iPXE pcbios ROM
59+
if: env.TAG_EXISTS == 'false' && steps.ipxe-rom.outputs.cache-hit != 'true'
60+
run: |
61+
sudo apt update && sudo apt install git make gcc binutils perl liblzma-dev mtools
62+
git clone --depth 1 https://github.com/ipxe/ipxe.git
63+
mkdir -p pxe
64+
cd ipxe
65+
echo "#define DOWNLOAD_PROTO_HTTPS" >> src/config/local/general.h
66+
make -C src bin/virtio-net.rom bin/virtio-net.pxe -j4
67+
cp src/bin/virtio-net.rom ../pxe
68+
cp src/bin/virtio-net.pxe ../pxe
69+
5070
test:
5171
runs-on: ubuntu-latest
5272
needs: generate
@@ -66,14 +86,25 @@ jobs:
6686
- name: Checkout Repository
6787
uses: actions/checkout@v7
6888

89+
- name: ROM Cache
90+
uses: actions/cache@v5
91+
with:
92+
fail-on-cache-miss: true
93+
path: pxe
94+
key: ipxe-rom
95+
6996
- name: Initialize QEMU and System Dependencies
7097
run: |
71-
sudo apt-get update
72-
sudo apt-get install -y qemu-system-x86 ovmf
98+
sudo apt update && sudo apt install -y qemu-system-x86 ovmf
7399
sudo chmod 666 /dev/kvm
100+
ls -l /usr/share/qemu/firmware/ /usr/lib/ipxe/qemu/ /usr/share/qemu/ /usr/share/seabios /usr/lib/ipxe/ || true
101+
# in pcbios mode we override the rom used (q35 machine), ignoring efi since it is throwaway
102+
[[ "${{ matrix.mode }}" == "pcbios" ]] && sudo cp pxe/virtio-net.rom /usr/lib/ipxe/qemu/efi-virtio.rom
74103
[[ "${{ matrix.mode }}" == "efi" ]] && sudo ln -s /usr/share/OVMF /usr/share/edk2-ovmf || true
75104
[[ "${{ matrix.mode }}" == "efi" ]] && sudo ln -s /usr/share/edk2-ovmf/OVMF_CODE_4M.fd /usr/share/edk2-ovmf/OVMF_CODE.fd || true
76105
[[ "${{ matrix.mode }}" == "efi" ]] && sudo ln -s /usr/share/edk2-ovmf/OVMF_VARS_4M.fd /usr/share/edk2-ovmf/OVMF_VARS.fd || true
106+
#sudo apt install -y strace
107+
#strace -e trace=openat qemu-system-x86_64 -enable-kvm -M q35 -m 256 -nographic -nic user,model=virtio,tftp=.,bootfile=notthisfile.ipxe 2>&1 | grep -E "virtio|rom"
77108
78109
- name: Restore Work Directory Cache
79110
uses: actions/cache@v5

run_test_published_auto.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -o pipefail
23
[[ -d pxe ]] || mkdir -p pxe
34
if [[ ! -f pxe/online_boot.ipxe ]]; then
45
minimal_latest_json=$(curl -s "https://api.github.com/repos/NiKiZe/Gentoo-iPXE/releases/latest")
@@ -71,6 +72,12 @@ QEMU_RUN_PID=$!
7172

7273
line=$(sed 's/\x1b\[[0-9;]*[mKHP]//g' <<< "$line")
7374
case "$line" in
75+
"Could not boot image:"* | \
76+
"No more network devices"* | \
77+
"No bootable device."*)
78+
echo "❌ FAIL $line"
79+
exit 1
80+
;;
7481
*" -- Open Source Network Boot Firmware -- https://ipxe.org"*)
7582
IPXE=$(grep -o "iPXE [0-9.+ a-fg()]*[^ -]" <<< "$line")
7683
declare -p IPXE >> $ENV_FILE

0 commit comments

Comments
 (0)