...
 
Commits (2)
set -ex
SERIAL_SPEED=9600
grep -q pontos /etc/hostname && SERIAL_SPEED=115200
export LANG=C.UTF-8
cat > /etc/apt/sources.list <<EOF
......@@ -12,21 +15,28 @@ EOF
PATH=/usr/sbin:$PATH
apt update
tasksel install standard
apt install -yy locales ssh initramfs-tools linux-image-amd64 xfsprogs lvm2 vim
apt install -yy locales ssh initramfs-tools linux-image-amd64 xfsprogs lvm2 \
vim git ethtool dlocate
if grep -q pheme /etc/hostname; then
apt install -yy firmware-bnx2
fi
export DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive
echo "Europe/Prague" > /etc/timezone
rm -f /etc/localtime || true
dpkg-reconfigure tzdata
for ETH in $(ip link | grep ^[0-9]*: | cut -d: -f2 | grep -v lo); do
cat >> /etc/network/interfaces.d/${ETH} <<EOF
auto $ETH
allow-hotplug $ETH
iface $ETH inet dhcp
iface $ETH inet6 dhcp
# setup network
apt remove -yy ifupdown
cat > /etc/systemd/network/dhcp.network <<EOF
[Match]
Name=en*
[Network]
DHCP=yes
EOF
ls /etc/network/interfaces.d
done
systemctl enable systemd-networkd
cat >> /etc/locale.gen <<EOF
cs_CZ.UTF-8 UTF-8
sk_SK.UTF-8 UTF-8
......@@ -42,13 +52,13 @@ else
apt install -yy grub-pc
fi
if ! grep -q 'console serial' /etc/default/grub; then
sed -i /etc/default/grub -e 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="quiet console=tty0 console=ttyS1,9600n8"/'
sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet console=tty0 console=ttyS1,$SERIAL_SPEED\"/"
cat >> /etc/default/grub <<EOF
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"
## Serial console
GRUB_SERIAL_COMMAND="serial --speed=9600 --unit=1"
GRUB_SERIAL_COMMAND="serial --speed=$SERIAL_SPEED --unit=1"
# Uncomment to use basic console
GRUB_TERMINAL_INPUT="console serial"
......