2019-04-28 18:06:44 +02:00

80 lines
2.1 KiB
Plaintext
Executable File

#platform=x86, AMD64, or Intel EM64T
#version=RHEL7
#
# Selected packages
#
%packages
@nethserver-iso
@core
@libreschool-iso
%end
repo --name=nethserver --baseurl=file:///run/install/repo/extras
repo --name=libreschool --baseurl=file:///run/install/repo/libreschool
# Install OS instead of upgrade
install
firewall --disable
# System language
lang en_US
# SELinux configuration
selinux --permissive
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=debug
%post --interpreter /bin/bash
exec 1>/root/kickstart-post.log 2>&1
echo "Enabling first-boot..."
touch /var/spool/first-boot
echo "Importing RPM GPG keys..."
rpm --import /etc/pki/rpm-gpg/*
echo "Enable nethserver units..."
systemctl enable nethserver-system-init
systemctl enable nethserver-config-network
systemctl disable NetworkManager firewalld
echo "Disable kdump..."
systemctl disable kdump
echo "Forcing system time to UTC ..."
sed -i 's/LOCAL/UTC/' /etc/adjtime
if [ -f /etc/nethserver-release ]; then
echo "Fix /etc/issue..."
cp -f /etc/nethserver-release /etc/issue
echo -e 'Kernel \\r on an \\m\n' >> /etc/issue
echo 'Access the web interface at the following URLs:' >> /etc/issue
ip -o -4 addr | tr -s ' /' $'\t' | cut -f 4 | grep -vF 127.0.0.1 | xargs -I IP -- echo https://IP:980 >> /etc/issue
echo >> /etc/issue
fi
echo "Renaming network interfaces"
TMPFILE=/tmp/9C358C31-BC02-4B63-BAAB-4D82DA0E297C
OUTFILE=/etc/udev/rules.d/70-persistent-net.rules
ip link show | grep 'link/ether' | sed 's/.*ether\ \([0-9a-fA-F:]*\)\ brd.*/\1/' > $TMPFILE
LINES=$(wc -l $TMPFILE)
# TODO: should be at least 2 lines
N=0
while read MAC ; do
if (( N > 1 )) ; then
NUM=$(( N-1 ))
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"${MAC}\", NAME=\"lan${NUM}\"" >> $OUTFILE
fi
if (( N == 1 )) ; then
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"${MAC}\", NAME=\"wan0\"" >> $OUTFILE
fi
if (( N == 0 )) ; then
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"${MAC}\", NAME=\"lan0\"" >> $OUTFILE
fi
N=$(( N + 1 ))
done < $TMPFILE
rm $TMPFILE
%end