Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use LXD_QEMU_FW_PATH, remove CSM, ship seabios-256k.bin #269

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 0 additions & 115 deletions patches/edk2-0007-force-CSM-boot-mode-for-bootorder.patch

This file was deleted.

58 changes: 0 additions & 58 deletions patches/seabios-0001-CSM-memory.patch

This file was deleted.

45 changes: 3 additions & 42 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,29 +286,6 @@ parts:
- lib/libdqlite*so*
- lib/*/libuv*

seabios:
source: https://gitlab.com/qemu-project/seabios
source-type: git
source-tag: rel-1.16.2
source-depth: 1
plugin: nil
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && exit 0
craftctl default
override-build: |-
[ "$(uname -m)" != "x86_64" ] && exit 0

patch -p1 < "${CRAFT_PROJECT_DIR}/patches/seabios-0001-CSM-memory.patch"

make clean distclean
echo "CONFIG_QEMU_HARDWARE=y" > .config
echo "CONFIG_CSM=y" >> .config
echo "CONFIG_BOOTSPLASH=n" >> .config
echo "CONFIG_SDCARD=n" >> .config
echo "CONFIG_ROM_SIZE=128" >> .config
make oldnoconfig V=1
make V=1 PYTHON=python3

edk2:
after:
- nasm
Expand Down Expand Up @@ -352,12 +329,6 @@ parts:
# revert "ArmVirtPkg: make EFI_LOADER_DATA non-executable" as it breaks almost everything
git revert 2997ae38739756ecba9b0de19e86032ebc689ef9
patch --binary -p1 < "${CRAFT_PROJECT_DIR}/patches/edk2-0006-disable-EFI-memory-attributes-protocol.patch"
patch --binary -p1 < "${CRAFT_PROJECT_DIR}/patches/edk2-0007-force-CSM-boot-mode-for-bootorder.patch"

# Setup CSM blob
if [ "$(uname -m)" = "x86_64" ]; then
cp ../../seabios/build/out/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin
fi

# Arch-specific logic
ARCH="X64"
Expand Down Expand Up @@ -410,23 +381,13 @@ parts:
# Create the firmware path
mkdir -p "${CRAFT_PART_INSTALL}/share/qemu/"

# Primary firmware (4MB, no CSM)
# Primary firmware (4MB)
build_edk2 \
"${CRAFT_PART_INSTALL}/share/qemu/OVMF_CODE.4MB.fd" \
"${CRAFT_PART_INSTALL}/share/qemu/OVMF_VARS.4MB.fd" \
RELEASE \
-DFD_SIZE_4MB

# Legacy firmware (4MB, CSM)
if [ "$(uname -m)" = "x86_64" ]; then
build_edk2 \
"${CRAFT_PART_INSTALL}/share/qemu/OVMF_CODE.4MB.CSM.fd" \
"${CRAFT_PART_INSTALL}/share/qemu/OVMF_VARS.4MB.CSM.fd" \
RELEASE \
-DFD_SIZE_4MB \
-DCSM_ENABLE=TRUE
fi

# Debug firmware (4MB, debug mode)
# Can be enabled with the LXD boot.debug_edk2 instance option
# Set DEBUG_VERBOSE flag
Expand Down Expand Up @@ -922,7 +883,7 @@ parts:
usr/local/lib/: lib/
usr/local/libexec/: bin/
usr/local/share/: share/
usr/share/seabios/bios-256k.bin: share/qemu/seabios.bin
usr/share/seabios/bios-256k.bin: share/qemu/bios-256k.bin
prime:
- bin/genisoimage*
- bin/mkisofs*
Expand All @@ -940,7 +901,7 @@ parts:
- share/qemu/s390-*.img*
- share/qemu/slof.bin*
- share/qemu/vgabios-*.bin*
- share/qemu/seabios.bin
- share/qemu/bios-256k.bin

qemu-ovmf-secureboot:
after:
Expand Down
2 changes: 1 addition & 1 deletion snapcraft/commands/daemon.start
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export LXD_EXEC_PATH="${SNAP_CURRENT}/bin/lxd"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:${SNAP_CURRENT}/lib:${SNAP_CURRENT}/lib/${ARCH}:${SNAP_CURRENT}/lib/${ARCH}/ceph"
export PATH="${PATH}:${SNAP_CURRENT}/bin"
export LXD_CLUSTER_UPDATE="${SNAP_CURRENT}/commands/refresh"
export LXD_OVMF_PATH="${SNAP_CURRENT}/share/qemu"
export LXD_QEMU_FW_PATH="${SNAP_CURRENT}/share/qemu"
export PYTHONPATH=/snap/lxd/current/lib/python3/dist-packages/

# Detect model
Expand Down
Loading