Skip to content

Instantly share code, notes, and snippets.

@aeris
Created March 19, 2020 15:31
Show Gist options
  • Save aeris/9221422fa38ba67b583eaf2fdc37638f to your computer and use it in GitHub Desktop.
Save aeris/9221422fa38ba67b583eaf2fdc37638f to your computer and use it in GitHub Desktop.
Automated installer from ISO image for Debian
# Licence: GPLv3
d-i debian-installer/locale string fr_FR
d-i localechooser/supported-locales string fr_FR.UTF-8
d-i keyboard-configuration/xkb-keymap select fr(latin9)
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string dev
d-i netcfg/get_domain example.org
d-i netcfg/hostname string dev
d-i mirror/country string manual
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i passwd/root-login boolean true
d-i passwd/root-password password root
d-i passwd/root-password-again password root
d-i passwd/make-user boolean false
d-i clock-setup/utc boolean true
d-i time/zone string UTC
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string fr.pool.ntp.org
d-i partman-auto/init_automatically_partition select Guided - use entire disk
d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select atomic
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
d-i apt-setup/contrib boolean true
d-i apt-setup/non-free boolean false
d-i apt-setup/enable-source-repositories boolean false
d-i apt-setup/services-select multiselect security, updates, backports
d-i apt-setup/security_host string security.debian.org
d-i base-installer/install-recommends boolean false
d-i base-installer/kernel/image string linux-image-amd64
tasksel tasksel/first multiselect standard
d-i pkgsel/include string openssh-server libpam-systemd avahi-daemon libnss-mdns vim zsh console-data htop ncdu rsync linux-image-amd64/stretch-backports linux-headers-amd64/stretch-backports virtualbox-guest-dkms/stretch-backports
d-i pkgsel/upgrade select full-upgrade
d-i preseed/late_command string \
in-target apt autoremove -y nano exim4* nsf-* rpcbind libnfs*; \
in-target sed -i s/XKBVARIANT=.*/XKBVARIANT="bepo"/ /etc/default/keyboard; \
in-target chsh root -s /bin/zsh; \
in-target sed -i "s/#PermitRootLogin .*/PermitRootLogin yes/" /etc/ssh/sshd_config
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/bootdev string /dev/sda
d-i finish-install/reboot_in_progress note
#!/bin/bash
# Licence: GPLv3
ISO="${1}"
SEED="${2:-preseed.cfg}"
TARGET="${ISO%.iso}-preseed.iso"
mkdir -p orig/ preseed/
fuseiso "${ISO}" orig
rsync --chown aeris:aeris -ahxH --exclude=TRANS.TBL orig/ preseed/
fusermount -u orig/
rmdir orig/
chmod u+w -R preseed/
cp "${SEED}" preseed/
sed -i "s# initrd=# file=/cdrom/preseed.cfg initrd=#" preseed/isolinux/ad{gtk,txt}.cfg
find preseed/ -follow -type f | xargs md5sum | sed "s# preseed/# #" > md5sum.txt
genisoimage -o "${TARGET}" -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinuux/boot.cat preseed/
rm -rf preseed/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment