<commit_before>#_preseed_V1

# Basic Debian9 (stretch) installer preseed file for Skolo machines. Assumes additional setup
# post-installation to reset the password for the chrome-bot user and overwrite
# /home/chrome-bot/.ssh/authorized_keys.
# Based on https://www.debian.org/releases/stretch/example-preseed.txt, retrieved 2018-01-17.
# Documentation at https://www.debian.org/releases/stretch/amd64/apb.html.en
#
# Note this warning in the example file ("d-i" is an abbreviation for Debian installer):
#   d-i preseeding is inherently not secure. Nothing in the installer checks
#   for attempts at buffer overflows or other exploits of the values of a
#   preconfiguration file like this one. Only use preconfiguration files from
#   trusted locations!
#
# How to use (for details, see doc link above):
# iPXE boot (Haven't tried this yet):
#   1. Copy to the TFTP root.
#   2. Add "auto=true url=tftp://${dhcp-server}/debian9-preseed.cfg
#      preseed/url/checksum=<md5sum of debian9-preseed.cfg>" to the end of the iPXE kernel line.
#
# USB stick:
#   1. Create a modifiable Debian installer USB stick.
#     a. Download a Debian Installer CD ISO. Maybe helpful to include third-party firmware. (I used
#        debian-live-9.3.0-amd64-cinnamon+nonfree.iso.)
#     b. Format USB stick (replace "foo" with device name):
#        - sudo fdisk /dev/foo
#        - g (Create a new GPT)
#        - n (Create new partition)
#        - 1 (Partition number)
#        - Enter, enter (default start/end for max size)
#        - t (Change partition type)
#        - 1 (Select partition 1)
#        - 1 (EFI System)
#        - w (Write partition table)
#     c. sudo mkfs.fat -F32 /dev/foo1
#     d. Mount USB partition
#        - sudo mkdir /mnt/usb
#        - sudo mount /dev/foo1 /mnt/usb
#     e. Install GRUB to the USB EFI partition
#        - sudo grub-install --target x86_64-efi --efi-directory /mnt/usb/ --removable
#          --boot-directory=/mnt/usb/boot
#     f. Mount ISO
#        - sudo mkdir /mnt/iso
#        - sudo mount -o loop Downloads/debian-live-9.3.0-amd64-cinnamon+nonfree.iso /mnt/iso
#     g. Copy all files from ISO to USB (ISO has a dir named .disk that * doesn't match)
#        - sudo cp -R /mnt/iso/* /mnt/usb/
#        - sudo cp -R /mnt/iso/.disk/ /mnt/usb/
#   2. Copy this file to the root of the USB stick.
#     - sudo cp debian9-preseed.cfg /mnt/usb/
#   3. Add/modify a menuentry in boot/grub/grub.cfg with "auto=true
#      file=/cdrom/debian9-preseed.cfg preseed-md5=<md5sum of debian9-preseed.cfg>"
#     - md5sum /mnt/usb/debian9-preseed.cfg
#     - sudo nano /mnt/usb/boot/grub/grub.cfg
#     - Add
#   menuentry "Preeseeded Debian Installer" {
#     linux  /d-i/vmlinuz auto=true file=/cdrom/debian9-preseed.cfg preseed-md5=... "${loopback}"
#     initrd /d-i/initrd.gz
#   }
#   4. Cleanup
#     - sudo umount /mnt/iso /mnt/usb
#     - sudo rmdir /mnt/iso /mnt/usb

### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US

# Keyboard selection.
d-i keyboard-configuration/xkb-keymap select us

### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto

# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string

# If non-free firmware is needed for the network or other hardware, you can
# configure the installer to always try to load it, without prompting.
d-i hw-detect/load_firmware boolean true

### Mirror settings
apt-mirror-setup apt-setup/use_mirror boolean true
d-i mirror/country string manual
d-i mirror/http/hostname string http.us.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

# Suite to install.
d-i mirror/suite string stretch

### Account setup
# Skip creation of a root account (normal user account will be able to use sudo). (If this is set to
# true, chrome-bot user can't use sudo.)
d-i passwd/root-login boolean false

# To create a normal user account.
d-i passwd/user-fullname string chrome-bot
d-i passwd/username string chrome-bot
# This is the hash of a temporary password that will be changed immediately after booting into the
# new system.
d-i passwd/user-password-crypted password \
  <PASSWORD>

### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true

# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/zoneinfo/ for valid values.
d-i time/zone string US/Eastern

# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
# NTP server to use. We use the local router.
d-i clock-setup/ntp-server string 192.168.1.1

### Partitioning
# - lvm:     use LVM to partition the disk
d-i partman-auto/method string lvm
partman-auto partman-auto/method string lvm
# No clue what this means or why above is not enough to pick LVM.
partman-auto	partman-auto/init_automatically_partition	select	60some_device_lvm__________lvm

# Use largest disk (i.e. not USB stick) for installation.
d-i partman/early_command string \
  largest=""; \<commit_msg>[Skolo Linux] Reset temp password in preseed.<commit_after>#_preseed_V1

