You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

182 lines
7.3KB

  1. ### Preseed for Ubuntu 18.04
  2. # Derived from: https://help.ubuntu.com/lts/installation-guide/example-preseed.txt
  3. ### Compatibility
  4. # Tested with the netboot image:
  5. # http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso
  6. # Might work with the regular image (not tested):
  7. # http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-amd64.iso
  8. ### Authentication
  9. # We recommend to use public key authentication and therefore disabled the root
  10. # password. The build-iso.sh script will do all the hard work for you.
  11. #
  12. # In case you still want to use password authentication, you need to set the
  13. # passwd/root-password-crypted variable. See below for further instructions.
  14. ### Usage
  15. # We recommend to use the build-iso.sh script to build an image with embedded
  16. # preseed and other required files. In that case the preseed file gets loaded
  17. # automatically and all additional files are available to the installer.
  18. #
  19. # In case you want to use a vanilla ISO image, please use the following boot
  20. # instructions to load the preseed file (press ESC and enter in boot prompt):
  21. #
  22. # install auto=true priority=critical url=https://raw.githubusercontent.com/core-process/linux-unattended-installation/master/ubuntu/18.04/custom/preseed.cfg
  23. #
  24. # Note: you will need to adjust the "preseed/late_command" variable to match
  25. # your environment in case you do not use the build-iso.sh script.
  26. ### Unattended Installation
  27. d-i auto-install/enable boolean true
  28. d-i debconf/priority select critical
  29. ### Localization
  30. d-i debian-installer/locale string en_US.UTF-8
  31. d-i localechooser/supported-locales multiselect en_US.UTF-8, de_DE.UTF-8
  32. d-i console-setup/ask_detect boolean false
  33. d-i keyboard-configuration/xkb-keymap select us
  34. ### Network configuration
  35. d-i netcfg/choose_interface select auto
  36. d-i netcfg/hostname string device
  37. d-i netcfg/get_hostname string device
  38. d-i netcfg/get_domain string unnamed
  39. d-i hw-detect/load_firmware boolean true
  40. ### Mirror settings
  41. d-i mirror/country string manual
  42. d-i mirror/http/hostname string us.archive.ubuntu.com
  43. d-i mirror/http/directory string /ubuntu
  44. d-i mirror/http/proxy string
  45. ### Account setup
  46. d-i passwd/root-login boolean true
  47. d-i passwd/root-password-crypted password !!
  48. d-i passwd/make-user boolean false
  49. # The root password is disabled by default. In case you want to use a root
  50. # password, please generate a password with the following command
  51. # printf "please-change-password" | mkpasswd -s -m sha-512
  52. # and update the passwd/root-password-crypted variable accordingly. Furthermore
  53. # you need to remove the call to "usermod" below.
  54. ### Clock and time zone setup
  55. d-i clock-setup/utc boolean true
  56. d-i time/zone string Etc/UTC
  57. d-i clock-setup/ntp boolean true
  58. d-i clock-setup/ntp-server string ntp.ubuntu.com
  59. ### Do NOT install on the USB stick(!)
  60. #
  61. # The Debian installer will install on the first disk it finds which can
  62. # sometimes be the USB stick itself. Work around this by rolling our own auto
  63. # detect logic which disallows installing on USB devices.
  64. d-i partman/early_command string \
  65. USBDEV_LIST="$(mktemp)"; \
  66. list-devices usb-partition | sed "s/\(.*\)./\1/" > "$USBDEV_LIST"; \
  67. BOOTDEV="$(list-devices disk | grep -vf "$USBDEV_LIST" | head -n 1)"; \
  68. debconf-set partman-auto/disk "$BOOTDEV"; \
  69. debconf-set grub-installer/bootdev "$BOOTDEV"; \
  70. while /bin/true; do sleep 0.01; rm -f /target/etc/grub.d/30_os-prober; done &
  71. ### Partitioning
  72. d-i preseed/early_command string umount /media || true
  73. d-i partman-auto/method string lvm
  74. d-i partman-auto-lvm/guided_size string max
  75. d-i partman-lvm/device_remove_lvm boolean true
  76. d-i partman-lvm/confirm boolean true
  77. d-i partman-lvm/confirm_nooverwrite boolean true
  78. d-i partman-auto-lvm/new_vg_name string main
  79. d-i partman-md/device_remove_md boolean true
  80. d-i partman-md/confirm boolean true
  81. d-i partman-partitioning/confirm_write_new_label boolean true
  82. d-i partman/choose_partition select finish
  83. d-i partman/confirm boolean true
  84. d-i partman/confirm_nooverwrite boolean true
  85. d-i partman-basicmethods/method_only boolean false
  86. ### GPT
  87. d-i partman-basicfilesystems/choose_label string gpt
  88. d-i partman-basicfilesystems/default_label string gpt
  89. d-i partman-partitioning/choose_label string gpt
  90. d-i partman-partitioning/default_label string gpt
  91. d-i partman/choose_label string gpt
  92. d-i partman/default_label string gpt
  93. ### EFI
  94. d-i partman-efi/non_efi_system boolean true
  95. ### Grub
  96. d-i grub-installer/only_debian boolean true
  97. d-i grub-installer/with_other_os boolean true
  98. # Use entire disk
  99. d-i partman-auto/expert_recipe string \
  100. boot-root :: \
  101. 1 1 1 free \
  102. $bios_boot{ } \
  103. method{ biosgrub } \
  104. . \
  105. 256 256 256 fat32 \
  106. $primary{ } \
  107. $iflabel{ gpt } \
  108. $reusemethod{ } \
  109. method{ efi } format{ } \
  110. mountpoint{ /boot/efi } \
  111. . \
  112. 512 512 512 ext4 \
  113. $primary{ } \
  114. $bootable{ } \
  115. method{ format } format{ } \
  116. use_filesystem{ } filesystem{ ext4 } \
  117. mountpoint{ /boot } \
  118. . \
  119. 1024 102400000 1000000000 ext4 \
  120. $lvmok{ } \
  121. method{ format } format{ } \
  122. use_filesystem{ } filesystem{ ext4 } \
  123. mountpoint{ / } \
  124. lv_name{ root } \
  125. . \
  126. 200% 200% 200% linux-swap \
  127. $lvmok{ } \
  128. method{ swap } format{ } \
  129. lv_name{ swap } \
  130. .
  131. ### Base system installation
  132. d-i base-installer/install-recommends boolean true
  133. d-i base-installer/kernel/image string linux-generic
  134. ### Apt setup
  135. d-i apt-setup/restricted boolean true
  136. d-i apt-setup/universe boolean true
  137. d-i apt-setup/backports boolean true
  138. d-i apt-setup/use_mirror boolean false
  139. d-i apt-setup/services-select multiselect security, updates
  140. d-i apt-setup/security_host string security.ubuntu.com
  141. d-i apt-setup/security_path string /ubuntu
  142. ### Package selection
  143. d-i tasksel/first multiselect none
  144. d-i pkgsel/include string openssh-server python
  145. d-i pkgsel/upgrade select full-upgrade
  146. d-i pkgsel/update-policy select unattended-upgrades
  147. ### Finishing up the installation
  148. d-i preseed/late_command string \
  149. in-target sh -c 'lvremove -f --noudevsync main/placeholder || true'; \
  150. in-target sh -c 'rm -f /etc/ssh/ssh_host_*_key* && mkdir -p /usr/lib/systemd/system && cp /custom/ssh-host-keygen.service /usr/lib/systemd/system/ssh-host-keygen.service && systemctl enable ssh-host-keygen.service'; \
  151. in-target sh -c 'echo "IPv4: \\\4" >> /etc/issue && echo "IPv6: \\\6" >> /etc/issue && echo "" >> /etc/issue'; \
  152. in-target sh -c 'eject || true'; \
  153. cp postinst.sh /target/tmp/ && chmod 755 /target/tmp/postinst.sh && in-target /tmp/postinst.sh ;
  154. d-i debian-installer/splash boolean false
  155. d-i cdrom-detect/eject boolean true
  156. ### Shutdown machine
  157. d-i finish-install/reboot_in_progress note
  158. d-i debian-installer/exit/poweroff boolean true