From 81680e50bfdf412e91b9937a1c911e94fe697a7c9d56e79fafaddace1fef647b Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Thu, 26 Jan 2023 09:28:16 +0000 Subject: [PATCH] Accepting request 1060838 from home:danishprakash:branches:devel:microos - Reverts https://build.opensuse.org/request/show/1060361 Changes introduced to c/storage's storage.conf which adds a driver_priority attribute would break consumers of libcontainer-common as long as those packages are vendoring an older c/storage version. Instead of patching every consumer, we're reverting this change, until those packages have been updated downstream. [boo#1207509] OBS-URL: https://build.opensuse.org/request/show/1060838 OBS-URL: https://build.opensuse.org/package/show/devel:microos/libcontainers-common?expand=0&rev=14 --- libcontainers-common.changes | 10 ++++++++++ libcontainers-common.spec | 11 +++++++++++ storage.conf | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/libcontainers-common.changes b/libcontainers-common.changes index 40e262b..6d9eb3a 100644 --- a/libcontainers-common.changes +++ b/libcontainers-common.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Jan 25 10:01:49 UTC 2023 - Danish Prakash + +- Reverts https://build.opensuse.org/request/show/1060361 + Changes introduced to c/storage's storage.conf which adds + a driver_priority attribute would break consumers of libcontainer-common + as long as those packages are vendoring an older c/storage version. + Instead of patching every consumer, we're reverting this change, until + those packages have been updated downstream. [boo#1207509] + ------------------------------------------------------------------- Fri Jan 13 06:01:46 UTC 2023 - Danish Prakash diff --git a/libcontainers-common.spec b/libcontainers-common.spec index 361518b..245c95b 100644 --- a/libcontainers-common.spec +++ b/libcontainers-common.spec @@ -140,6 +140,17 @@ install -D -m 0644 common-%{commonver}/docs/containers.conf.5 %{buildroot}/%{_ma %post # Comment out ostree_repo if it's blank [boo#1189893] sed -i 's/ostree_repo = ""/\#ostree_repo = ""/g' %{_sysconfdir}/containers/storage.conf +# use btrfs storage driver if system storage is on btrfs +# For rootless it will fall back to overlay if btrfs is not working +# https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md#storage-table +if [ $1 -eq 1 ] ; then + for dir in %{_localstatedir}/lib/containers %{_localstatedir}/lib ; do + test "$(findmnt -o FSTYPE -l --target '$dir' | grep -v FSTYPE)" != "btrfs" && CONTAINERS_USE_BTRFS_DRIVER=0 + done + if [ "$CONTAINERS_USE_BTRFS_DRIVER" != "0" ]; then + sed -i 's/driver = "overlay"/driver = "btrfs"/g' %{_sysconfdir}/containers/storage.conf + fi +fi %files %dir %{_sysconfdir}/containers diff --git a/storage.conf b/storage.conf index 54023c6..6314abe 100644 --- a/storage.conf +++ b/storage.conf @@ -14,14 +14,14 @@ [storage] # Default Storage Driver, Must be set for proper operation. -# driver = "overlay" +driver = "overlay" # Temporary storage location runroot = "/run/containers/storage" # Priority list for the storage drivers that will be tested one # after the other to pick the storage driver if it is not defined. -driver_priority = ["btrfs", "overlay"] +# driver_priority = ["btrfs", "overlay"] # Primary Read/Write location of container storage # When changing the graphroot location on an SELINUX system, you must