warewulf4/adjust_overlays.sh
Christian Goll 70b45730b3 - Update to version 4.6.0rc3 what is a major upgrade with following
highlights:
  * renamed container to images
  * "sprig" functions in overlays
  * support for yaml and json formatted output
  * completely re-designed kernel selection support
  * nested profiles
  * arbitrary node and profile data in new "resources" structure
  * moved NFS mount options to resources / fstab overlay
  * split overlays by function
  * split overlays, site vs distribution
  * replaced defaults.conf with settings on default profile
  * improved tabular output
  * parallel overlay build
  * improved networking functionality (static route, vlans, and bonds)
  * kernel arguments as a list
  * non-zero exit codes on wwctl errors
  * fixed argument parsing for wwctl image exec
  * Defined menu for ipxe boot
  * Re-order SSH key types to make ed25519 default.
- The configuation files nodes.conf and warewulf.conf will be updated
  on upgrade and the unmodified configuration files will be saved 
  as nodes.conf.4.5.x and warewulf.conf.4.5.x

OBS-URL: https://build.opensuse.org/package/show/network:cluster/warewulf4?expand=0&rev=99
2025-02-25 18:44:20 +00:00

48 lines
1.0 KiB
Bash

#! /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