aboutsummaryrefslogtreecommitdiffstats
path: root/boot.ipxe.tpl
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2018-06-27 12:55:19 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2018-08-11 09:46:57 +0000
commit2682f6a7441fe2b549f19d5453e9f8c785305bc2 (patch)
treeac397530a123d97c224d4bad8fd80a2b0dd8ea7c /boot.ipxe.tpl
parent0995c816219a8f6c700e58e6bcca32331cd5529c (diff)
downloadalpine-netboot-2682f6a7441fe2b549f19d5453e9f8c785305bc2.tar.bz2
alpine-netboot-2682f6a7441fe2b549f19d5453e9f8c785305bc2.tar.xz
use images from offical mirrorHEADmaster
Do not generate images locally but instead generate signatures locally and use images from offical mirror. - generate ipxe boot script from template - add option to start sshd with firstboot - add version information when selecting branch - verify netboot releases with gpg signature - added ncopa.asc gpg public key
Diffstat (limited to 'boot.ipxe.tpl')
-rw-r--r--boot.ipxe.tpl132
1 files changed, 132 insertions, 0 deletions
diff --git a/boot.ipxe.tpl b/boot.ipxe.tpl
new file mode 100644
index 0000000..8f5db38
--- /dev/null
+++ b/boot.ipxe.tpl
@@ -0,0 +1,132 @@
+#!ipxe
+
+set os Alpine Linux
+iseq ${ipxe_cloud_config} packet && set provider (Packet.net) ||
+iseq ${alpine_loader} true && set img_verify enabled || set img_verify disabled
+set console tty0 ||
+set cmdline {{{cmdline}}} ||
+set default_cmdline default ||
+set start_sshd no ||
+set branch {{{default.branch}}} ||
+set version {{{default.version}}} ||
+set flavor {{{default.flavor}}} ||
+iseq ${buildarch} arm64 && goto arm64 ||
+cpuid --ext 29 && goto x86_64 || goto x86
+
+:arm64
+set arch aarch64 ||
+set acpi acpi=force ||
+set console ttyAMA0 ||
+iseq ${ipxe_cloud_config} packet && set console ttyAMA0,115200 ||
+goto menu
+
+:x86_64
+set arch x86_64 ||
+iseq ${ipxe_cloud_config} packet && set console ttyS1,115200n8 ||
+goto menu
+
+:x86
+set arch x86 ||
+goto menu
+
+:menu
+set space:hex 20:20
+set space ${space:string}
+menu ${os} ${provider} [ ${arch} ]
+item --gap Boot options
+item branch ${space} Alpine version [ ${branch} ]
+iseq ${arch} x86_64 && item flavor ${space} Kernel flavor [ ${flavor} ] ||
+iseq ${alpine_loader} true && item img_verify ${space} Image verification [ ${img_verify} ] ||
+item cmdline ${space} Linux cmdline [ ${default_cmdline} ]
+item console ${space} Set console [ ${console} ]
+item start_sshd ${space} Start sshd at first boot [ ${start_sshd} ]
+item --gap Booting
+item boot ${space} Boot with above settings
+item --gap Utilities
+item shell ${space} iPXE Shell
+item reboot ${space} Reboot system
+choose item
+goto ${item}
+
+:branch
+menu ${os} ${provider} [ ${arch} ]
+{{#releases}}
+item {{{branch}}} Version {{{version}}}
+{{/releases}}
+choose branch || goto shell
+{{#releases}}
+iseq branch {{{branch}}} && set version {{{version}}} ||
+{{/releases}}
+goto menu
+
+:flavor
+menu ${os} ${provider} [ ${arch} ]
+{{#flavors}}
+item {{{.}}} Linux {{{.}}}
+{{/flavors}}
+choose flavor || goto shell
+goto menu
+
+:console
+menu ${os} ${provider} [ ${arch} ]
+{{#consoles}}
+item {{{.}}} Console on {{{.}}}
+{{/consoles}}
+item custom Enter custom console
+choose console || goto menu
+iseq ${console} custom && goto custom_console ||
+goto menu
+
+:custom_console
+clear console
+echo -n Enter console: && read console
+goto menu
+
+:shell
+echo Type "exit" to return to menu.
+shell
+goto menu
+
+:img_verify
+iseq ${img_verify} enabled && set img_verify disabled || set img_verify enabled
+goto menu
+
+:cmdline
+echo -n Enter extra cmdline options:${space} && read cmdline
+set default_cmdline modified
+goto menu
+
+:start_sshd
+clear start_sshd
+echo -n Enter url to ssh key:${space} && read ssh_key
+isset ${ssh_key} && set start_sshd yes || set start_sshd no
+iseq ${start_sshd} yes && set ssh_key ssh_key=${ssh_key} || clear ssh_key
+goto menu
+
+:boot
+isset ${console} && set console console=${console} ||
+set mirror {{{mirror}}}
+set img-url ${mirror}/${branch}/releases/${arch}/netboot-${version}
+set sig-url sigs/${branch}/${arch}/${version}
+set repo-url ${mirror}/${branch}/main
+set modloop-url ${img-url}/modloop-${flavor}
+imgfree
+kernel ${img-url}/vmlinuz-${flavor} ${cmdline} alpine_repo=${repo-url} modloop=${modloop-url} ${console} ${acpi} ${ssh_key}
+initrd ${img-url}/initramfs-${flavor}
+iseq ${img_verify} enabled && goto verify_img || goto no_img_verify
+:verify_img
+imgverify vmlinuz-${flavor} ${sig-url}/vmlinuz-${flavor}.sig
+imgverify initramfs-${flavor} ${sig-url}/initramfs-${flavor}.sig
+:no_img_verify
+boot
+goto alpine_exit
+
+:reboot
+reboot
+
+:poweroff
+poweroff
+
+:alpine_exit
+clear menu
+exit 0