fix networking

This commit is contained in:
Pratham Patel 2023-07-28 14:51:09 +05:30
parent 89f9916261
commit 971ac727c9
No known key found for this signature in database

View File

@ -2,6 +2,9 @@
%post %post
# Setup networking temporarily
echo "nameserver 1.1.1.1" > /etc/resolv.conf
# The script that expands root partition # The script that expands root partition
[ -d /usr/local/bin ] || mkdir --verbose /usr/local/bin [ -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 expand-rootfs.sh curl 'https://git.resf.org/thefossguy/rocky-linux-generic-images/raw/branch/r9/scripts/expand-rootfs.sh' --output expand-rootfs.sh
@ -14,6 +17,9 @@ rpm --rebuilddb
# Remove 'ifcfg-link' on generated images # Remove 'ifcfg-link' on generated images
rm -v -f /etc/sysconfig/network-scripts/ifcfg-link 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 # The 'machine-id' needs to be unique for each machine so remove ours to prevent duplication
rm -v -f /etc/machine-id rm -v -f /etc/machine-id
touch /etc/machine-id touch /etc/machine-id