add autoexec, rework uri

This commit is contained in:
Richard Mauer 2024-12-27 20:46:21 -05:00
parent b93a4e99b6
commit d5ad21c3a6

View File

@ -8,17 +8,24 @@ let
cmdlineinitrds = builtins.concatStringsSep " " (builtins.map (name: "initrd=${name}") (builtins.attrNames initrds)); cmdlineinitrds = builtins.concatStringsSep " " (builtins.map (name: "initrd=${name}") (builtins.attrNames initrds));
in in
runCommand "netboot" { runCommand "netboot" {
pxe = '' autoexec-ipxe = ''
#!ipxe
dhcp
set path netboot
chain http://''${next_server}/''${path}/netboot.ipxe
'';
netboot-ipxe = ''
#!ipxe #!ipxe
## Variables ## Variables
set server 172.16.1.6 set server 172.16.1.6
set path netboot set path netboot
set source ''${uri}
## ##
:custom :custom
clear custom_choice clear custom_choice
menu NixOS netboot installer menu NixOS netboot installer
item --gap Role Installers item --gap Role Installers
item option_one ''${space} Boot NixOS item nix-netboot_1 ''${space} Boot NixOS
item option_two ''${space} Loading an ISO item option_two ''${space} Loading an ISO
item --gap Testing Tools (incomplete) item --gap Testing Tools (incomplete)
item option_three ''${space} Loads another custom sub menu item option_three ''${space} Loads another custom sub menu
@ -28,18 +35,15 @@ runCommand "netboot" {
goto ''${custom_choice} goto ''${custom_choice}
goto custom_exit goto custom_exit
:option_one :nix_netboot_1
kernel http://''${server}/''${path}/${pkgs.stdenv.hostPlatform.linux-kernel.target} kernel ${pkgs.stdenv.hostPlatform.linux-kernel.target}
${builtins.concatStringsSep "\n" (builtins.attrValues (builtins.mapAttrs (name: path: "initrd http://\${server}/\${path}/${name}") initrds))} ${builtins.concatStringsSep "\n" (builtins.attrValues (builtins.mapAttrs (name: path: "initrd ${name}") initrds))}
#initrd http://''${server}/''${path}/initrd
#initrd http://''${server}/''${path}/manifest
#initrd http://''${server}/''${path}/nix-store
imgargs ${pkgs.stdenv.hostPlatform.linux-kernel.target} init=${config.system.build.toplevel}/init ${cmdlineinitrds} ${toString config.boot.kernelParams} imgargs ${pkgs.stdenv.hostPlatform.linux-kernel.target} init=${config.system.build.toplevel}/init ${cmdlineinitrds} ${toString config.boot.kernelParams}
boot || goto custom_exit boot || goto custom_exit
:option_two :option_two
kernel http://''${server}/''${path}/memdisk iso raw kernel memdisk iso raw
initrd http://''${server}/archlinux/iso/latest/archlinux-x86_64.iso initrd http://mirror.mauer.tech/archlinux/iso/latest/archlinux-x86_64.iso
boot || goto custom_exit boot || goto custom_exit
:option_three :option_three
@ -70,7 +74,8 @@ runCommand "netboot" {
) )
)} )}
set +x set +x
echo "$pxe" > netboot.ipxe echo "$autoexec-ipxe" > autoexec.ipxe
echo "$netboot-ipxe" > netboot.ipxe
cd .. cd ..
mv stage $out mv stage $out