Commit bebb5aab authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

WIP: hsinchu

parent 662413f2
#!/bin/sh
#UPDATE THOSE VARIABLES DEPENDING ON YOUR SITE
MY_IF_NAME=ens9f1
MY_IP_ADDR=10.0.45.51
DHCP_RANGE=10.0.45.100,10.0.45.200,255.255.255.0
MY_IF_NAME=VLAN100
MY_IP_ADDR=10.0.45.1
DHCP_RANGE=10.0.45.100,static,255.255.255.0
ROUTER_ADDR=10.0.45.1
DNS_SERVER=1.2.4.8
LOCAL_SCRIPT=$(realpath `dirname "$0"`)/gen_xinzhou.sh
LOCAL_SCRIPT=$(realpath `dirname "$0"`)/gen_hsinchu.sh
if [ ! -f version.info ]
then
......@@ -34,4 +34,5 @@ exec dnsmasq -d --port=0 --log-dhcp \
--dhcp-option=option:dns-server,$DNS_SERVER \
--dhcp-boot=debian-installer/amd64/grubx64.efi \
--enable-tftp --tftp-root=$(realpath `dirname "$0"`) \
--conf-file=/dev/null
--conf-file=/dev/null \
--dhcp-host=98:03:9b:9b:8a:47,10.0.45.101,1h
#!/bin/sh
set -e
common=console=ttyS1,57600
mac='
98:03:9b:9b:8a:46
b8:59:9f:37:9a:bc
b8:59:9f:37:9a:c4
b8:59:9f:37:9a:9c
b8:59:9f:36:2b:e2
b8:59:9f:37:9f:cc
b8:59:9f:37:9f:9c
b8:59:9f:37:9b:8c
b8:59:9f:35:68:06
b8:59:9f:35:5f:66
98:03:9b:9a:e5:8a
b8:59:9f:37:9a:a4
b8:59:9f:37:9a:b4
98:03:9b:9c:22:88
'
i=2
hostname_prefix=hsinchu-tiogapass-
(
#echo set timeout=0
echo if false
echo then true
for mac in $mac; do
echo "elif [ \$net_default_mac = $mac ]"
echo then set i=`printf %03u $i`
i=`expr $i + 1`
done
cat <<EOF
else unset timeout
fi
menuentry 'Install Debian' {
linux /debian-installer/amd64/linux vga=788 url=tftp://\$pxe_default_server/preseed.cfg language=C country=CN keymap=us hostname=${hostname_prefix}\$i domain= --- mitigations=off $common
initrd /debian-installer/amd64/initrd.gz
}
menuentry 'SystemRescueCd' {
linux /sysresccd/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd archiso_http_srv=http://\$pxe_default_server:69/sysresccd/ checksum ip=dhcp $common
initrd /sysresccd/sysresccd/boot/intel_ucode.img /sysresccd/sysresccd/boot/amd_ucode.img /sysresccd/sysresccd/boot/x86_64/sysresccd.img
}
menuentry 'Exit' {
exit
}
EOF
) >debian-installer/amd64/grub/grub.cfg
for mac in $mac
do
hostname=${hostname_prefix}$(printf %03u $i)
mkdir -p $hostname
cat > $hostname/interfaces <<EOF
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eno1
#iface eno1 inet dhcp
iface eno1 inet static
address 192.168.46.$(( 50 + $i ))/24
allow-hotplug ens9f1
iface ens9f1 inet static
address 10.0.45.$(( 50 + $i ))/24
gateway 10.0.45.1
dns-nameservers 1.2.4.8 223.5.5.5 223.6.6.6
#allow-hotplug ens9f0
##iface ens9f0 inet dhcp
#iface ens9f0 inet static
# address 113.24.192.26/30
# gateway 113.24.192.25
EOF
i=`expr $i + 1`
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment