#!ipxe # Default settings set version 3.22.0 set branch v3.22 set flavor virt set console tty0 set custom_cmdline set ssh_key_url set start_sshd no set show_advanced no # Detect architecture cpuid --ext 29 && set arch x86_64 || set arch x86 iseq ${arch} x86_64 && set arch_display x86_64 || set arch_display x86 (32-bit) :menu menu item --key b boot [B] Boot Alpine Linux item --gap item --key k kernel [K] Kernel: ${flavor} item --key s ssh [S] SSH configuration item --key h hardware [H] Hardware options iseq ${show_advanced} yes && item --key v version [V] Version: ${version} || iseq ${show_advanced} no && item --key v version [V] Show more options || item --gap item --key r reboot [R] Reboot item --key x shell [X] iPXE Shell choose --timeout 10000 --default boot selected || goto boot goto ${selected} :boot echo echo >> Preparing to boot Alpine Linux ${version}... # Set up URLs - Using HTTP for compatibility set mirror http://dl-cdn.alpinelinux.org/alpine set img-url ${mirror}/${branch}/releases/${arch}/netboot-${version} set repo-url ${mirror}/${branch}/main set modloop-url ${img-url}/modloop-${flavor} set apkvol-url https://tenejo.lambdacreate.com/static/delay-modloop.apkvol.tar.gz # Build kernel command line with extended timeouts and retry options set boot_cmdline console=${console} modules=loop,squashfs quiet nomodeset alpine_repo=${repo-url} modloop=${modloop-url} apkvol=${apkvol-url} # Add networking and download timeout parameters set boot_cmdline ${boot_cmdline} modloop_timeout=600 modloop_retries=5 # Add general network timeout increases set boot_cmdline ${boot_cmdline} netdev_max_backlog=5000 net.core.rmem_max=16777216 net.core.wmem_max=16777216 isset ${custom_cmdline} && set boot_cmdline ${boot_cmdline} ${custom_cmdline} || iseq ${start_sshd} yes && set boot_cmdline ${boot_cmdline} ssh_key=${ssh_key_url} || # Clear any existing images first imgfree echo >> Loading kernel... kernel ${img-url}/vmlinuz-${flavor} ${boot_cmdline} || goto boot_error echo >> Loading initramfs... initrd ${img-url}/initramfs-${flavor} || goto boot_error echo >> Kernel and initramfs loaded successfully! echo >> Booting Alpine Linux ${version}... echo >> NOTE: Modloop download may take 2-3 minutes during boot boot || goto boot_error :kernel menu Kernel Selection item --key v virt [V] Virtual (virt) item --key l lts [L] Long Term Support (lts) item --gap item --key b back [B] Back to main menu choose selected || goto menu iseq ${selected} back && goto menu || iseq ${selected} virt && set flavor virt || iseq ${selected} lts && set flavor lts || goto menu :ssh menu SSH Configuration item --key e enable [E] Enable SSH with key URL item --key d disable [D] Disable SSH item --gap item --key b back [B] Back to main menu choose selected || goto menu iseq ${selected} back && goto menu || iseq ${selected} disable && goto ssh_disable || iseq ${selected} enable && goto ssh_enable || goto menu :ssh_enable echo echo Enter the URL to your SSH public key: echo (e.g., https://github.com/username.keys) echo (e.g., https://gitlab.com/username.keys) echo echo -n SSH Key URL: && read ssh_key_url isset ${ssh_key_url} && set start_sshd yes || set start_sshd no goto menu :ssh_disable set start_sshd no clear ssh_key_url goto menu :hardware echo Current hardware-specific options: isset ${custom_cmdline} && echo " ${custom_cmdline}" || echo " (none set)" menu Hardware Options item --key p presets [P] Hardware presets item --key c custom [C] Custom kernel parameters item --key r remove [R] Remove all custom options item --gap item --key b back [B] Back to main menu choose selected || goto menu iseq ${selected} back && goto menu || goto hardware_${selected} :hardware_presets echo menu Hardware Presets item --key i intel [I] Intel systems (IOMMU + graphics) item --key a amd [A] AMD systems (IOMMU + power) item --key v vmware [V] VMware guest item --key h hyper [H] Hyper-V guest item --key p proxmox [P] Proxmox VE guest item --key q qemu [Q] QEMU/KVM guest item --key n nvidia [N] NVIDIA graphics item --key t realtek [T] Realtek network issues item --gap item --key b back [B] Back to hardware menu choose selected || goto hardware iseq ${selected} back && goto hardware || iseq ${selected} intel && set custom_cmdline intel_iommu=on iommu=pt i915.modeset=1 || iseq ${selected} amd && set custom_cmdline amd_iommu=on iommu=pt acpi_osi=Linux || iseq ${selected} vmware && set custom_cmdline vmware-vga.enable_fbdev=1 vmxnet3.allow_guest_csum_rx=1 || iseq ${selected} hyper && set custom_cmdline video=hyperv_fb:1920x1080 hv_netvsc.ring_size=32 || iseq ${selected} proxmox && set custom_cmdline elevator=noop transparent_hugepage=never || iseq ${selected} qemu && set custom_cmdline virtio_net.napi_weight=128 || iseq ${selected} nvidia && set custom_cmdline nouveau.modeset=0 nvidia-drm.modeset=1 || iseq ${selected} realtek && set custom_cmdline r8169.use_dac=0 r8169.speed=100 || goto menu :hardware_custom echo echo Enter hardware-specific kernel parameters: echo echo Common examples: echo IOMMU: intel_iommu=on iommu=pt echo Graphics: nomodeset i915.modeset=0 echo Network: r8169.use_dac=0 igb.RSS=1 echo Power: acpi=off noapic nolapic echo echo -n Custom parameters: && read custom_cmdline goto menu :hardware_remove clear custom_cmdline goto menu :version iseq ${show_advanced} yes && goto version_menu || set show_advanced yes goto menu :version_menu echo Current: Alpine Linux ${version} (${branch}) menu Version Selection item --gap Latest Releases item --key 22 v322 [2] Alpine 3.22.0 (latest stable) item --key 21 v321 [1] Alpine 3.21.0 item --gap LTS Releases item --key 20 v320 [0] Alpine 3.20.3 (LTS - June 2025) item --key 19 v319 [9] Alpine 3.19.4 (LTS - May 2024) item --key 18 v318 [8] Alpine 3.18.6 (LTS - May 2023) item --gap Other item --key c custom [C] Enter custom version item --key h hide [H] Hide advanced options item --gap item --key b back [B] Back to main menu choose selected || goto menu iseq ${selected} back && goto menu || iseq ${selected} hide && set show_advanced no && goto menu || iseq ${selected} v322 && set version 3.22.0 && set branch v3.22 || iseq ${selected} v321 && set version 3.21.0 && set branch v3.21 || iseq ${selected} v320 && set version 3.20.3 && set branch v3.20 || iseq ${selected} v319 && set version 3.19.4 && set branch v3.19 || iseq ${selected} v318 && set version 3.18.6 && set branch v3.18 || iseq ${selected} custom && goto version_custom || goto menu :version_custom echo echo Enter Alpine version details: echo echo Examples: echo Version: 3.19.4 Branch: v3.19 echo Version: 3.17.7 Branch: v3.17 echo echo -n Version (e.g., 3.19.4): && read version echo -n Branch (e.g., v3.19): && read branch goto menu :boot_error echo echo X Boot failed! echo echo Version: ${version} (${branch}) echo Architecture: ${arch} echo Kernel: ${flavor} echo echo Possible causes: echo - Network connectivity issues echo - Version doesn't exist for your architecture echo - Kernel/initramfs download failed echo - Server certificate issues echo echo Solutions: echo - Try different version ([V] to change) echo - Test network with: ping dl-cdn.alpinelinux.org echo - Use iPXE shell ([X]) to debug manually echo echo Press any key to return to menu... prompt goto menu :shell echo echo Entering iPXE shell. Type 'exit' to return to menu. echo echo Useful debugging commands: echo ipxe> dhcp - Renew DHCP lease echo ipxe> ifstat - Show network interfaces echo ipxe> ping 8.8.8.8 - Test internet connectivity echo ipxe> kernel http://... - Test downloading kernel manually echo ipxe> imgstat - Show loaded images echo echo To test Alpine manually: echo ipxe> kernel http://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86_64/netboot-3.22.0/vmlinuz-virt console=tty0 alpine_repo=http://dl-cdn.alpinelinux.org/alpine/v3.22/main modloop=http://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86_64/netboot-3.22.0/modloop-virt echo ipxe> initrd http://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86_64/netboot-3.22.0/initramfs-virt echo ipxe> boot echo shell goto menu :reboot echo echo Rebooting system... reboot :exit exit 0