Skip to content

Instantly share code, notes, and snippets.

@uyorum
Last active December 2, 2022 01:14
Show Gist options
  • Save uyorum/1c7f1ccf269b725ed06b0865c0ccf110 to your computer and use it in GitHub Desktop.
Save uyorum/1c7f1ccf269b725ed06b0865c0ccf110 to your computer and use it in GitHub Desktop.
Preseed for Debian stretch (Replace "root-password-crypted" line)
#!ipxe
dhcp
initrd http://ftp.jp.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
kernel http://ftp.jp.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux auto=true priority=critical url=http://${dhcp-server}/preseed.cfg suite=stretch
boot
d-i debian-installer/language string en
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/country string JP
d-i keyboard-configuration/xkb-keymap select jp106
popularity-contest popularity-contest/participate boolean false
# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
#d-i netcfg/get_hostname string localhost
#d-i netcfg/get_domain string localdomain
# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.jp.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
#d-i mirror/suite string stretch
d-i clock-setup/utc boolean false
d-i time/zone string Japan
d-i clock-setup/ntp boolean false
# Partition
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string vg01
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto/expert_recipe string \
boot-root :: \
190 50 200 ext3 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
mountpoint{ /boot } \
. \
4000 512 4096 linux-swap \
$lvmok{ } lv_name{ swap } \
method{ swap } format{ } \
. \
500 10000 -1 xfs \
$lvmok{ } lv_name{ root } \
method{ format } format{ } \
use_filesystem{ } filesystem{ xfs } \
mountpoint{ / } \
.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# Account setting
d-i passwd/root-login boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password-crypted password `mkpasswd -m sha-512 -S saltsalt -s <<< PASSWORD`
# Base system installation
d-i base-installer/install-recommends boolean true
d-i base-installer/kernel/image string linux-image-amd64
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
d-i apt-setup/use_mirror boolean true
## Package selection
tasksel tasksel/first multiselect standard
d-i pkgsel/include string openssh-server curl wget open-vm-tools
# Install GRUB
d-i grub-installer/only_debian boolean true
d-i grub-installer/bootdev string /dev/sda
d-i preseed/late_command string \
in-target /bin/mkdir /root/.ssh ;\
in-target /usr/bin/wget https://github.com/uyorum.keys -O /root/.ssh/authorized_keys ;\
in-target /bin/chmod 0700 /root/.ssh ;\
in-target /bin/chmod 0600 /root/.ssh/authorized_keys
d-i finish-install/reboot_in_progress note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment