forked from pool/warewulf4
Accepting request 1063651 from home:mslacken:pr
- added CreateMt-Targets.patch which moonts in resolv.conf and files for SCC registration - added config-ww4.sh which is used for initial configuration for simple network setups - use distro ipxe binaries instead of binaries blobs from the warewulf github repo OBS-URL: https://build.opensuse.org/request/show/1063651 OBS-URL: https://build.opensuse.org/package/show/network:cluster/warewulf4?expand=0&rev=25
This commit is contained in:
parent
01b11d7da4
commit
d9c7514951
1004
CreateMt-Targets.patch
Normal file
1004
CreateMt-Targets.patch
Normal file
File diff suppressed because it is too large
Load Diff
71
config-ww4.sh
Normal file
71
config-ww4.sh
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Configure warewulf with the primary network of the host
|
||||||
|
WW4CONF=/etc/warewulf/warewulf.conf
|
||||||
|
|
||||||
|
# Get the mask from prefix
|
||||||
|
cdr2mask()
|
||||||
|
{
|
||||||
|
# Number of args to shift, 255..255, first non-255 byte, zeroes
|
||||||
|
set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
|
||||||
|
[ $1 -gt 1 ] && shift $1 || shift
|
||||||
|
echo ${1-0}.${2-0}.${3-0}.${4-0}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get the ip4 address of the netork
|
||||||
|
network_address() {
|
||||||
|
declare address prefix_length
|
||||||
|
IFS=/ read address prefix_length <<< "$1"
|
||||||
|
|
||||||
|
declare -a octets
|
||||||
|
IFS=. read -a octets <<< "$address"
|
||||||
|
|
||||||
|
declare mask
|
||||||
|
mask=$( printf "%08x" $(( (1 << 32) - (1 << (32 - prefix_length)) )) )
|
||||||
|
|
||||||
|
declare -i i
|
||||||
|
for i in {0..3}; do octets[$i]=$(( octets[i] & 16#${mask:2*i:2} )); done
|
||||||
|
|
||||||
|
echo $( IFS=.; echo "${octets[*]}" )
|
||||||
|
}
|
||||||
|
echo "-- WW4 CONFIGURAION $* --"
|
||||||
|
|
||||||
|
# Make sure that a ip address was defined for out network so that
|
||||||
|
# we can configure dhcpd correctly
|
||||||
|
IP4CIDR=`ip addr | awk '/scope global/ {print $2;exit}'`
|
||||||
|
IP4=${IP4CIDR%/*}
|
||||||
|
IP4PREFIX=${IP4CIDR#*/}
|
||||||
|
IP4MASK=$(cdr2mask $IP4PREFIX)
|
||||||
|
IP4NET=$(network_address "$IP4/$IP4PREFIX")
|
||||||
|
|
||||||
|
if [ "$IP4PREFIX" -gt 25 ] ; then
|
||||||
|
echo "ERROR: warewulf does at least a /25 network for dynamic addresses"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DYNSIZE=20
|
||||||
|
DYNSTART=${IP4#*.*.*.}
|
||||||
|
DYNPRE=${IP4%.*}
|
||||||
|
DYNEND=$(( $DYNSTART + $DYNSIZE ))
|
||||||
|
if [ $DYNEND -gt 254 ] ; then
|
||||||
|
DYNEND=$(( $IPNET + 2 + $DYNSIZE ))
|
||||||
|
DYNSTART=$(( $IPNET + 2 ))
|
||||||
|
fi
|
||||||
|
DYNSTART="${DYNPRE}.${DYNSTART}"
|
||||||
|
DYNEND="${DYNPRE}.${DYNEND}"
|
||||||
|
|
||||||
|
|
||||||
|
if [ -e $WW4CONF ] ; then
|
||||||
|
test -n $IP4 && sed -i 's/^ipaddr:.*/ipaddr: '$IP4'/' $WW4CONF
|
||||||
|
test -n $IP4MASK && sed -i 's/^netmask:.*/netmask: '$IP4MASK'/' $WW4CONF
|
||||||
|
test -n $IP4NET && sed -i 's/^network:.*/network: '$IP4NET'/' $WW4CONF
|
||||||
|
test -n $DYNSTART && sed -i 's/^ range start:.*/ range start: '$DYNSTART'/' $WW4CONF
|
||||||
|
test -n $DYNEND && sed -i 's/^ range end:.*/ range end: '$DYNEND'/' $WW4CONF
|
||||||
|
cat << EOF
|
||||||
|
ipaddr: $IP4
|
||||||
|
netmask: $IP4MASK
|
||||||
|
network: $IP4NET
|
||||||
|
range start: $DYNSTART
|
||||||
|
range end: $DYNEND
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
@ -1,7 +1,17 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 7 15:34:13 UTC 2023 - Christian Goll <cgoll@suse.com>
|
||||||
|
|
||||||
|
- added CreateMt-Targets.patch
|
||||||
|
which moonts in resolv.conf and files for SCC registration
|
||||||
|
- added config-ww4.sh which is used for initial configuration for
|
||||||
|
simple network setups
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jan 24 11:17:32 UTC 2023 - Christian Goll <cgoll@suse.com>
|
Tue Jan 24 11:17:32 UTC 2023 - Christian Goll <cgoll@suse.com>
|
||||||
|
|
||||||
- added make-ipxe-binary-source-configureable.patch
|
- added make-ipxe-binary-source-configureable.patch
|
||||||
|
- use distro ipxe binaries instead of binaries blobs from the
|
||||||
|
warewulf github repo
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jan 19 11:13:58 UTC 2023 - Christian Goll <cgoll@suse.com>
|
Thu Jan 19 11:13:58 UTC 2023 - Christian Goll <cgoll@suse.com>
|
||||||
|
@ -30,7 +30,9 @@ URL: https://warewulf.org
|
|||||||
Source0: https://github.com/hpcng/warewulf/archive/v%{version}%{?rls_cndt}.tar.gz#/warewulf4-v%{version}.tar.gz
|
Source0: https://github.com/hpcng/warewulf/archive/v%{version}%{?rls_cndt}.tar.gz#/warewulf4-v%{version}.tar.gz
|
||||||
Source1: vendor.tar.gz
|
Source1: vendor.tar.gz
|
||||||
Source3: warewulf4-rpmlintrc
|
Source3: warewulf4-rpmlintrc
|
||||||
|
Source10: config-ww4.sh
|
||||||
Patch1: make-ipxe-binary-source-configureable.patch
|
Patch1: make-ipxe-binary-source-configureable.patch
|
||||||
|
Patch2: CreateMt-Targets.patch
|
||||||
|
|
||||||
# no firewalld in sle12
|
# no firewalld in sle12
|
||||||
%if 0%{?sle_version} >= 150000 || 0%{?suse_version} > 1500
|
%if 0%{?sle_version} >= 150000 || 0%{?suse_version} > 1500
|
||||||
@ -42,6 +44,7 @@ BuildRequires: golang-packaging
|
|||||||
BuildRequires: libgpgme-devel
|
BuildRequires: libgpgme-devel
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: munge
|
BuildRequires: munge
|
||||||
|
BuildRequires: suse-release
|
||||||
BuildRequires: sysuser-tools
|
BuildRequires: sysuser-tools
|
||||||
BuildRequires: tftp
|
BuildRequires: tftp
|
||||||
BuildRequires: yq
|
BuildRequires: yq
|
||||||
@ -51,7 +54,6 @@ Requires: %{name}-overlay = %{version}
|
|||||||
Recommends: dhcp-server
|
Recommends: dhcp-server
|
||||||
Recommends: ipmitool
|
Recommends: ipmitool
|
||||||
Recommends: ipxe-bootimgs
|
Recommends: ipxe-bootimgs
|
||||||
Recommends: ipxe-bootimgs
|
|
||||||
Recommends: nfs-kernel-server
|
Recommends: nfs-kernel-server
|
||||||
Recommends: tftp
|
Recommends: tftp
|
||||||
|
|
||||||
@ -146,7 +148,9 @@ yq e '
|
|||||||
.tftp.ipxe."00:00" = "undionly.kpxe" |
|
.tftp.ipxe."00:00" = "undionly.kpxe" |
|
||||||
.tftp.ipxe."00:07" = "ipxe-x86_64.efi" |
|
.tftp.ipxe."00:07" = "ipxe-x86_64.efi" |
|
||||||
.tftp.ipxe."00:09" = "ipxe-x86_64.efi" |
|
.tftp.ipxe."00:09" = "ipxe-x86_64.efi" |
|
||||||
.tftp.ipxe."00:0B" = "snp-arm64.efi"'\
|
.tftp.ipxe."00:0B" = "snp-arm64.efi" |
|
||||||
|
.["container mounts"] += {"source": "/etc/SUSEConnect", "dest": "/etc/SUSEConnect", "readonly": true} |
|
||||||
|
.["container mounts"] += {"source": "/etc/zypp/credentials.d/SCCcredentials", "dest": "/etc/zypp/credentials.d/SCCcredentials", "readonly": true}' \
|
||||||
-i %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
|
-i %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
|
||||||
sed -i 's@\(^\s*\)\(.*:.*\):@\1"\2":@' %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
|
sed -i 's@\(^\s*\)\(.*:.*\):@\1"\2":@' %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
|
||||||
|
|
||||||
@ -155,6 +159,7 @@ echo "u warewulf -" > system-user-%{name}.conf
|
|||||||
echo "g warewulf -" >> system-user-%{name}.conf
|
echo "g warewulf -" >> system-user-%{name}.conf
|
||||||
%sysusers_generate_pre system-user-%{name}.conf %{name} 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 644 system-user-%{name}.conf %{buildroot}%{_sysusersdir}/system-user-%{name}.conf
|
||||||
|
install -D -m 755 %{S:10} %{buildroot}%{_datadir}/warewulf/scripts/config-warewulf.sh
|
||||||
|
|
||||||
# get the slurm package readay
|
# get the slurm package readay
|
||||||
mkdir -p %{buildroot}%{_datadir}/warewulf/overlays/host/etc/slurm
|
mkdir -p %{buildroot}%{_datadir}/warewulf/overlays/host/etc/slurm
|
||||||
@ -174,6 +179,7 @@ EOF
|
|||||||
|
|
||||||
%post
|
%post
|
||||||
%service_add_post warewulfd.service
|
%service_add_post warewulfd.service
|
||||||
|
%{_datadir}/warewulf/scripts/config-warewulf.sh
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%service_del_preun warewulfd.service
|
%service_del_preun warewulfd.service
|
||||||
@ -201,6 +207,7 @@ EOF
|
|||||||
%{_sbindir}/rcwarewulfd
|
%{_sbindir}/rcwarewulfd
|
||||||
%{_unitdir}/warewulfd.service
|
%{_unitdir}/warewulfd.service
|
||||||
%{_sysusersdir}/system-user-%{name}.conf
|
%{_sysusersdir}/system-user-%{name}.conf
|
||||||
|
%{_datadir}/warewulf/scripts
|
||||||
|
|
||||||
%files overlay
|
%files overlay
|
||||||
# The configuration files in this location are for the compute
|
# The configuration files in this location are for the compute
|
||||||
|
Loading…
Reference in New Issue
Block a user