# Basic Debian9 (stretch) installer preseed file for Skolo machines. Assumes additional setup
# post-installation to reset the password for the chrome-bot user and overwrite
# /home/chrome-bot/.ssh/authorized_keys.
# Based on https://www.debian.org/releases/stretch/example-preseed.txt, retrieved 2018-01-17.
# Documentation at https://www.debian.org/releases/stretch/amd64/apb.html.en
#
# Note this warning in the example file ("d-i" is an abbreviation for Debian installer):
#   d-i preseeding is inherently not secure. Nothing in the installer checks
#   for attempts at buffer overflows or other exploits of the values of a
#   preconfiguration file like this one. Only use preconfiguration files from
#   trusted locations!
#
# How to use (for details, see doc link above):
# iPXE boot (Haven't tried this yet):
#   1. Copy to the TFTP root.
#   2. Add "auto=true url=tftp://${dhcp-server}/debian9-preseed.cfg
#      preseed/url/checksum=<md5sum of debian9-preseed.cfg>" to the end of the iPXE kernel line.
#
# USB stick:
#   1. Create a modifiable Debian installer USB stick.
#     a. Download a Debian Installer CD ISO. Maybe helpful to include third-party firmware. (I used
#        debian-live-9.3.0-amd64-cinnamon+nonfree.iso.)
#     b. Format USB stick (replace "foo" with device name):
#        - sudo fdisk /dev/foo
#        - g (Create a new GPT)
#        - n (Create new partition)
#        - 1 (Partition number)
#        - Enter, enter (default start/end for max size)
#        - t (Change partition type)
#        - 1 (Select partition 1)
#        - 1 (EFI System)
#        - w (Write partition table)
#     c. sudo mkfs.fat -F32 /dev/foo1
#     d. Mount USB partition
#        - sudo mkdir /mnt/usb
#        - sudo mount /dev/foo1 /mnt/usb
#     e. Install GRUB to the USB EFI partition
#        - sudo grub-install --target x86_64-efi --efi-directory /mnt/usb/ --removable
#          --boot-directory=/mnt/usb/boot
#     f. Mount ISO
#        - sudo mkdir /mnt/iso
#        - sudo mount -o loop Downloads/debian-live-9.3.0-amd64-cinnamon+nonfree.iso /mnt/iso
#     g. Copy all files from ISO to USB (ISO has a dir named .disk that * doesn't match)
#        - sudo cp -R /mnt/iso/* /mnt/usb/
#        - sudo cp -R /mnt/iso/.disk/ /mnt/usb/
#   2. Copy this file to the root of the USB stick.
#     - sudo cp debian9-preseed.cfg /mnt/usb/
#   3. Add/modify a menuentry in boot/grub/grub.cfg with "auto=true
#      file=/cdrom/debian9-preseed.cfg preseed-md5=<md5sum of debian9-preseed.cfg>"
#     - md5sum /mnt/usb/debian9-preseed.cfg
#     - sudo nano /mnt/usb/boot/grub/grub.cfg
#     - Add
#   menuentry "Preeseeded Debian Installer" {
#     linux  /d-i/vmlinuz auto=true file=/cdrom/debian9-preseed.cfg preseed-md5=... "${loopback}"
#     initrd /d-i/initrd.gz
#   }
#   4. Cleanup
#     - sudo umount /mnt/iso /mnt/usb
#     - sudo rmdir /mnt/iso /mnt/usb

### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US

# Keyboard selection.
d-i keyboard-configuration/xkb-keymap select us

### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto

# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string

# If non-free firmware is needed for the network or other hardware, you can
# configure the installer to always try to load it, without prompting.
d-i hw-detect/load_firmware boolean true

### Mirror settings
apt-mirror-setup apt-setup/use_mirror boolean true
d-i mirror/country string manual
d-i mirror/http/hostname string http.us.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

# Suite to install.
d-i mirror/suite string stretch

### Account setup
# Skip creation of a root account (normal user account will be able to use sudo). (If this is set to
# true, chrome-bot user can't use sudo.)
d-i passwd/root-login boolean false

# To create a normal user account.
d-i passwd/user-fullname string chrome-bot
d-i passwd/username string chrome-bot
# This is the hash of the temporary password that can be found in Valentine under
# "debian9-preseed.cfg." Generated with:
# > mkpasswd -m sha-512 <password>
d-i passwd/user-password-crypted password \
  <PASSWORD>/

### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true

# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/zoneinfo/ for valid values.
d-i time/zone string US/Eastern

# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
# NTP server to use. We use the local router.
d-i clock-setup/ntp-server string 192.168.1.1

### Partitioning
# - lvm:     use LVM to partition the disk
d-i partman-auto/method string lvm
partman-auto partman-auto/method string lvm
# No clue what this means or why above is not enough to pick LVM.
partman-auto	partman-auto/init_automatically_partition	select	60some_device_lvm__________lvm

# Use largest disk (i.e. not USB stick) for installation.
d-i partman/early_command string \
  largest=""; \
{'fraction_non_alphanumeric': 0.09680620714543486, 'fraction_numerical': 0.01154817755322988, 'mean_word_length': 3.1055555555555556, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2112994', 'n_tokens_mistral': 3741, 'n_tokens_neox': 3528, 'n_words': 1323}