preseed.cfg 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. # Installation Sources
  2. ########################################
  3. ### Mirror settings
  4. d-i mirror/country string manual
  5. d-i mirror/http/hostname string ftp.ch.debian.org
  6. d-i mirror/http/directory string /debian
  7. d-i mirror/http/proxy string
  8. d-i mirror/suite string stable
  9. # security
  10. d-i apt-setup/services-select multiselect security, updates
  11. d-i apt-setup/security_host string security.debian.org
  12. # non-free and contrib
  13. d-i apt-setup/non-free boolean true
  14. d-i apt-setup/contrib boolean true
  15. # Networking
  16. ########################################
  17. # Network Configuration
  18. d-i netcfg/disable_dhcp boolean false
  19. d-i netcfg/choose_interface select auto
  20. d-i netcfg/get_hostname installbox
  21. d-i netcfg/get_domain seen domain.example
  22. # udeb
  23. #######################################
  24. d-i preseed/early_command string \
  25. anna-install fdisk-udeb
  26. # Disk Partitioning/Boot loader
  27. ########################################
  28. # Disk Partitioning/Boot loader
  29. ########################################
  30. # automatically partition without confirmation
  31. # remove existing partitions on first disk (/dev/sda)
  32. d-i partman/early_command string \
  33. sdadisk=$(ls /dev | grep 'sda'); \
  34. nvmedisk=$(ls /dev | grep 'nvme0n1'); \
  35. $emmcdisk=$(ls /dev | grep 'mmcblk0'); \
  36. if [ "$nvmedisk" ]; \
  37. then \
  38. for i in 1 2 3 4 5 6 7 8; \
  39. do \
  40. if [ "$(fdisk -l /dev/nvme0n1 | grep /dev/nvme0n1p$i)" ]; \
  41. then \
  42. echo -e "d\n$i\nw\n" | fdisk /dev/nvme0n1; \
  43. fi; \
  44. done; \
  45. debconf-set partman-auto/disk "/dev/nvme0n1"; \
  46. debconf-set grub-installer/bootdev "/dev/nvme0n1"; \
  47. elif [ "$sdadisk" ]; \
  48. then \
  49. for i in 1 2 3 4 5 6 7 8; \
  50. do \
  51. if [ "$(fdisk -l /dev/sda | grep /dev/sda$i)" ]; \
  52. then \
  53. echo -e "d\n$i\nw\n" | fdisk /dev/sda; \
  54. fi; \
  55. done; \
  56. debconf-set partman-auto/disk "/dev/sda"; \
  57. debconf-set grub-installer/bootdev "/dev/sda"; \
  58. elif [ "$emmcdisk" ]; \
  59. then \
  60. for i in 1 2 3 4 5 6 7 8; \
  61. do \
  62. if [ "$(fdisk -l /dev/mmcblk0 | grep /dev/mmcblk0p$i)" ]; \
  63. then \
  64. echo -e "d\n$i\nw\n" | fdisk /dev/mmcblk0; \
  65. fi; \
  66. done; \
  67. debconf-set partman-auto/disk "/dev/mmcblk0"; \
  68. debconf-set grub-installer/bootdev "/dev/mmcblk0"; \
  69. fi; \
  70. exit 0;
  71. d-i partman-auto/method string regular
  72. d-i partman-lvm/device_remove_lvm boolean true
  73. d-i partman-md/device_remove_md boolean true
  74. d-i partman-lvm/confirm boolean true
  75. # Keep that one set to true so we end up with a UEFI enabled
  76. # system. If set to false, /var/lib/partman/uefi_ignore will be touched
  77. d-i partman-efi/non_efi_system boolean true
  78. # enforce usage of GPT - a must have to use EFI!
  79. d-i partman-basicfilesystems/choose_label string gpt
  80. d-i partman-basicfilesystems/default_label string gpt
  81. d-i partman-partitioning/choose_label string gpt
  82. d-i partman-partitioning/default_label string gpt
  83. d-i partman/choose_label string gpt
  84. d-i partman/default_label string gpt
  85. # create a third partition which will be deleted afterwards in order
  86. # to make sure that the root partition will not exceed 30GB
  87. # this is necessary as d-i does not allow to have empty space left
  88. d-i partman-auto/expert_recipe string \
  89. efi-swap-root-spare :: \
  90. 1 1 1 free \
  91. $bios_boot{ } \
  92. method{ biosgrub } \
  93. . \
  94. 538 538 1075 free \
  95. $iflabel{ gpt } \
  96. $reusemethod{ } \
  97. method{ efi } \
  98. format{ } \
  99. . \
  100. 512 1024 2048 linux-swap \
  101. $primary{ } \
  102. method{ swap } format{ } \
  103. . \
  104. 5000 10000 15000 ext4 \
  105. $primary{ } \
  106. method{ format } format{ } \
  107. use_filesystem{ } filesystem{ ext4 } \
  108. mountpoint{ / } \
  109. . \
  110. 100 1000 1000000000 ext4 \
  111. $primary{ } \
  112. . \
  113. d-i partman-partitioning/confirm_write_new_label boolean true
  114. d-i partman/choose_partition select finish
  115. d-i partman/confirm boolean true
  116. d-i partman/confirm_nooverwrite boolean true
  117. # grub
  118. d-i grub-installer/with_other_os boolean true
  119. d-i grub-installer/only_debian boolean true
  120. # suppress installation finished message
  121. d-i finish-install/reboot_in_progress note
  122. # don't eject cdrom after the installation has finished
  123. d-i cdrom-detect/eject boolean false
  124. # Localizations
  125. ########################################
  126. # keyboard configuration during the installation
  127. d-i debian-installer/locale string en_US.UTF-8
  128. #d-i keyboard-configuration/xkb-keymap select ch
  129. # timezone
  130. d-i tzconfig/gmt boolean true
  131. d-i tzconfig/choose_country_zone/Europe select Zurich
  132. d-i tzconfig/choose_country_zone_single boolean true
  133. d-i time/zone select Europe/Zurich
  134. d-i clock-setup/utc boolean false
  135. d-i clock-setup/ntp boolean true
  136. d-i clock-setup/ntp-server 0.ch.pool.ntp.org
  137. # User Creation
  138. ########################################
  139. # Root User
  140. d-i passwd/root-login boolean false
  141. #d-i passwd/root-password password Jessie
  142. #d-i passwd/root-password-again password Jessie
  143. # User Creation
  144. d-i passwd/make-user boolean true
  145. d-i passwd/user-fullname string Linux User
  146. d-i passwd/username string linuxuser
  147. d-i passwd/user-password password tux
  148. d-i passwd/user-password-again password tux
  149. # The user account will be added to some standard initial groups. To
  150. # override that, use this.
  151. #d-i passwd/user-default-groups string audio cdrom video
  152. # Software Selections
  153. ########################################
  154. # debconf priority in the target system
  155. debconf debconf/priority select critical
  156. # Choose software to install:
  157. tasksel tasksel/first multiselect standard, xfce-desktop, ssh-server, laptop
  158. d-i pkgsel/include string puppet sudo git vim
  159. # allow ctrl+alt+backspace to terminate the X server
  160. keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean true
  161. # disable predictable network interface names
  162. d-i debian-installer/add-kernel-opts string net.ifnames=0
  163. # remove the spare partition
  164. d-i preseed/late_command string \
  165. in-target apt-get install -y grub-pc-bin grub-efi-amd64-bin; \
  166. sdadisk=$(ls /dev | grep 'sda'); \
  167. nvmedisk=$(ls /dev | grep 'nvme0n1'); \
  168. emmcdisk=$(ls /dev | grep 'mmcblk0'); \
  169. if [ "$nvmedisk" ]; \
  170. then \
  171. echo -e "d\n5\nw\n" | fdisk /dev/nvme0n1; true; \
  172. in-target grub-install --target=i386-pc /dev/nvme0n1; \
  173. elif [ "$sdadisk" ]; \
  174. then \
  175. echo -e "d\n5\nw\n" | fdisk /dev/sda; true; \
  176. in-target grub-install --target=i386-pc /dev/sda; \
  177. elif [ "$emmcdisk" ]; \
  178. then \
  179. echo -e "d\n5\nw\n" | fdisk /dev/mmcblk0; true; \
  180. in-target grub-install --target=i386-pc /dev/mmcblk0; \
  181. fi; \
  182. in-target git clone https://notabug.org/LiohMoeller/installbox.git /tmp/installbox; \
  183. in-target puppet apply /tmp/installbox/puppet/installbox/site.pp --modulepath=/tmp/installbox/puppet/installbox/modules --verbose --debug --color false; \
  184. rm -rf /target/tmp/installbox/; \
  185. exit 0;