diff options
authorCarlo Landmeter <clandmeter@alpinelinux.org>2018-04-07 23:21:17 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2018-04-07 23:21:17 +0000
commitf4bf0065229c50b3dd3c8f60f21158ca51d145f7 (patch)
parent955730fbe508ce0e23ea44807cf51da34d851d46 (diff)
ipxe: improve default boot script
- support x86(_64) and arm64 - support for packet.net - add shell and reboot to menu - allow setting of console - allow adding custom cmdline options
1 files changed, 86 insertions, 8 deletions
diff --git a/boot.ipxe b/boot.ipxe
index 57127e4..217d7b2 100644
--- a/boot.ipxe
+++ b/boot.ipxe
@@ -1,27 +1,105 @@
set os Alpine Linux
-cpuid --ext 29 && set arch x86_64 || set arch x86
+iseq ${ipxe_cloud_config} packet && set provider (Packet.net) ||
+iseq ${alpine_loader} true && set img_verify true || set img_verify false
+set console tty0 ||
+set cmdline_extra none ||
+set release latest-stable ||
+iseq ${buildarch} arm64 && goto arm64 ||
+cpuid --ext 29 && goto x86_64 || goto x86
-imgtrust --permanent
+set arch aarch64 ||
+set acpi acpi=force ||
+set console ttyAMA0 ||
+iseq ${ipxe_cloud_config} packet && set console ttyAMA0,115200 ||
+goto menu
+set arch x86_64 ||
+iseq ${ipxe_cloud_config} packet && set console ttyS1,115200n8 ||
+goto menu
+set arch x86 ||
+goto menu
+set space:hex 20:20
+set space ${space:string}
+menu ${os} ${provider} [ ${arch} ]
+item --gap Boot options
+item release ${space} Choose release [ ${release} ]
+item console ${space} Set console [ ${console} ]
+iseq ${alpine_loader} true && item img_verify ${space} Image verification [ ${img_verify} ] ||
+item cmdline_extra ${space} Additional cmdline [ ${cmdline_extra} ]
+item boot ${space} Boot with above settings
+item --gap Utilities
+item shell ${space} iPXE Shell
+item reboot ${space} Reboot system
+choose item
+goto ${item}
menu ${os} [ ${arch} ]
item latest-stable Latest stable
item edge Edge (development)
-choose version || goto alpine_exit
-goto boot
+choose release || goto alpine_exit
+goto menu
+menu ${os} [ ${arch} ]
+item tty0 Console on tty0
+item ttyS0 Console on ttyS0
+item ttyS1 Console on ttyS1
+item ttyAMA0 Console on ttyAMA0 (aarch64)
+item custom Enter custom console
+choose console || goto menu
+iseq ${console} custom && goto custom_console ||
+goto menu
+clear console
+echo -n Enter console: && read console
+goto menu
+echo Type "exit" to return to menu.
+goto menu
+iseq ${img_verify} true && set img_verify false || set img_verify true
+goto menu
+clear cmdline_extra
+echo -n Enter extra cmdline options: && read cmdline_extra
+goto menu
-set img-url http://boot.alpinelinux.org/images/${version}/${arch}
-set repo-url http://dl-cdn.alpinelinux.org/alpine/${version}/main
+iseq ${cmdline_extra} none && clear cmdline_extra ||
+isset ${console} && set console console=${console} ||
+set img-url https://boot.alpinelinux.org/images/${release}/${arch}
+set repo-url http://dl-cdn.alpinelinux.org/alpine/${release}/main
-kernel ${img-url}/vmlinuz-vanilla alpine_repo=${repo-url} modules=loop,squashfs modloop=${img-url}/modloop-vanilla quiet nomodeset
-imgverify vmlinuz-vanilla ${img-url}/vmlinuz-vanilla.sig
+kernel ${img-url}/vmlinuz-vanilla initrd=initramfs-vanilla pkgs=libressl alpine_repo=${repo-url} modules=loop,squashfs modloop=${img-url}/modloop-vanilla nomodeset ${console} ${acpi} ${cmdline_extra}
initrd ${img-url}/initramfs-vanilla
+iseq ${img_verify} true && goto verify_img || goto no_img_verify
+imgverify vmlinuz-vanilla ${img-url}/vmlinuz-vanilla.sig
imgverify initramfs-vanilla ${img-url}/initramfs-vanilla.sig
goto alpine_exit
clear menu
exit 0