SHA256
1
0
forked from pool/warewulf4

Accepting request 1161171 from home:eeich:branches:network:cluster

- Allow to install dnsmasq as an alternative to dhcp-server.
- Set minimum UID value for user UIDs to 1000 (boo#1221886).
- Make dependencies warewulf package version dependent. This
  helps to keep the resolver to mix different packages from
  different versions.
- On upgrade from older versions move files from
  `/usr/share/warewulf/overlays/` to
  `/var/lib/warewulf/overlays/*/rootfs/`

    the host overlays reside now under
    `/var/lib/warewulf/host/rootfs`
    show up in the rendered overlays.

OBS-URL: https://build.opensuse.org/request/show/1161171
OBS-URL: https://build.opensuse.org/package/show/network:cluster/warewulf4?expand=0&rev=65
This commit is contained in:
Christian Goll 2024-03-25 10:50:34 +00:00 committed by Git OBS Bridge
parent 7aee9f4d15
commit cea30a141f
3 changed files with 76 additions and 9 deletions

47
adjust_overlays.sh Normal file
View File

@ -0,0 +1,47 @@
#! /bin/sh
# when updating from an older version of the overlay package
# move added/modified overlay files to the new location.
error=0
src=/usr/share/warewulf/overlays
dst=/var/lib/warewulf/overlays
test -d $src || exit 0
for i in $(find -P $src -maxdepth 1 -mindepth 1 -type d)
do
d=$(basename -s "" $i)
if [ ! -d $dst/$d ]
then
mkdir -p /var/lib/warewulf/overlays/$d/rootfs || { error=1; continue; }
elif [ ! -d $dst/$d/rootfs ]
then
mkdir -p $dst/$d/rootfs || { error=1; continue; }
fi
for j in $(find -P $src/$d -not -type d)
do
D=$(dirname $j)
D=${D##$src/$d}
f=$(basename -s ".rpmsave" $j)
if [ ! -d $dst/$d/rootfs/$D ]
then
mkdir -p $dst/$d/rootfs/$D || { error=1; continue; }
fi
if [ ! -e $dst/$d/rootfs/$D/$f ]
then
mv $j $dst/$d/rootfs/$D/$f
elif [ ! -e $dst/$d/rootfs/$D/$f.rpmsave ]
then
mv $j $dst/$d/rootfs/$D/$f.rpmsave
else
error=1
fi
done
done
if [ $error -gt 0 ]
then
echo "Cannot copy all files - check $src manually" >&2
else
find -P $src -type d -delete
fi

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Fri Mar 22 20:23:04 UTC 2024 - Egbert Eich <eich@suse.com>
- Allow to install dnsmasq as an alternative to dhcp-server.
- Set minimum UID value for user UIDs to 1000 (boo#1221886).
- Make dependencies warewulf package version dependent. This
helps to keep the resolver to mix different packages from
different versions.
- On upgrade from older versions move files from
`/usr/share/warewulf/overlays/` to
`/var/lib/warewulf/overlays/*/rootfs/`
-------------------------------------------------------------------
Thu Feb 22 09:31:15 UTC 2024 - Christian Goll <cgoll@suse.com>
@ -11,10 +23,10 @@ Mon Feb 19 15:45:20 UTC 2024 - Christian Goll <cgoll@suse.com>
- updated to 4.5.0rc1 from upstream with following change:
* all overlays reside now under a `rootfs` diretory e.g.
the host overlays reside now under
/var/lib/warewulf/host/rootfs
`/var/lib/warewulf/host/rootfs`
This has the advantage that the `rootfs` can be under a version
control, without the effect that the meta files e.g. `.git` will
show up in the rendered overlays
show up in the rendered overlays.
- removed patches:
* clean-warewulf-conf.patch
* dnsmasq-template-move.patch

View File

@ -38,6 +38,7 @@ Source0: https://github.com/warewulf/warewulf/releases/download/v%{vers}%
#Source1: vendor.tar.gz
Source5: warewulf4-rpmlintrc
Source10: config-ww4.sh
Source11: adjust_overlays.sh
Source20: README.dnsmasq
# no firewalld in sle12
@ -58,10 +59,11 @@ BuildRequires: pkgconfig(gpgme)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%sysusers_requires
Requires: %{name}-overlay = %{version}
Requires: dhcp-server
Requires: ipxe-bootimgs
Requires: pigz
Requires: tftp
Requires: ( dhcp-server or dnsmasq )
Suggests: dhcp-server
Recommends: bash-completion
Recommends: ipmitool
Recommends: nfs-kernel-server
@ -77,7 +79,7 @@ manage thousands of compute resources.
%package overlay
# Smells like a circular dependcy, but needed in this case as the
# files belong to the warewulf user
Requires(pre): %{name}
Requires(pre): %{name} = %version
Summary: Default overlay for warewulf
Group: Productivity/Clustering/Computing
@ -85,7 +87,7 @@ Group: Productivity/Clustering/Computing
Includes the default overlays so that they can be updated seprately.
%package api
Requires: %{name}
Requires: %{name} = %version
Summary: Contains the services for the warewulf rest API
Conflicts: warewulf-provision-x86_64-initramfs
@ -94,9 +96,7 @@ Contains the binaries for the access of warewulf through a rest API and from
the commandline from an external host.
%package man
Supplements: %{name}
Provides: warewulf4-doc = %version
Obsoletes: warewulf4-doc < %version
Supplements: %{name} = %version
Summary: Warewulf4 Man Pages
BuildArch: noarch
@ -187,6 +187,8 @@ yq e '
.["container mounts"] += {"source": "/etc/zypp/credentials.d/SCCcredentials", "dest": "/etc/zypp/credentials.d/SCCcredentials", "readonly": true}' \
-i %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
#sed -i -e 's@\(^\s*\)\(.*:.*\):@\1"\2":@' %%{buildroot}%%{_sysconfdir}/warewulf/warewulf.conf
# SUSE starts user UIDs at 1000
sed -i -e 's@\(.* \$_UID \(>\|-ge\) \)500\(.*\)@\11000\3@' %{buildroot}%{_localstatedir}/lib/warewulf/overlays/host/rootfs/etc/profile.d/ssh_setup.*sh
# fix dhcp for SUSE
mv %{buildroot}%{_localstatedir}/lib/warewulf/overlays/host/rootfs/etc/dhcp/dhcpd.conf.ww %{buildroot}%{_localstatedir}/lib/warewulf/overlays/host/rootfs/etc/dhcpd.conf.ww
rmdir %{buildroot}%{_localstatedir}/lib/warewulf/overlays/host/rootfs/etc/dhcp
@ -197,6 +199,7 @@ echo "g warewulf -" >> system-user-%{name}.conf
%sysusers_generate_pre system-user-%{name}.conf %{name} system-user-%{name}.conf
install -D -m 644 system-user-%{name}.conf %{buildroot}%{_sysusersdir}/system-user-%{name}.conf
install -D -m 755 %{S:10} %{buildroot}%{_datadir}/warewulf/scripts/config-warewulf.sh
install -D -m 755 %{S:11} %{buildroot}%{_datadir}/warewulf/scripts/%{basename:S:11}
# get the slurm package ready
mkdir -p %{buildroot}%{_localstatedir}/lib/warewulf/overlays/host/rootfs/etc/slurm
@ -227,6 +230,9 @@ mv %{buildroot}/%{_sysconfdir}/warewulf/examples %{buildroot}%{_defaultdocdir}/%
%postun
%service_del_postun warewulfd.service
%posttrans overlay
%{_datadir}/warewulf/scripts/%{basename:S:11}
%files
%defattr(-,root,root)
%doc README.md
@ -242,6 +248,7 @@ mv %{buildroot}/%{_sysconfdir}/warewulf/examples %{buildroot}%{_defaultdocdir}/%
%{_defaultdocdir}/%{name}/example-templates
%{_prefix}/lib/firewalld/services/warewulf.xml
%exclude %{_datadir}/warewulf/overlays
%exclude %{_datadir}/warewulf/scripts/%{basename:S:11}
%{_bindir}/wwctl
%{_sbindir}/rcwarewulfd
%{_unitdir}/warewulfd.service
@ -267,6 +274,7 @@ mv %{buildroot}/%{_sysconfdir}/warewulf/examples %{buildroot}%{_defaultdocdir}/%
%{_localstatedir}/lib/warewulf/overlays
%dir %{_localstatedir}/lib/warewulf
%config(noreplace) %{_localstatedir}/lib/warewulf/overlays
%{_datadir}/warewulf/scripts/%{basename:S:11}
%exclude %{_localstatedir}/lib/warewulf/overlays/host/rootfs/etc/slurm
%exclude %{_localstatedir}/lib/warewulf/overlays/generic/rootfs/etc/slurm
%exclude %{_localstatedir}/lib/warewulf/overlays/generic/rootfs/etc/munge