debi.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. #!/bin/sh
  2. # shellcheck shell=dash
  3. set -eu
  4. err() {
  5. echo "Error: $1." 1>&2
  6. exit 1
  7. }
  8. command_exists() {
  9. command -v "$1" > /dev/null 2>&1
  10. }
  11. # Sets variable:
  12. late_command=
  13. in_target() {
  14. local command=
  15. for argument in "$@"; do
  16. command="$command $argument"
  17. done
  18. if [ -n "$command" ]; then
  19. [ -z "$late_command" ] && late_command='true'
  20. late_command="$late_command;$command"
  21. fi
  22. }
  23. in_target_backup() {
  24. in_target "if [ ! -e \"$1.backup\" ]; then cp \"$1\" \"$1.backup\"; fi"
  25. }
  26. configure_sshd() {
  27. # !isset($sshd_config_backup)
  28. [ -z ${sshd_config_backup+1s} ] && in_target_backup /etc/ssh/sshd_config
  29. sshd_config_backup=
  30. in_target sed -Ei \""s/^#?$1 .+/$1 $2/"\" /etc/ssh/sshd_config
  31. }
  32. prompt_password() {
  33. local prompt=
  34. if [ $# -gt 0 ]; then
  35. prompt=$1
  36. elif [ "$username" = root ]; then
  37. prompt="Choose a password for the root user: "
  38. else
  39. prompt="Choose a password for user $username: "
  40. fi
  41. stty -echo
  42. trap 'stty echo' EXIT
  43. while [ -z "$password" ]; do
  44. echo -n "$prompt" > /dev/tty
  45. read -r password < /dev/tty
  46. echo > /dev/tty
  47. done
  48. stty echo
  49. trap - EXIT
  50. }
  51. download() {
  52. if command_exists wget; then
  53. wget -O "$2" "$1"
  54. elif command_exists curl; then
  55. curl -fL "$1" -o "$2"
  56. elif command_exists busybox && busybox wget --help > /dev/null 2>&1; then
  57. busybox wget -O "$2" "$1"
  58. else
  59. err 'Cannot find "wget", "curl" or "busybox wget" to download files'
  60. fi
  61. }
  62. ip=
  63. netmask=
  64. gateway=
  65. dns='8.8.8.8 8.8.4.4'
  66. hostname=
  67. network_console=false
  68. suite=buster
  69. daily_d_i=false
  70. mirror_protocol=http
  71. mirror_host=deb.debian.org
  72. mirror_directory=/debian
  73. security_repository=http://security.debian.org/debian-security
  74. security_archive=buster/updates
  75. account_setup=true
  76. username=debian
  77. password=
  78. authorized_keys_url=
  79. sudo_with_password=false
  80. timezone=UTC
  81. ntp=0.debian.pool.ntp.org
  82. disk_partitioning=true
  83. disk=
  84. force_gpt=true
  85. efi=
  86. filesystem=ext4
  87. kernel=
  88. cloud_kernel=false
  89. bpo_kernel=false
  90. install_recommends=true
  91. install='ca-certificates libpam-systemd'
  92. upgrade=
  93. kernel_params=
  94. bbr=false
  95. hold=false
  96. power_off=false
  97. architecture=
  98. boot_directory=
  99. firmware=false
  100. force_efi_extra_removable=true
  101. grub_timeout=5
  102. dry_run=false
  103. while [ $# -gt 0 ]; do
  104. case $1 in
  105. --cdn|--aws)
  106. mirror_protocol=https
  107. [ "$1" = '--aws' ] && mirror_host=cdn-aws.deb.debian.org
  108. security_repository=mirror
  109. ;;
  110. --china)
  111. dns='223.5.5.5 223.6.6.6'
  112. mirror_protocol=https
  113. mirror_host=mirrors.aliyun.com
  114. ntp=ntp.aliyun.com
  115. security_repository=mirror
  116. ;;
  117. --ip)
  118. ip=$2
  119. shift
  120. ;;
  121. --netmask)
  122. netmask=$2
  123. shift
  124. ;;
  125. --gateway)
  126. gateway=$2
  127. shift
  128. ;;
  129. --dns)
  130. dns=$2
  131. shift
  132. ;;
  133. --hostname)
  134. hostname=$2
  135. shift
  136. ;;
  137. --network-console)
  138. network_console=true
  139. ;;
  140. --version)
  141. case $2 in
  142. 9|stretch)
  143. suite=stretch
  144. daily_d_i=false
  145. security_archive=stretch/updates
  146. ;;
  147. 10|buster)
  148. suite=buster
  149. daily_d_i=false
  150. security_archive=buster/updates
  151. ;;
  152. 11|bullseye)
  153. suite=bullseye
  154. daily_d_i=true
  155. security_archive=bullseye-security
  156. ;;
  157. *)
  158. err "Unsupported version: $2"
  159. esac
  160. shift
  161. ;;
  162. --suite)
  163. suite=$2
  164. case $2 in
  165. bullseye|testing)
  166. daily_d_i=true
  167. security_archive="$suite-security"
  168. ;;
  169. sid|unstable)
  170. daily_d_i=true
  171. security_archive=''
  172. ;;
  173. *)
  174. daily_d_i=false
  175. security_archive="$suite/updates"
  176. esac
  177. shift
  178. ;;
  179. --release-d-i)
  180. daily_d_i=false
  181. ;;
  182. --daily-d-i)
  183. daily_d_i=true
  184. ;;
  185. --mirror-protocol)
  186. mirror_protocol=$2
  187. shift
  188. ;;
  189. --https)
  190. mirror_protocol=https
  191. ;;
  192. --mirror-host)
  193. mirror_host=$2
  194. shift
  195. ;;
  196. --mirror-directory)
  197. mirror_directory=${2%/}
  198. shift
  199. ;;
  200. --security-repository)
  201. security_repository=$2
  202. shift
  203. ;;
  204. --no-user|--no-account-setup)
  205. account_setup=false
  206. ;;
  207. --user|--username)
  208. username=$2
  209. shift
  210. ;;
  211. --password)
  212. password=$2
  213. shift
  214. ;;
  215. --authorized-keys-url)
  216. authorized_keys_url=$2
  217. shift
  218. ;;
  219. --sudo-with-password)
  220. sudo_with_password=true
  221. ;;
  222. --timezone)
  223. timezone=$2
  224. shift
  225. ;;
  226. --ntp)
  227. ntp=$2
  228. shift
  229. ;;
  230. --no-part|--no-disk-partitioning)
  231. disk_partitioning=false
  232. ;;
  233. --disk)
  234. disk=$2
  235. shift
  236. ;;
  237. --no-force-gpt)
  238. force_gpt=false
  239. ;;
  240. --bios)
  241. efi=false
  242. ;;
  243. --efi)
  244. efi=true
  245. ;;
  246. --filesystem)
  247. filesystem=$2
  248. shift
  249. ;;
  250. --kernel)
  251. kernel=$2
  252. shift
  253. ;;
  254. --cloud-kernel)
  255. cloud_kernel=true
  256. ;;
  257. --bpo-kernel)
  258. bpo_kernel=true
  259. ;;
  260. --no-install-recommends)
  261. install_recommends=false
  262. ;;
  263. --install)
  264. install=$2
  265. shift
  266. ;;
  267. --no-upgrade)
  268. upgrade=none
  269. ;;
  270. --safe-upgrade)
  271. upgrade=safe-upgrade
  272. ;;
  273. --full-upgrade)
  274. upgrade=full-upgrade
  275. ;;
  276. --ethx)
  277. kernel_params="$kernel_params net.ifnames=0 biosdevname=0"
  278. ;;
  279. --bbr)
  280. bbr=true
  281. ;;
  282. --hold)
  283. hold=true
  284. ;;
  285. --power-off)
  286. power_off=true
  287. ;;
  288. --architecture)
  289. architecture=$2
  290. shift
  291. ;;
  292. --boot-directory)
  293. boot_directory=$2
  294. shift
  295. ;;
  296. --firmware)
  297. firmware=true
  298. ;;
  299. --no-force-efi-extra-removable)
  300. force_efi_extra_removable=false
  301. ;;
  302. --grub-timeout)
  303. grub_timeout=$2
  304. shift
  305. ;;
  306. --dry-run)
  307. dry_run=true
  308. ;;
  309. *)
  310. err "Unknown option: \"$1\""
  311. esac
  312. shift
  313. done
  314. [ -z "$architecture" ] && {
  315. architecture=$(dpkg --print-architecture 2> /dev/null) || {
  316. case $(uname -m) in
  317. x86_64)
  318. architecture=amd64
  319. ;;
  320. aarch64)
  321. architecture=arm64
  322. ;;
  323. i386)
  324. architecture=i386
  325. ;;
  326. *)
  327. err 'No "--architecture" specified'
  328. esac
  329. }
  330. }
  331. [ -z "$kernel" ] && {
  332. kernel="linux-image-$architecture"
  333. [ "$cloud_kernel" = true ] && {
  334. [ "$architecture" != amd64 ] && [ "$architecture" != arm64 ] &&
  335. err 'Cloud kernel is only available for amd64 (x86_64) and arm64 (aarch64) architectures'
  336. kernel="linux-image-cloud-$architecture"
  337. }
  338. [ "$bpo_kernel" = true ] && {
  339. [ "$suite" != buster ] && [ "$suite" != stretch ] &&
  340. err 'Backports kernel is only available for 10 (buster) and 9 (stretch)'
  341. install="$kernel/$suite-backports $install"
  342. }
  343. }
  344. [ -n "$authorized_keys_url" ] && ! download "$authorized_keys_url" /dev/null &&
  345. err "Failed to download SSH authorized public keys from \"$authorized_keys_url\""
  346. installer="debian-$suite"
  347. installer_directory="/boot/$installer"
  348. save_preseed='cat'
  349. [ "$dry_run" = false ] && {
  350. [ "$(id -u)" -ne 0 ] && err 'root privilege is required'
  351. rm -rf "$installer_directory"
  352. mkdir -p "$installer_directory"
  353. cd "$installer_directory"
  354. save_preseed='tee -a preseed.cfg'
  355. }
  356. if [ "$account_setup" = true ]; then
  357. prompt_password
  358. elif [ "$network_console" = true ] && [ -z "$authorized_keys_url" ]; then
  359. prompt_password "Choose a password for the installer user of the SSH network console: "
  360. fi
  361. $save_preseed << 'EOF'
  362. # Localization
  363. d-i debian-installer/language string en
  364. d-i debian-installer/country string US
  365. d-i debian-installer/locale string en_US.UTF-8
  366. d-i keyboard-configuration/xkb-keymap select us
  367. # Network configuration
  368. d-i netcfg/choose_interface select auto
  369. EOF
  370. [ -n "$ip" ] && {
  371. echo 'd-i netcfg/disable_autoconfig boolean true' | $save_preseed
  372. echo "d-i netcfg/get_ipaddress string $ip" | $save_preseed
  373. [ -n "$netmask" ] && echo "d-i netcfg/get_netmask string $netmask" | $save_preseed
  374. [ -n "$gateway" ] && echo "d-i netcfg/get_gateway string $gateway" | $save_preseed
  375. [ -z "${ip%%*:*}" ] && [ -n "${dns%%*:*}" ] && dns='2001:4860:4860::8888 2001:4860:4860::8844'
  376. [ -n "$dns" ] && echo "d-i netcfg/get_nameservers string $dns" | $save_preseed
  377. echo 'd-i netcfg/confirm_static boolean true' | $save_preseed
  378. }
  379. if [ -n "$hostname" ]; then
  380. echo "d-i netcfg/hostname string $hostname" | $save_preseed
  381. hostname=debian
  382. domain=
  383. else
  384. hostname=$(cat /proc/sys/kernel/hostname)
  385. domain=$(cat /proc/sys/kernel/domainname)
  386. if [ "$domain" = '(none)' ]; then
  387. domain=
  388. else
  389. domain=" $domain"
  390. fi
  391. fi
  392. $save_preseed << EOF
  393. d-i netcfg/get_hostname string $hostname
  394. d-i netcfg/get_domain string$domain
  395. EOF
  396. echo 'd-i hw-detect/load_firmware boolean true' | $save_preseed
  397. [ "$network_console" = true ] && {
  398. $save_preseed << 'EOF'
  399. # Network console
  400. d-i anna/choose_modules string network-console
  401. d-i preseed/early_command string anna-install network-console
  402. EOF
  403. if [ -n "$authorized_keys_url" ]; then
  404. echo "d-i network-console/authorized_keys_url string $authorized_keys_url" | $save_preseed
  405. else
  406. $save_preseed << EOF
  407. d-i network-console/password password $password
  408. d-i network-console/password-again password $password
  409. EOF
  410. fi
  411. echo 'd-i network-console/start select Continue' | $save_preseed
  412. }
  413. $save_preseed << EOF
  414. # Mirror settings
  415. d-i mirror/country string manual
  416. d-i mirror/protocol string $mirror_protocol
  417. d-i mirror/$mirror_protocol/hostname string $mirror_host
  418. d-i mirror/$mirror_protocol/directory string $mirror_directory
  419. d-i mirror/$mirror_protocol/proxy string
  420. d-i mirror/suite string $suite
  421. EOF
  422. [ "$account_setup" = true ] && {
  423. password_hash=$(mkpasswd -m sha-256 "$password" 2> /dev/null) ||
  424. password_hash=$(openssl passwd -5 "$password" 2> /dev/null) ||
  425. password_hash=$(busybox mkpasswd -m sha256 "$password" 2> /dev/null) || {
  426. for python in python3 python python2; do
  427. password_hash=$("$python" -c 'import crypt, sys; print(crypt.crypt(sys.argv[1], crypt.mksalt(crypt.METHOD_SHA256)))' "$password" 2> /dev/null) && break
  428. done
  429. }
  430. $save_preseed << 'EOF'
  431. # Account setup
  432. EOF
  433. [ -n "$authorized_keys_url" ] && configure_sshd PasswordAuthentication no
  434. if [ "$username" = root ]; then
  435. if [ -z "$authorized_keys_url" ]; then
  436. configure_sshd PermitRootLogin yes
  437. else
  438. in_target "mkdir -m 0700 -p ~root/.ssh && busybox wget -O- \"$authorized_keys_url\" >> ~root/.ssh/authorized_keys"
  439. fi
  440. $save_preseed << 'EOF'
  441. d-i passwd/root-login boolean true
  442. d-i passwd/make-user boolean false
  443. EOF
  444. if [ -z "$password_hash" ]; then
  445. $save_preseed << EOF
  446. d-i passwd/root-password password $password
  447. d-i passwd/root-password-again password $password
  448. EOF
  449. else
  450. echo "d-i passwd/root-password-crypted password $password_hash" | $save_preseed
  451. fi
  452. else
  453. configure_sshd PermitRootLogin no
  454. [ -n "$authorized_keys_url" ] &&
  455. in_target "sudo -u $username mkdir -m 0700 -p ~$username/.ssh && busybox wget -O - \"$authorized_keys_url\" | sudo -u $username tee -a ~$username/.ssh/authorized_keys"
  456. [ "$sudo_with_password" = false ] &&
  457. in_target "echo \"$username ALL=(ALL:ALL) NOPASSWD:ALL\" > \"/etc/sudoers.d/90-user-$username\""
  458. $save_preseed << EOF
  459. d-i passwd/root-login boolean false
  460. d-i passwd/make-user boolean true
  461. d-i passwd/user-fullname string
  462. d-i passwd/username string $username
  463. EOF
  464. if [ -z "$password_hash" ]; then
  465. $save_preseed << EOF
  466. d-i passwd/user-password password $password
  467. d-i passwd/user-password-again password $password
  468. EOF
  469. else
  470. echo "d-i passwd/user-password-crypted password $password_hash" | $save_preseed
  471. fi
  472. fi
  473. }
  474. $save_preseed << EOF
  475. # Clock and time zone setup
  476. d-i time/zone string $timezone
  477. d-i clock-setup/utc boolean true
  478. d-i clock-setup/ntp boolean true
  479. d-i clock-setup/ntp-server string $ntp
  480. EOF
  481. [ "$disk_partitioning" = true ] && {
  482. $save_preseed << 'EOF'
  483. # Partitioning
  484. d-i partman-auto/method string regular
  485. EOF
  486. if [ -n "$disk" ]; then
  487. echo "d-i partman-auto/disk string $disk" | $save_preseed
  488. else
  489. # shellcheck disable=SC2016
  490. echo 'd-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n 1)"' | $save_preseed
  491. fi
  492. [ "$force_gpt" = true ] && echo 'd-i partman-partitioning/default_label string gpt' | $save_preseed
  493. echo "d-i partman/default_filesystem string $filesystem" | $save_preseed
  494. [ -z "$efi" ] && {
  495. efi=false
  496. [ -d /sys/firmware/efi ] && efi=true
  497. }
  498. $save_preseed << 'EOF'
  499. d-i partman-auto/expert_recipe string \
  500. naive :: \
  501. EOF
  502. if [ "$efi" = true ]; then
  503. $save_preseed << 'EOF'
  504. 106 106 106 free \
  505. $iflabel{ gpt } \
  506. $reusemethod{ } \
  507. method{ efi } \
  508. format{ } \
  509. . \
  510. EOF
  511. else
  512. $save_preseed << 'EOF'
  513. 1 1 1 free \
  514. $iflabel{ gpt } \
  515. $reusemethod{ } \
  516. method{ biosgrub } \
  517. . \
  518. EOF
  519. fi
  520. $save_preseed << 'EOF'
  521. 1075 1076 -1 $default_filesystem \
  522. method{ format } \
  523. format{ } \
  524. use_filesystem{ } \
  525. $default_filesystem{ } \
  526. mountpoint{ / } \
  527. .
  528. EOF
  529. echo 'd-i partman-auto/choose_recipe select naive' | $save_preseed
  530. $save_preseed << 'EOF'
  531. d-i partman-basicfilesystems/no_swap boolean false
  532. d-i partman/choose_partition select finish
  533. d-i partman/confirm boolean true
  534. d-i partman/confirm_nooverwrite boolean true
  535. EOF
  536. }
  537. $save_preseed << EOF
  538. # Base system installation
  539. d-i base-installer/kernel/image string $kernel
  540. EOF
  541. [ "$install_recommends" = false ] && echo "d-i base-installer/install-recommends boolean $install_recommends" | $save_preseed
  542. [ "$security_repository" = mirror ] && security_repository=$mirror_protocol://$mirror_host${mirror_directory%/*}/debian-security
  543. # If not sid/unstable
  544. [ -n "$security_archive" ] && {
  545. $save_preseed << EOF
  546. # Apt setup
  547. d-i apt-setup/services-select multiselect updates, backports
  548. d-i apt-setup/local0/repository string $security_repository $security_archive main
  549. d-i apt-setup/local0/source boolean true
  550. EOF
  551. }
  552. $save_preseed << 'EOF'
  553. # Package selection
  554. tasksel tasksel/first multiselect ssh-server
  555. EOF
  556. [ -n "$install" ] && echo "d-i pkgsel/include string $install" | $save_preseed
  557. [ -n "$upgrade" ] && echo "d-i pkgsel/upgrade select $upgrade" | $save_preseed
  558. $save_preseed << 'EOF'
  559. popularity-contest popularity-contest/participate boolean false
  560. # Boot loader installation
  561. d-i grub-installer/bootdev string default
  562. EOF
  563. [ "$force_efi_extra_removable" = true ] && echo 'd-i grub-installer/force-efi-extra-removable boolean true' | $save_preseed
  564. [ -n "$kernel_params" ] && echo "d-i debian-installer/add-kernel-opts string$kernel_params" | $save_preseed
  565. $save_preseed << 'EOF'
  566. # Finishing up the installation
  567. EOF
  568. [ "$hold" = false ] && echo 'd-i finish-install/reboot_in_progress note' | $save_preseed
  569. [ "$bbr" = true ] && in_target '{ echo "net.core.default_qdisc=fq"; echo "net.ipv4.tcp_congestion_control=bbr"; } > /etc/sysctl.d/bbr.conf'
  570. [ -n "$late_command" ] && echo "d-i preseed/late_command string in-target sh -c '$late_command'" | $save_preseed
  571. [ "$power_off" = true ] && echo 'd-i debian-installer/exit/poweroff boolean true' | $save_preseed
  572. save_grub_cfg='cat'
  573. [ "$dry_run" = false ] && {
  574. base_url="$mirror_protocol://$mirror_host$mirror_directory/dists/$suite/main/installer-$architecture/current/images/netboot/debian-installer/$architecture"
  575. [ "$daily_d_i" = true ] && base_url="https://d-i.debian.org/daily-images/$architecture/daily/netboot/debian-installer/$architecture"
  576. firmware_url="https://cdimage.debian.org/cdimage/unofficial/non-free/firmware/$suite/current/firmware.cpio.gz"
  577. download "$base_url/linux" linux
  578. download "$base_url/initrd.gz" initrd.gz
  579. [ "$firmware" = true ] && download "$firmware_url" firmware.cpio.gz
  580. gzip -d initrd.gz
  581. # cpio reads a list of file names from the standard input
  582. echo preseed.cfg | cpio -o -H newc -A -F initrd
  583. gzip -9 initrd
  584. mkdir -p /etc/default/grub.d
  585. tee /etc/default/grub.d/zz-debi.cfg 1>&2 << EOF
  586. GRUB_DEFAULT=debi
  587. GRUB_TIMEOUT=$grub_timeout
  588. GRUB_TIMEOUT_STYLE=menu
  589. EOF
  590. if command_exists update-grub; then
  591. grub_cfg=/boot/grub/grub.cfg
  592. update-grub
  593. elif command_exists grub2-mkconfig; then
  594. tmp=$(mktemp)
  595. grep -vF zz_debi /etc/default/grub > "$tmp"
  596. cat "$tmp" > /etc/default/grub
  597. rm "$tmp"
  598. # shellcheck disable=SC2016
  599. echo 'zz_debi=/etc/default/grub.d/zz-debi.cfg; if [ -f "$zz_debi" ]; then . "$zz_debi"; fi' >> /etc/default/grub
  600. grub_cfg=/boot/grub2/grub.cfg
  601. grub2-mkconfig -o "$grub_cfg"
  602. else
  603. err 'Could not find "update-grub" or "grub2-mkconfig" command'
  604. fi
  605. save_grub_cfg="tee -a $grub_cfg"
  606. }
  607. [ -z "$boot_directory" ] && {
  608. if grep -q '\s/boot\s' /proc/mounts; then
  609. boot_directory=/
  610. else
  611. boot_directory=/boot/
  612. fi
  613. }
  614. installer_directory="$boot_directory$installer"
  615. # shellcheck disable=SC2034
  616. mem=$(grep ^MemTotal: /proc/meminfo | { read -r x y z; echo "$y"; })
  617. [ $((mem / 1024)) -le 512 ] && kernel_params="$kernel_params lowmem/low=1"
  618. initrd="$installer_directory/initrd.gz"
  619. [ "$firmware" = true ] && initrd="$initrd $installer_directory/firmware.cpio.gz"
  620. $save_grub_cfg 1>&2 << EOF
  621. menuentry 'Debian Installer' --id debi {
  622. insmod part_msdos
  623. insmod part_gpt
  624. insmod ext2
  625. linux $installer_directory/linux$kernel_params
  626. initrd $initrd
  627. }
  628. EOF