coreos / rpm-ostree

⚛📦 Hybrid image/package system with atomic upgrades and package layering
https://coreos.github.io/rpm-ostree
Other
874 stars 196 forks source link

Cannot upgrade Silverblue when kernel-debug-core is layered #2120

Open mildred opened 4 years ago

mildred commented 4 years ago

Host system details

$ sudo rpm-ostree status
State: idle
Deployments:
● ostree://fedora:fedora/32/x86_64/silverblue
                   Version: 32.20200528.0 (2020-05-28T01:22:03Z)
                BaseCommit: 0574a6a0da357c4ebade7b07455726eb8295e1b92526cf45bdff613157768871
                 StateRoot: fedora-workstation
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: ansible baobab bcc-tools bpftool bpftrace bwrap-oci cheese docker-compose exfat-utils ffmpeg-libs fuse-exfat fuse-zip git git-gui
                            gitk gnome-boxes gnome-screenshot gnome-tweak-tool gstreamer-plugins-bad gstreamer1-libav hledger htop hugin iotop jq
                            kernel-debug kernel-debuginfo libcgroup-tools moby-engine mplayer mumble mumble-overlay mumble-plugins murmur neovim net-tools
                            nmap oathtool pass picocom powertop qemu-user-static smartmontools stow strace systemtap tcpdump thunderbird totem
                            tuned-utils-systemtap virt-manager weston zsh
             LocalPackages: rpmfusion-nonfree-release-32-1.noarch gnunet-0.11.6-11568312256.fc30.x86_64 rpmfusion-free-release-32-1.noarch
                            keybase-4.4.1.20190910185008.b5f8897c2a-1.x86_64

  ostree://0574a6a0da357c4ebade7b07455726eb8295e1b92526cf45bdff613157768871
                   Version: 32.20200528.0 (2020-05-28T01:22:03Z)
                 StateRoot: guest
$ cat /etc/os-release
NAME=Fedora
VERSION="32.20200528.0 (Silverblue)"
ID=fedora
VERSION_ID=32
VERSION_CODENAME=""
PLATFORM_ID="platform:f32"
PRETTY_NAME="Fedora 32.20200528.0 (Silverblue)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:32"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora-silverblue/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=32
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=32
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Silverblue"
VARIANT_ID=silverblue
OSTREE_VERSION='32.20200528.0'
$ rpm -q ostree rpm-ostree
ostree-2020.3-4.fc32.x86_64
rpm-ostree-2020.2-3.fc32.x86_64
$ ls -l /usr/lib/modules
total 0
drwxr-xr-x. 1 root root 752  1 janv.  1970 5.6.14-300.fc32.x86_64
drwxr-xr-x. 1 root root 716  1 janv.  1970 5.6.14-300.fc32.x86_64+debug
$ rpm -qf /usr/lib/modules/5.6.14-300.fc32.x86_64+debug
kernel-debug-core-5.6.14-300.fc32.x86_64

Expected vs actual behavior

# rpm-ostree update
...
error: Multiple subdirectories found in: usr/lib/modules
```
# rpm-ostree update
⠚ Receiving objects: 99% (8680/8692) 624,9 ko/s 346,2 Mo 
Receiving objects: 99% (8680/8692) 624,9 ko/s 346,2 Mo... done
Checking out tree 47ba12a... done
Enabled rpm-md repositories: fedora-cisco-openh264 keybase rpmfusion-free-updates-testing rpmfusion-free rpmfusion-nonfree-updates-testing rpmfusion-nonfree updates updates-debuginfo fedora fedora-debuginfo refi64-bluecap
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2020-03-17T20:10:45Z
Updating metadata for 'keybase'... done
rpm-md repo 'keybase'; generated: 2020-05-27T20:39:57Z
Updating metadata for 'rpmfusion-free-updates-testing'... done
rpm-md repo 'rpmfusion-free-updates-testing'; generated: 2020-06-03T00:43:32Z
Updating metadata for 'rpmfusion-free'... done
rpm-md repo 'rpmfusion-free'; generated: 2020-04-24T17:27:23Z
Updating metadata for 'rpmfusion-nonfree-updates-testing'... done
rpm-md repo 'rpmfusion-nonfree-updates-testing'; generated: 2020-06-03T01:14:45Z
Updating metadata for 'rpmfusion-nonfree'... done
rpm-md repo 'rpmfusion-nonfree'; generated: 2020-04-24T17:52:12Z
rpm-md repo 'updates' (cached); generated: 2020-06-05T01:26:33Z
Updating metadata for 'updates-debuginfo'... done
rpm-md repo 'updates-debuginfo'; generated: 2020-06-05T00:55:18Z
rpm-md repo 'fedora' (cached); generated: 2020-04-22T22:22:36Z
Updating metadata for 'fedora-debuginfo'... done
rpm-md repo 'fedora-debuginfo'; generated: 2020-04-22T22:18:03Z
Updating metadata for 'refi64-bluecap'... done
rpm-md repo 'refi64-bluecap'; generated: 2020-06-05T06:09:36Z
Importing rpm-md... done
Resolving dependencies... done
Will download: 36 packages (675,5 Mo)
Downloading from 'updates-debuginfo'... done
Downloading from 'updates'... done
Importing packages... 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
```

Expected:

# rpm-ostree update
Success!

Steps to reproduce it

layer the kernel-debug-core package, it creates files in /usr/lib/modules/5.6.14-300.fc32.x86_64+debug, and as a consequence there are multiple directories in /usr/lib/modules and rpm-ostee complains around this code:

https://github.com/coreos/rpm-ostree/blob/65156cb1b7fcb4420c9402f66ca0fc96340c0878/src/libpriv/rpmostree-kernel.c#L111-L151

Would you like to work on the issue?

Maybe although I don't know much about the code, I might not get the correct solution for it.

mildred commented 4 years ago

rpm-ostree update --uninstall=kernel-debug --uninstall=kernel-debuginfo is working around the issue, but I needed those packages for seccomp development.