Switch x86_64 to EFI boot mode

This commit is contained in:
Albrecht Lohofener
2025-01-20 20:36:33 +01:00
parent 07dc31458a
commit 40deb4bce0
3 changed files with 8 additions and 3 deletions
+4
View File
@@ -46,8 +46,10 @@ ARG OPENWRT_ROOTFS_TAR
RUN echo "Building for platform '$TARGETPLATFORM'" \
&& if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
CPU_ARCH="x86_64"; \
APK_EXTRA="ovmf"; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
CPU_ARCH="aarch64"; \
APK_EXTRA=""; \
else \
echo "Error: CPU architecture $TARGETPLATFORM is not supported"; \
exit 1; \
@@ -69,6 +71,7 @@ RUN echo "Building for platform '$TARGETPLATFORM'" \
openssh-client \
util-linux-misc \
iproute2 \
"$APK_EXTRA" \
# It seems that PROFINET packages are not forwarded correctly without the package iproute2. The reason is unknown. \
&& mkdir -p /usr/share/novnc \
&& wget https://github.com/novnc/noVNC/archive/refs/tags/v${NOVNC_VERSION}.tar.gz -O /tmp/novnc.tar.gz -q \
@@ -117,6 +120,7 @@ RUN echo "Building for platform '$TARGETPLATFORM'" \
&& if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
SSH_PORT=1022; \
qemu-system-x86_64 -M pc -nographic -nodefaults -m 256 \
-bios /usr/share/ovmf/bios.bin \
-blockdev driver=raw,node-name=hd0,cache.direct=on,file.driver=file,file.filename=/var/vm/squashfs-combined-${OPENWRT_VERSION}.img \
-device virtio-blk-pci,drive=hd0 \
-device virtio-net,netdev=qlan0 -netdev user,id=qlan0,net=192.168.1.0/24,hostfwd=tcp::$SSH_PORT-192.168.1.1:22 \
+3 -2
View File
@@ -23,7 +23,7 @@ if [[ $DISABLE_OPENWRT_AUTO_UPGRADE != "true" ]]; then
if [ $CPU_ARCH = "aarch64" ]; then
qemu_command="qemu-system-aarch64 -M virt -bios /usr/share/qemu/edk2-aarch64-code.fd"
else
qemu_command="qemu-system-x86_64 -M pc"
qemu_command="qemu-system-x86_64 -M pc -bios /usr/share/ovmf/bios.bin"
fi
# Boot a temporary OpenWrt
@@ -105,5 +105,6 @@ if [[ $DISABLE_OPENWRT_AUTO_UPGRADE != "true" ]]; then
info "squashfs-combined-${OPENWRT_IMAGE_ID}.img is up to date. Nothing to do."
fi
else
info "OpenWrt upgrade check is disabled. Using squashfs-combined-${OPENWRT_IMAGE_ID}.img. Nothing to do."
OLD_SQUASHFS_COMBINED=`cat /storage/old_version`
info "OpenWrt upgrade check is disabled. Using "$OLD_SQUASHFS_COMBINED". Nothing to do."
fi
+1 -1
View File
@@ -175,7 +175,7 @@ attach_pci_device () {
if [ $CPU_ARCH = "aarch64" ]; then
CPU_ARGS="-M virt -bios /usr/share/qemu/edk2-aarch64-code.fd -vga none -device ramfb"
else
CPU_ARGS="-M pc -vga std"
CPU_ARGS="-M pc -bios /usr/share/ovmf/bios.bin -vga std"
fi
# Check KVM