Răsfoiți Sursa

Split out Utils menus for 32-bit options

Testing out initially with systemrescue
Antony Messerli 3 ani în urmă
părinte
comite
52d7eb34d1

+ 12 - 1
roles/netbootxyz/defaults/main.yml

@@ -704,7 +704,7 @@ utilitiesefi:
     enabled: true
     name: System Rescue CD
     type: ipxemenu
-utilitiespcbios:
+utilitiespcbios64:
   4mlinux:
     enabled: true
     name: 4MLinux
@@ -804,5 +804,16 @@ utilitiespcbios:
     type: memdisk
     util_path: http://mirror.sysadminguide.net/ubcd/ubcd538.iso
     version: '538'
+utilitiespcbios32:
+  memtest:
+    enabled: true
+    name: Memtest
+    type: memtest
+    util_path: https://boot.netboot.xyz/utils/memtest86-5.01.0
+    version: 5.01.0
+  systemrescue:
+    enabled: true
+    name: System Rescue CD
+    type: ipxemenu
 wimboot_location: http://${boot_domain}/wimboot
 wimboot_upstream_url: https://github.com/ipxe/wimboot/releases/latest/download/wimboot

+ 4 - 2
roles/netbootxyz/templates/menu/menu.ipxe.j2

@@ -56,8 +56,10 @@ iseq ${menu_unix} 1 && item unix ${space} Unix Network Installs ||
 iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS ||
 iseq ${menu_windows} 1 && item windows ${space} Windows ||
 item --gap Tools:
-iseq ${menu_utils} 1 && item utils-${platform} ${space} Utilities ||
-iseq ${menu_utils_arm} 1 && item utils-arm ${space} Utilities ||
+iseq ${menu_utils} 1 && iseq ${platform} efi && item utils-efi ${space} Utilities (UEFI) ||
+iseq ${menu_utils} 1 && iseq ${platform} pcbios && iseq ${arch} x86_64 && item utils-pcbios-64 ${space} Utilities (64-bit) ||
+iseq ${menu_utils} 1 && iseq ${platform} pcbios && iseq ${arch} i386 && item utils-pcbios-32 ${space} Utilities (32-bit) ||
+iseq ${menu_utils_arm} 1 && item utils-arm ${space} Utilities (arm64) ||
 item change_arch ${space} Architecture: ${arch}
 item shell ${space} iPXE shell
 item netinfo ${space} Network card info

+ 5 - 2
roles/netbootxyz/templates/menu/systemrescue.ipxe.j2

@@ -4,12 +4,15 @@ goto ${menu} ||
 
 :live_menu
 set os System Rescue
+set os_arch ${arch}
+iseq ${os_arch} x86_64 && set os_arch amd64 ||
+iseq ${os_arch} i386 && set os_arch i686 ||
 menu ${os}
 set ipparam BOOTIF=${netX/mac} ip=dhcp net.ifnames=0
 item --gap ${os} Versions
 {% for key, value in endpoints.items() | sort %}
 {% if value.os == "systemrescue" %}
-item {{ value.version }} ${space} ${os} {{ value.version }}
+iseq ${os_arch} {{ value.arch }} && item {{ value.version }}_${os_arch} ${space} ${os} {{ value.version }} ||
 {% endif %}
 {% endfor %}
 choose live_version || goto live_exit
@@ -17,7 +20,7 @@ goto ${live_version}
 
 {% for key, value in endpoints.items() | sort %}
 {% if value.os == "systemrescue" %}
-:{{ value.version }}
+:{{ value.version }}_{{ value.arch }}
 set url ${live_endpoint}{{ value.path }}
 goto boot
 

+ 4 - 4
roles/netbootxyz/templates/menu/utils-pcbios.ipxe.j2 → roles/netbootxyz/templates/menu/utils-pcbios-32.ipxe.j2

@@ -3,7 +3,7 @@
 :utils_menu
 menu Utilities
 item --gap Utilities:
-{% for key, value in utilitiespcbios.items() | sort(attribute='1.name') %}
+{% for key, value in utilitiespcbios32.items() | sort(attribute='1.name') %}
 {% if value.enabled %}
 item {{ key }} ${space} {{ value.name }}
 {% endif %}
@@ -20,7 +20,7 @@ goto ${menu} ||
 chain ${menu}.ipxe || goto utils_exit
 goto utils_exit
 
