Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: yaroslavborbat <[email protected]>
  • Loading branch information
yaroslavborbat committed Dec 25, 2024
1 parent d7b875c commit 15e1965
Showing 1 changed file with 45 additions and 21 deletions.
66 changes: 45 additions & 21 deletions images/virt-launcher/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
image: {{ $.ImageName }}
fromImage: base-alt-p11
fromCacheVersion: "02"
import:
# Before install stage.
# Add edk2-ovmf package
Expand All @@ -9,7 +10,7 @@ import:
to: /
before: install
includePaths:
- edk2-ovmf-20231115-alt1.noarch.rpm
- edk2-ovmf-20240811-alt2.noarch.rpm

# After install stage.
# Add libxcrypto library.
Expand Down Expand Up @@ -110,37 +111,38 @@ shell:
seabios \
libffi8 \
swtpm-tools \
libvirt-client==10.2.0-alt1 \
libvirt-daemon-driver-qemu==10.2.0-alt1 \
qemu-kvm-core==9.0.2-alt2
libvirt-client==10.7.0-alt1 \
libvirt-daemon-driver-qemu==10.7.0-alt1 \
qemu-kvm-core==9.1.2-alt1
- apt-get clean
- rm --recursive --force /var/lib/apt/lists/ftp.altlinux.org* /var/cache/apt/*.bin
install:
# Upgrade edk2-ovmf package to custom build and remove its package.
- |
rpm -Uv /edk2-ovmf-20231115-alt1.noarch.rpm
rm /edk2-ovmf-20231115-alt1.noarch.rpm
rpm -Uv /edk2-ovmf-20240811-alt2.noarch.rpm
rm /edk2-ovmf-20240811-alt2.noarch.rpm
# Restructure firware files in /usr/share/OVMF to mimic structure
# in edk2-ovmf package from the original kubevirt.
# mv OVMF_CODE_4M.fd OVMF_CODE.fd
# ln -s OVMF_CODE.fd OVMF_CODE.cc.fd
- |
cd /usr/share/OVMF
rm MICROVM.fd
rm OVMF.inteltdx.secboot.fd
rm OVMF_CODE.fd
rm OVMF_CODE.secboot.fd
rm -f MICROVM.fd
rm -f OVMF_CODE.fd
rm -f OVMF_CODE.secboot.fd
mv OVMF_CODE_4M.fd OVMF_CODE.cc.fd
rm OVMF_CODE_4M.qcow2
rm -f OVMF_CODE_4M.qcow2
mv OVMF_CODE_4M.secboot.fd OVMF_CODE.secboot.fd
rm OVMF_CODE_4M.secboot.qcow2
rm OVMF_VARS.fd
rm OVMF_VARS.ms.fd
rm OVMF_VARS.secboot.fd
rm -f OVMF_CODE_4M.secboot.qcow2
rm -f OVMF_VARS.fd
rm -f OVMF_VARS.ms.fd
rm -f OVMF_VARS.secboot.fd
mv OVMF_VARS_4M.fd OVMF_VARS.fd
rm OVMF_VARS_4M.ms.fd
rm OVMF_VARS_4M.ms.qcow2
rm OVMF_VARS_4M.qcow2
rm -f OVMF_VARS_4M.ms.fd
rm -f OVMF_VARS_4M.ms.qcow2
rm -f OVMF_VARS_4M.qcow2
mv OVMF_VARS_4M.secboot.fd OVMF_VARS.secboot.fd
rm OVMF_VARS_4M.secboot.qcow2
rm -f OVMF_VARS_4M.secboot.qcow2
ls -la
setup:
# Replace virt-launcher-monitor with the wrapper.
Expand Down Expand Up @@ -227,10 +229,11 @@ shell:
- gcc -shared -fPIC -DPIC -Wall -o liboverride.so override.c -ldl
- strip liboverride.so
---
# Note: edk2-ovmf==20231115 requires p11 AltLinux to build.
# Note: edk2-ovmf==20240811-alt2 requires p11 AltLinux to build.
image: {{ $.ImageName }}-edk2-builder
final: false
from: {{ $.Images.BASE_ALT_P11 }}
fromCacheVersion: "05"
git:
- add: /images/{{ $.ImageName }}/edk2
to: /edk2
Expand Down Expand Up @@ -264,7 +267,8 @@ shell:
dosfstools \
mtools \
qemu-img \
zlib-devel
zlib-devel \
wget
- apt-get clean
- rm --recursive --force /var/lib/apt/lists/ftp.altlinux.org* /var/cache/apt/*.bin

Expand All @@ -282,6 +286,26 @@ shell:
# Add DVP logo into SOURCES.
- cp /edk2/Logo.bmp /home/builder/RPM/SOURCES/

# ADD rhel patches
# old: wget https://yum.oracle.com/repo/OracleLinux/OL9/appstream/x86_64/getPackageSource/edk2-20231122-6.0.1.el9.src.rpm
# old: rpm2cpio edk2-20231122-6.0.1.el9.src.rpm > edk2.cpio
# old: cp 0025-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch /home/builder/RPM/SOURCES/
# old: sed -i '/^Patch1:/a Patch25: 0025-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch' /home/builder/RPM/SPECS/edk2.spec
# old: sed -i '/^%patch1 -p1/a %patch25 -p1' /home/builder/RPM/SPECS/edk2.spec
- |
mkdir /tmp/rhel-rpm
cd /tmp/rhel-rpm
wget https://mirror.stream.centos.org/9-stream/AppStream/source/tree/Packages/edk2-20241117-1.el9.src.rpm
rpm2cpio edk2-20241117-1.el9.src.rpm > edk2.cpio
cpio -id < edk2.cpio
find ./ -iname "*.patch" | while read p ; do
NAME=$(echo $p | sed 's!.patch!-rhel.patch!g')
cp $p /home/builder/RPM/SOURCES/$NAME
done
sed -i "/^%patch1 -p1/a for p in %{_sourcedir}/*-rhel.patch; do patch -p1 --force --verbose < \$p ; done" /home/builder/RPM/SPECS/edk2.spec
# Build RPMs. edk2 package prints a huge log with about 770k lines,
# we can keep only last 1k lines, it should be enough to get error
# context and troubleshoot it locally.
Expand Down

0 comments on commit 15e1965

Please sign in to comment.