From 437e7dd0e23d2a740d13fb40739d8da58f1b5aac Mon Sep 17 00:00:00 2001 From: Mark Verlinde Date: Tue, 29 Jun 2021 22:05:05 +0200 Subject: [PATCH] Group sections in function units - first all system related tweaks - second user creation - last cleanup --- Rocky8_Rpi4.ks | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Rocky8_Rpi4.ks b/Rocky8_Rpi4.ks index f5e2ce4..acba5e7 100644 --- a/Rocky8_Rpi4.ks +++ b/Rocky8_Rpi4.ks @@ -58,26 +58,17 @@ aarch64-img-extra-config # Post install scripts: %post -# Remove ifcfg-link on pre generated images -rm -f /etc/sysconfig/network-scripts/ifcfg-link - -# Remove machine-id on pre generated images -rm -f /etc/machine-id -touch /etc/machine-id - -# Apparently kickstart user was not working, attempt to do it here? -/sbin/useradd -c "Rocky Linux default user" -u 1000 -G wheel -m -U rocky -echo "rockylinux" | passwd --stdin rocky - - -# Ensure no ssh keys are present -rm -f /etc/ssh/*_key* - cat > /boot/cmdline.txt << EOF console=ttyAMA0,115200 console=tty1 root= rootfstype=ext4 elevator=deadline rootwait EOF +# Run this once to fix the wifi: +sed -i 's/boardflags3=0x48200100/boardflags3=0x44200100/g' /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt + +# Apparently kickstart user was not working, attempt to do it here? +/sbin/useradd -c "Rocky Linux default user" -u 1000 -G wheel -m -U rocky +echo "rockylinux" | passwd --stdin rocky mkdir -p /home/rocky chown 1000:1000 /home/rocky @@ -116,10 +107,6 @@ EOF chown 1000 /home/rocky/README -# Run this once to fix the wifi: -sed -i 's/boardflags3=0x48200100/boardflags3=0x44200100/g' /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt - - # Add rpi-kernel repo: cat >/etc/yum.repos.d/Rocky_Rpi_kernel.repo << 'EOF' @@ -139,5 +126,16 @@ enabled=1 EOF +# Cleanup before shipping an image + +# Remove ifcfg-link on pre generated images +rm -f /etc/sysconfig/network-scripts/ifcfg-link + +# Remove machine-id on pre generated images +rm -f /etc/machine-id +touch /etc/machine-id + +# Ensure no ssh keys are present +rm -f /etc/ssh/*_key* %end