Group sections in function units

- first all system related tweaks
- second user creation
- last cleanup
This commit is contained in:
Mark Verlinde 2021-06-29 22:05:05 +02:00
parent 1a521a0bb2
commit 437e7dd0e2

View File

@ -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