Multiple installed kernels on silverblue

Hi,

I want to install a second kernel next to the standard fedora kernel (I do not want to replace it, in case I mess something up). rpm-ostree doesn’t seem to like that idea: error: Multiple subdirectories found in: usr/lib/modules Is it possible to have multiple kernels installed on fedora 32 sivlerblue?

Packaging a new kernel (re-compiled fedora kernel):

$ toolbox enter
$ export C_INCLUDE_PATH="/usr/include"
$ export QA_RPATHS=$(( 0x0001|0x0010|0x0002|0x0004|0x0008|0x0020 ))
$ sudo dnf install -y fedpkg fedora-packager rpmdevtools ncurses-devel pesign grubby qt-devel libXi-devel gcc-c++
$ fedpkg clone -a kernel 
$ cd kernel
$ sudo dnf builddep kernel.spec
$ git checkout -b my_branch origin/f32
$ sed -i 's/# define buildid .local/%define buildid .local/g' kernel.spec
$ sed -i s/"Name: kernel%{?variant}"/"Name: kernel-local%{?variant}"/g kernel.spec
$ make release
$ fedpkg local --arch x86_64 --without debug --without doc --without headers --without cross_headers --without perf --without debuginfo --without selftests --without pae --without tools --without bpftool --without zfcpdump --without ipaclones

Installing the new kernel (it runs fine with --dry-run):

$ sudo rpm-ostree install kernel-local-core-5.6.15-301.local.fc32.x86_64.rpm kernel-local-5.6.15-301.local.fc32.x86_64.rpm kernel-local-modules-5.6.15-301.local.fc32.x86_64.rpm
Checking out tree c393e79... done
Enabled rpm-md repositories: updates fedora-cisco-openh264 fedora
rpm-md repo 'updates' (cached); generated: 2020-05-31T02:52:37Z
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2020-03-17T20:10:45Z
rpm-md repo 'fedora' (cached); generated: 2020-04-22T22:22:36Z
Importing rpm-md... done
Resolving dependencies... done
Relabeling... done
Applying 5 overrides and 64 overlays
Processing packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
error: Multiple subdirectories found in: usr/lib/modules

/usr/lib/modules contains only the current fedora kernel modules:

$ ls /usr/lib/modules
5.6.14-300.fc32.x86_64
1 Like

Not a solution to your specific question but a possible alternative approach. You could pin your deployment: ostree admin pin 0 and then replace your kernel with rpm-ostree override replace <kernel packages>, restart, select the new deploment and pin that too?

This way you have 2 deployments with specific kernels/grub entries, the downside is that you need to upgrade them individually, pin the new deployment and unpin the old one.

1 Like

thank you, that sounds like a good alternative!

I am running into this same issue trying to install the ccrma kernel-rt packages on Fedora IoT 31.

[root@localhost ccrma]#  rpm-ostree install ./kernel-rt-5.4.19-200.rt11.1.fc31.ccrma.x86_64.rpm ./kernel-rt-modules-5.4.19-200.rt11.1.fc31.ccrma.x86_64.rpm ./kernel-rt-core-5.4.19-200.rt11.1.fc31.ccrma.x86_64.rpm
Checking out tree 50222fe... done
Enabled rpm-md repositories: updates-modular fedora-modular updates fedora planetccrma planetcore
rpm-md repo 'updates-modular' (cached); generated: 2020-08-05T01:53:28Z
rpm-md repo 'fedora-modular' (cached); generated: 2019-10-23T22:53:13Z
rpm-md repo 'updates' (cached); generated: 2020-08-11T13:17:02Z
rpm-md repo 'fedora' (cached); generated: 2019-10-23T22:52:47Z
rpm-md repo 'planetccrma' (cached); generated: 2020-06-10T22:14:25Z
rpm-md repo 'planetcore' (cached); generated: 2020-03-18T18:40:10Z
Importing rpm-md... done
Resolving dependencies... done
Checking out packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
error: Multiple subdirectories found in: usr/lib/modules

Doing the same with override replace ./<kernel> ./<kernel-core> ./<kernel-modules> have no effect, and the new compose just boot with the previous kernel.

Any hints how to get those packages installed?

Thank you

1 Like

Got it working, posting here if anybody needs to do the same thing:

PLANETCORE_REPO_URL="http://ccrma.stanford.edu/planetccrma/mirror/fedora/linux/planetcore/32/x86_64"
rpm-ostree override replace \
  --remove=kernel \
  --remove=kernel-core \
  --remove=kernel-modules \
  --install=${PLANETCORE_REPO_URL}/kernel-rt-5.6.19-300.rt10.2.fc32.ccrma.x86_64.rpm \
  --install=${PLANETCORE_REPO_URL}/kernel-rt-core-5.6.19-300.rt10.2.fc32.ccrma.x86_64.rpm \
  --install=${PLANETCORE_REPO_URL}/kernel-rt-modules-5.6.19-300.rt10.2.fc32.ccrma.x86_64.rpm \
  ${PLANETCORE_REPO_URL}/kernel-rt-5.6.19-300.rt10.2.fc32.ccrma.x86_64.rpm

the last line of the override replace statement is needed otherwise the command complains that you did not provide anything to replace. Just ignore the warning. After rebooting, I have my real time kernel.

The ostree admin pin X is also helpful if I want to keep both versions available

1 Like