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

Commit scripts used in Hydro66 datacenter

parent e88cd7ea
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5MAMmMmojqNRoOnGc7xGoJWWAzYo2f2zO2K4elsZhHfG6l2SQJTmna0DuUi8qEtBbA9+TN1HAOeEXQKMsQyydG8dAE9vT41Lj5y8kXQDDquQxcpTIrqjmSqxjG42Olk+sT+XvcdyqA//29OHhhrKdhIf9LAOsIPHDYW06hRMf7kXIgt3MNi8ayPpA9coTHIscvV8MzwbF2q8Owrkj5UpPmSd/cjmFTcijT3rXmN0E1d3lrCvIuqxFBsFB47o0q53rFZMc5HoHQjJbg6dB4E0GNT0Ujl9ZaIDEzQbe1/T5BVWXrwDfYXbj8UlqtXeFQlo2dB+au2tHw56s4boqDxIl thomas.gambier@nexedi.com
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqtIaYviWuvGgTJAs0rTnjxIsyAowkljVDqat8m7s8YT+jdqZHBxKjgRD2h4KG1w6qz9TXb9kuI4a6+zcI2MtvUEHlO05xcuXGm6M4sMK8EK3CejFsbcRKr6bRSzuLHVvecVMWbhrrjJF+xQIMbtIQAuJJMvLe2eDE4xevs7itscyOMfBP98EkqMMi0EQNMVf5xYUjNgGzrqpnB3YXwBZbfmBVmA/CrO+B2vF4FXzLAoom2C/dT7ZHZlYV/YMtCVmVKsj0W9xbO1AQDFeNgdKHpmWLaHLG9CTDI2TeQ/lkA8I/Gj1pPkPLdjF4YfvcpxGs4m01dsLPfpM2anFAIx0IQ== jm@nexedi.com
#!/bin/sh
# apt install dnsmasq-base
exec dnsmasq -d --port=0 --log-dhcp \
--interface=ens1 --listen-address=10.0.45.50 \
--dhcp-range=10.0.45.200,10.0.45.239,255.255.255.0 \
--dhcp-option=option:router,10.0.45.1 \
--dhcp-option=option:dns-server,80.80.80.80,80.80.81.81 \
--dhcp-boot=debian-installer/amd64/grubx64.efi \
--enable-tftp --tftp-root=$(realpath `dirname "$0"`)
#!/bin/sh
set -e
common=console=ttyS1,57600
(mac='
f4:52:14:fc:a4:94
f4:52:14:f9:0c:2a
e4:1d:2d:52:ea:e4
f4:52:14:fc:3e:58
f4:52:14:a7:12:c4
f4:52:14:a8:8b:34
f4:52:14:a5:f5:8c
f4:52:14:f3:c9:cc
f4:52:14:f8:c8:e0
f4:52:14:fc:5f:ac
f4:52:14:b0:91:2c
f4:52:14:f8:86:ec
e4:1d:2d:52:40:d4
f4:52:14:fc:5b:ce
e4:1d:2d:52:5c:64
e4:1d:2d:52:c7:ce
f4:52:14:b0:60:84
f4:52:14:f8:e9:b6
f4:52:14:fa:1a:06
f4:52:14:fc:b6:5e
f4:52:14:a6:f3:e4
f4:52:14:a8:23:7e
f4:52:14:f8:a9:60
f4:52:14:a6:8b:98
e4:1d:2d:52:f3:1e
f4:52:14:fc:40:e0
e4:1d:2d:52:7f:f8
e4:1d:2d:52:cd:14
f4:52:14:f8:d5:d0
f4:52:14:fd:01:74
f4:52:14:fc:53:b8
e4:1d:2d:52:c1:7a
e4:1d:2d:52:f7:32
f4:52:14:f3:d5:d2
f4:52:14:fa:37:e8
e4:1d:2d:52:29:6a
'
#echo set timeout=0
echo if false
echo then true
i=0
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=SE keymap=us hostname=hydro66-leopard-\$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
#d-i anna/choose_modules string network-console
#d-i network-console/password password jsdlhhil
#d-i network-console/password-again password jsdlhhil
d-i apt-setup/enable-source-repositories string false
d-i auto-install/enable string true
d-i base-installer/install-recommends string false
d-i debconf/priority string critical
#d-i finish-install/reboot_in_progress string note
d-i grub-installer/force-efi-extra-removable string true
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.se.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i partman/early_command string set -e; x=`grep -l 234441648 /sys/block/*/size`; x=${x%/*}; x=/dev/${x##*/}; debconf-set partman-auto/disk $x; debconf-set grub-installer/bootdev $x
d-i partman-auto/expert_recipe string : 36 1 36 free method{ efi } format{ } . 1 1 -1 xfs method{ format } format{ } use_filesystem{ } filesystem{ xfs } mountpoint{ / } options/noatime{ } .
d-i partman-auto/method string regular
d-i partman-basicfilesystems/no_swap string false
d-i partman/choose_partition string finish
d-i partman/confirm string true
d-i partman/confirm_nooverwrite string true
d-i partman-efi/non_efi_system boolean true
d-i passwd/make-user string false
d-i passwd/root-login string true
d-i passwd/root-password string willbedeleted
d-i passwd/root-password-again string willbedeleted
d-i pkgsel/include string ssh aptitude bwm-ng ca-certificates dbus-user-session debian-goodies dnsutils eatmydata efibootmgr gdb git gnupg host htop iotop linux-cpupower linux-perf lm-sensors lsof man-db ndisc6 netcat-openbsd python resolvconf rsync screen smartmontools socat strace systemd-coredump vim wget xz-utils
# - fix UTF-8 (C.UTF-8 globally, no C override for root)
# - only login with a ssh-key
# - restore network settings
# - ignore other OS (in particular if there are VM using whole physical drives)
# - I don't like 'quiet' on servers (https://bugs.launchpad.net/bugs/581796)
# - enable page up/down to search the history
d-i preseed/late_command string set -e; \
cd /target/root; sed -i /^mesg/q .profile; \
mkdir -m 0700 .ssh; cd .ssh; tftp -g -r authorized_keys 10.0.45.50; \
cd ../../etc; rm -f grub.d/30_otheros; echo LANG=C.UTF-8 >default/locale; \
sed -i '/history-search-/s/# //' inputrc; \
cd network; tftp -g -r `hostname`/interfaces 10.0.45.50; \
in-target sh -ec 'passwd -ld root; sed -i /^GRUB_CMDLINE_LINUX_DEFAULT=/s/quiet// /etc/default/grub; update-grub'
d-i time/zone string UTC
tasksel tasksel/first string
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