31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
%include bootloader-stuff.ksi
|
|
|
|
%post
|
|
|
|
# Setup networking temporarily
|
|
[ -f /etc/resolv.conf ] || echo "nameserver 1.1.1.1" > /etc/resolv.conf
|
|
|
|
# The script that expands root partition
|
|
[ -d /usr/local/bin ] || mkdir --verbose /usr/local/bin
|
|
curl 'https://git.resf.org/thefossguy/rocky-linux-generic-images/raw/branch/r9/scripts/expand-rootfs.sh' --output /usr/local/bin/expand-rootfs.sh
|
|
[ -f /usr/local/bin/expand-rootfs.sh ] && \
|
|
chmod --verbose +x /usr/local/bin/expand-rootfs.sh
|
|
|
|
# Remove 'ifcfg-link' on generated images
|
|
rm -v -f /etc/sysconfig/network-scripts/ifcfg-link
|
|
|
|
# Remove the temporary 'resolv.conf' file
|
|
rm -v -f /etc/resolv.conf
|
|
|
|
# The 'machine-id' needs to be unique for each machine so remove ours to prevent duplication
|
|
rm -v -f /etc/machine-id
|
|
touch /etc/machine-id
|
|
|
|
# Like 'machine-id', the 'random-seed' must be generated by the machine on its own
|
|
rm -v -f /var/lib/systemd/random-seed
|
|
|
|
# Remove the RPM database, let it be re-created when the image boots for the first time
|
|
rm -v -f /var/lib/rpm/__db*
|
|
|
|
%end
|