forked from pool/warewulf4
- updated to 4.5.5 with following changes: * mount `/sys` and `/run` on `wwctl container exec` to enabled SUSEConnect (bsc#1227289) * don't want on NIS style passwd line (bsc#1227250) * wwctl impoer can have `passwd` and `user` argument (bsc#1227340) * add net.ifnames=1 to default kernel parameters (bsc#1226654) - removed wwctl-configure-all-calls-SSH-keys.patch as included upstream - added following not yet accepted upstream patches: * empty-container.patch * enhanced-cont-list.patch * fix-overlay-built.patch * oci-vars.patch * issue-motd.patch OBS-URL: https://build.opensuse.org/request/show/1186422 OBS-URL: https://build.opensuse.org/package/show/network:cluster/warewulf4?expand=0&rev=79
48 lines
1.0 KiB
Bash
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
|
|
|