Hello community, here is the log from the commit of package katacontainers for openSUSE:Factory checked in at 2019-08-09 16:52:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/katacontainers (Old) and /work/SRC/openSUSE:Factory/.katacontainers.new.9556 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "katacontainers" Fri Aug 9 16:52:27 2019 rev:2 rq:721681 version:1.9.0~alpha0 Changes: -------- --- /work/SRC/openSUSE:Factory/katacontainers/katacontainers.changes 2019-08-05 13:40:41.704393824 +0200 +++ /work/SRC/openSUSE:Factory/.katacontainers.new.9556/katacontainers.changes 2019-08-09 16:52:30.129481381 +0200 @@ -1,0 +2,6 @@ +Fri Aug 2 16:27:09 UTC 2019 - Marco Vedovati <mvedov...@suse.com> + +- Set the kernel version in the configuration files according to the one + specified in the initrd image name. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ katacontainers.spec ++++++ --- /var/tmp/diff_new_pack.BOkqUf/_old 2019-08-09 16:52:30.989481175 +0200 +++ /var/tmp/diff_new_pack.BOkqUf/_new 2019-08-09 16:52:30.989481175 +0200 @@ -1,7 +1,7 @@ # # spec file for package katacontainers # -# Copyright (c) 2018 SUSE LLC +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,10 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + # %define kata_project github.com/kata-containers @@ -37,9 +40,9 @@ %define configQEMU %{_datarootdir}/defaults/kata-containers/configuration-qemu.toml %ifarch x86_64 # Note: braces used for bash brace expansion -%define configFiles \{%{configACRN},%{configFC},%{configNEMU},%{configQEMU}\} +%define defaultConfigFiles \{%{configACRN},%{configFC},%{configNEMU},%{configQEMU}\} %else -%define configFiles %{configQEMU} +%define defaultConfigFiles %{configQEMU} %endif Name: katacontainers @@ -62,8 +65,13 @@ %else BuildRequires: go = 1.11 %endif -Requires: kernel-kvmsmall Requires: katacontainers-image-initrd = %{version} +Requires: kernel-kvmsmall +# Requires: are also required for build, to correctly detect the kernel +# version to use +BuildRequires: katacontainers-image-initrd = %{version} +BuildRequires: kernel-kvmsmall +# Required for build to correctly detect the kernel version to use %ifarch x86_64 Requires: qemu-x86 Recommends: firecracker @@ -126,10 +134,10 @@ install # Using initrd, so delete the image config line -sed -i -E -e '/^image =/d' %{buildroot}/%{configFiles} +sed -i -E -e '/^image =/d' %{buildroot}/%{defaultConfigFiles} -# Set libexec dir properly -sed -i -E -e 's,/usr/libexec,%{_libexecdir},' %{buildroot}/%{configFiles} +# Properly set libexec path +sed -i -E -e 's,/usr/libexec,%{_libexecdir},' %{buildroot}/%{defaultConfigFiles} cd $HOME/go/src/%{kata_project}/proxy make \ @@ -180,9 +188,12 @@ %post %service_add_post kata-ksm-throttler.service %service_add_post kata-vc-throttler.service -# Set config to use the latest kvmsmall kernel installed -latestKvmSmall=$(find /boot -name "vmlinuz-*-kvmsmall" | sort | tail -n 1) -sed -i -E -e "s,^kernel =.*$,kernel = \"${latestKvmSmall}\"," %{configFiles} +# Set config to use a matching kernel and initrd version. This is done in %post, +# so that it is using whatever versions the user has installed on its system. +kversion=$(readlink "%{_datarootdir}/kata-containers/kata-containers-initrd.img" | sed -E -e "s,^.*kata-containers-initrd-(.+).img,\1,") +[ -n "${kversion}" ] || { echo "Failed to detect the initrd kernel version"; exit -1; } +ln -sf "/boot/vmlinuz-${kversion}" "%{_datarootdir}/kata-containers/vmlinuz" +sed -i -E -e "s,^kernel =.*$,kernel = \"%{_datarootdir}/kata-containers/vmlinuz\"," %{defaultConfigFiles} %preun %service_del_preun kata-ksm-throttler.service @@ -204,7 +215,7 @@ %{_libexecdir}/kata-containers/kata-netmon %{_bindir}/kata-collect-data.sh # Manpages -# Configs +# Default configs %dir %{_datarootdir}/defaults %dir %{_datarootdir}/defaults/kata-containers %doc %{_datarootdir}/defaults/kata-containers/configuration-qemu.toml