-{% for key, value in utilitiespcbios.items() | sort %}
+{% for key, value in utilitiespcbios32.items() | sort %}
 {% if value.enabled | bool and value.type == "memdisk" %}
 :{{ key }}
 set util_path {{ value.util_path }}
@@ -30,7 +30,7 @@ goto boot_{{ value.type }}
 {% endif %}
 {% endfor %}
 
-{% for key, value in utilitiespcbios.items() | sort %}
+{% for key, value in utilitiespcbios32.items() | sort %}
 {% if value.enabled | bool and value.type == "direct" %}
 :{{ key }}
 imgfree
@@ -62,7 +62,7 @@ goto utils_menu
 
 :memtest
 imgfree
-kernel {{ utilitiespcbios.memtest.util_path }}
+kernel {{ utilitiespcbios32.memtest.util_path }}
 boot
 goto utils_menu
 

+ 97 - 0
roles/netbootxyz/templates/menu/utils-pcbios-64.ipxe.j2

@@ -0,0 +1,97 @@
+#!ipxe
+
+:utils_menu
+menu Utilities
+item --gap Utilities:
+{% for key, value in utilitiespcbios64.items() | sort(attribute='1.name') %}
+{% if value.enabled %}
+item {{ key }} ${space} {{ value.name }}
+{% endif %}
+{% endfor %}
+item --gap netboot.xyz tools:
+item cmdline ${space} Kernel cmdline params: [${cmdline}]
+item nbxyz_custom_url ${space} Set custom menu [url: ${custom_url}]
+item nbxyz_custom_github ${space} Set Github username [user: ${github_user}]
+item testdistro ${space} Test Distribution ISO
+item nbxyz ${space} netboot.xyz endpoints
+choose --default ${menu} menu || goto utils_exit
+echo ${cls}
+goto ${menu} ||
+chain ${menu}.ipxe || goto utils_exit
+goto utils_exit
+
+{% for key, value in utilitiespcbios64.items() | sort %}
+{% if value.enabled | bool and value.type == "memdisk" %}
+:{{ key }}
+set util_path {{ value.util_path }}
+set util_file {{ value.util_path | basename }}
+set util_version {{ value.version }}
+goto boot_{{ value.type }}
+{% endif %}
+{% endfor %}
+
+{% for key, value in utilitiespcbios64.items() | sort %}
+{% if value.enabled | bool and value.type == "direct" %}
+:{{ key }}
+imgfree
+kernel {{ value.kernel }}
+initrd {{ value.initrd }}
+boot
+goto utils_exit
+{% endif %}
+{% endfor %}
+
+:boot_memdisk
+imgfree
+kernel ${memdisk} iso raw
+initrd --name ${util_file} ${util_path}
+echo
+echo MD5sums:
+md5sum memdisk ${util_file}
+boot
+goto utils_exit
+
+:cmdline
+echo If you want to change the default kernel command line parameters
+echo you can override the defaults here.
+echo
+echo Currently set to: ${cmdline}
+echo
+echo -n Enter cmdline parameters: ${} && read cmdline
+goto utils_menu
+
+:memtest
+imgfree
+kernel {{ utilitiespcbios64.memtest.util_path }}
+boot
+goto utils_menu
+
+:nbxyz_custom_url
+echo If you have a customized menu you would like to load into netboot.xyz
+echo set the base path url to your custom ipxe files here. 
+echo It will look for custom.ipxe in that path as the entry point.
+echo
+echo -n Please enter your custom http url here: ${} && read custom_url
+goto utils_menu
+
+:nbxyz_custom_github
+echo Make sure you have a fork of https://github.com/netbootxyz/netboot.xyz-custom.
+echo You can then customize your fork as needed and set up your own custom options.
+echo Once your username is set, a custom option will appear on the main menu.
+echo
+echo -n Please enter your Github username: ${} && read github_user
+goto utils_menu
+
+:testdistro
+echo This option will allow you to test booting an ISO using memdisk. Please
+echo specify the URL of the ISO you want to test and it will automatically
+echo attempt to load the ISO using memdisk.
+echo -n URL: ${} && read distro_iso
+kernel ${memdisk} iso raw
+initrd ${distro_iso}
+boot
+goto utils_menu
+
+:utils_exit
+clear menu
+exit 0