two-images: construction reproductible de rocky10 et debian13 par Packer, test de démarrage syonad/two#53
Some checks failed
Tests / check (push) Failing after 39s
Some checks failed
Tests / check (push) Failing after 39s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
commit
fe401b9a12
18 changed files with 937 additions and 0 deletions
20
packer/scripts/clean.sh
Normal file
20
packer/scripts/clean.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
empty_dir () {
|
||||
[ -d "${1}" ] && find "${1}" -mindepth 1 -delete
|
||||
return 0
|
||||
}
|
||||
|
||||
for d in /mnt/var/cache/dnf /mnt/var/cache/yum /mnt/root/.ssh /mnt/tmp /mnt/var/tmp /mnt/var/lib/dhcp /mnt/var/lib/cloud; do
|
||||
empty_dir "${d}"
|
||||
done
|
||||
rm -f /mnt/root/.bash_history
|
||||
find /mnt/var/log ! -type d -delete
|
||||
find /mnt/etc/ssh -maxdepth 1 -name 'ssh_host_*' -delete
|
||||
if [ -f /mnt/etc/machine-id ]; then
|
||||
: > /mnt/etc/machine-id
|
||||
fi
|
||||
if [ -f /mnt/var/lib/dbus/machine-id ] && [ ! -L /mnt/var/lib/dbus/machine-id ]; then
|
||||
rm -f /mnt/var/lib/dbus/machine-id
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue