From b56ecb6717fec6429daab803521b1ce51cac1c2e Mon Sep 17 00:00:00 2001 From: Sayan Paul Date: Wed, 8 Feb 2023 15:45:43 +0530 Subject: [PATCH] fix: Enable sysroot ro migration on installation Added check to start service only for rpm-ostree build Resolves: rhbz#2167344 Signed-off-by: Sayan Paul --- ostree-readonly-sysroot-migration.service | 1 + ostree.spec | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ostree-readonly-sysroot-migration.service b/ostree-readonly-sysroot-migration.service index 67915f7..e702f31 100644 --- a/ostree-readonly-sysroot-migration.service +++ b/ostree-readonly-sysroot-migration.service @@ -2,6 +2,7 @@ Description=Read-Only Sysroot Migration Documentation=https://ostreedev.github.io/ostree ConditionPathExists=!/var/lib/.ostree-readonly-sysroot +ConditionPathExists=/run/ostree-booted RequiresMountsFor=/sysroot /boot ConditionPathIsReadWrite=/sysroot diff --git a/ostree.spec b/ostree.spec index aa394f8..1cdcfa3 100644 --- a/ostree.spec +++ b/ostree.spec @@ -8,7 +8,7 @@ Summary: Tool for managing bootable, immutable filesystem trees Name: ostree Version: 2022.6 -Release: 2%{?dist} +Release: 3%{?dist} Source0: https://github.com/ostreedev/%{name}/releases/download/v%{version}/libostree-%{version}.tar.xz Source1: ostree-readonly-sysroot-migration Source2: ostree-readonly-sysroot-migration.service @@ -114,6 +114,8 @@ env NOCONFIGURE=1 ./autogen.sh %install install -m 644 -D %{SOURCE2} %{buildroot}/usr/lib/systemd/system/ostree-readonly-sysroot-migration.service install -m 755 -D %{SOURCE1} %{buildroot}/usr/libexec/ostree-readonly-sysroot-migration +install -dm0755 %{buildroot}%{_unitdir}/multi-user.target.wants/ +ln -sf ../ostree-readonly-sysroot-migration.service %{buildroot}%{_unitdir}/multi-user.target.wants/ %make_install INSTALL="install -p -c" find %{buildroot} -name '*.la' -delete @@ -146,6 +148,7 @@ find %{buildroot} -name '*.la' -delete %{_libexecdir}/libostree/* %{_prefix}/lib/systemd/system/ostree-readonly-sysroot-migration.service %{_libexecdir}/ostree-readonly-sysroot-migration +%{_unitdir}/multi-user.target.wants/ostree-readonly-sysroot-migration.service %files libs %{_sysconfdir}/ostree @@ -175,6 +178,9 @@ find %{buildroot} -name '*.la' -delete %endif %changelog +* Thu Feb 9 2023 Sayan Paul - 2022.6-3 +- Resolves: rhbz#2167344 + * Wed Dec 14 2022 Sayan Paul - 2022.6-2 - Resolves: rhbz#2060976