2023-07-12 10:18:51 +02:00
|
|
|
#
|
|
|
|
# spec file for package sdbootutil
|
|
|
|
#
|
|
|
|
# Copyright (c) 2023 SUSE LLC
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%define nvr %{name}-%{version}-%{release}
|
|
|
|
%if 0%{?_build_in_place}
|
|
|
|
%define git_version %(git log '-n1' '--date=format:%Y%m%d' '--no-show-signature' "--pretty=format:+git%cd.%h")
|
|
|
|
BuildRequires: git-core
|
|
|
|
%else
|
|
|
|
# this is required for obs' source validator. It's
|
|
|
|
# 20-files-present-and-referenced ignores all conditionals. So the
|
|
|
|
# definition of git_version actually happens always.
|
|
|
|
%define git_version %{nil}
|
|
|
|
%endif
|
|
|
|
Name: sdbootutil
|
2023-10-12 17:02:35 +02:00
|
|
|
Version: 1+git20231005.890f70c%{git_version}
|
2023-07-12 10:18:51 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: script to install shim with sd-boot
|
|
|
|
License: MIT
|
|
|
|
URL: https://en.opensuse.org/openSUSE:Usr_merge
|
|
|
|
Source: %{name}-%{version}.tar
|
2023-10-19 10:02:53 +02:00
|
|
|
Requires: efibootmgr
|
2023-07-12 10:18:51 +02:00
|
|
|
Requires: jq
|
|
|
|
Requires: sed
|
2023-07-28 22:20:05 +02:00
|
|
|
Requires: systemd-boot
|
|
|
|
Supplements: (systemd-boot and shim)
|
2023-10-19 10:02:53 +02:00
|
|
|
Requires: (%{name}-snapper if (snapper and btrfsprogs))
|
2023-07-12 10:18:51 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Hook scripts to install shim along with systemd-boot
|
|
|
|
|
|
|
|
%package snapper
|
|
|
|
Summary: plugin script for snapper
|
|
|
|
Requires: %{name} = %{version}
|
|
|
|
Requires: btrfsprogs
|
|
|
|
Requires: sdbootutil >= %{version}-%{release}
|
|
|
|
Requires: snapper
|
|
|
|
|
|
|
|
%description snapper
|
|
|
|
Plugin scripts for snapper to handle BLS config files
|
|
|
|
|
|
|
|
%package rpm-scriptlets
|
2023-09-20 14:19:16 +02:00
|
|
|
Summary: Scripts to create boot entries on kernel updates
|
|
|
|
Requires: sdbootutil >= %{version}-%{release}
|
2023-07-28 22:20:05 +02:00
|
|
|
# make sure to not replace scriptlets with nops on systems that
|
|
|
|
# use grub2
|
|
|
|
Conflicts: grub2
|
2023-07-12 10:18:51 +02:00
|
|
|
Conflicts: suse-kernel-rpm-scriptlets
|
|
|
|
Provides: suse-kernel-rpm-scriptlets
|
2023-07-28 22:20:05 +02:00
|
|
|
Obsoletes: %{name}-filetriggers < %{version}
|
2023-07-12 10:18:51 +02:00
|
|
|
|
|
|
|
%description rpm-scriptlets
|
2023-09-20 14:19:16 +02:00
|
|
|
Scriptlets that call sdbootutil to create boot entries when
|
|
|
|
kernels are installed or removed
|
2023-07-12 10:18:51 +02:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
|
|
|
install -D -m 755 sdbootutil %{buildroot}%{_bindir}/sdbootutil
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{_prefix}/lib/module-init-tools/kernel-scriptlets
|
2023-07-28 22:20:05 +02:00
|
|
|
for a in rpm; do
|
|
|
|
install -m 755 "$a-script" %{buildroot}%{_prefix}/lib/module-init-tools/kernel-scriptlets
|
|
|
|
for b in post posttrans postun pre preun; do
|
|
|
|
ln -s "$a-script" %{buildroot}%{_prefix}/lib/module-init-tools/kernel-scriptlets/$a-$b
|
|
|
|
done
|
|
|
|
done
|
|
|
|
for a in cert inkmp kmp; do
|
2023-07-12 10:18:51 +02:00
|
|
|
for b in post posttrans postun pre preun; do
|
|
|
|
ln -s /bin/true %{buildroot}%{_prefix}/lib/module-init-tools/kernel-scriptlets/$a-$b
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
# snapper
|
|
|
|
install -d -m755 %{buildroot}%{_prefix}/lib/snapper/plugins
|
|
|
|
for i in 10-sdbootutil.snapper; do
|
|
|
|
install -m 755 $i %{buildroot}%{_prefix}/lib/snapper/plugins/$i
|
|
|
|
done
|
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%{_bindir}/sdbootutil
|
|
|
|
|
|
|
|
%files rpm-scriptlets
|
|
|
|
%dir %{_prefix}/lib/module-init-tools
|
|
|
|
%{_prefix}/lib/module-init-tools/*
|
|
|
|
|
|
|
|
%files snapper
|
|
|
|
%dir %{_prefix}/lib/snapper
|
|
|
|
%dir %{_prefix}/lib/snapper/plugins
|
|
|
|
%{_prefix}/lib/snapper/plugins/*
|
|
|
|
|
|
|
|
%changelog
|