Explorar el Código

Adds option for adding early menu commands (#936)

    Adds option for adding early menu commands

    Enables the user to add an early block into menu
    for loading things like custom console backgrounds.

    Thanks to @commonism for the suggestion.

Co-authored-by: Markus Koetter <koetter@cispa.de>
Co-authored-by: Antony Messerli <antony@mes.ser.li>
commonism hace 3 años
padre
commit
a087a5bd75

+ 2 - 0
CHANGELOG.md

@@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
 ## [Unreleased]
 
 ## [2.0.43]
+### Added
+- Enables ability to add custom commands early in menu load with early_menu_*
 
 ## [2.0.42]
 ### Added

+ 4 - 0
roles/netbootxyz/defaults/main.yml

@@ -68,6 +68,10 @@ custom_generate_menus: false
 custom_github_menus: true
 custom_templates_dir: '{{ netbootxyz_conf_dir }}/custom'
 custom_url_menus: true
+early_menu_contents: |
+   ### early menu overrides
+   ### used to set early ipxe options such as custom console & logo
+early_menu_enabled: false
 generate_checksums: true
 generate_disks: true
 generate_disks_arm: false

+ 3 - 0
roles/netbootxyz/templates/menu/menu.ipxe.j2

@@ -1,4 +1,7 @@
 #!ipxe
+{% if early_menu_enabled -%}
+{{ early_menu_contents }}
+{%- endif %}
 
 :start
 chain --autofree boot.cfg ||

+ 7 - 0
user_overrides.yml

@@ -39,3 +39,10 @@ generate_local_vars: true
 # set licensed media locations in boot.cfg
 # win_base_url:
 # rhel_base_url: 
+
+early_menu_enabled: false
+early_menu_contents: |
+   ### early menu overrides
+   ### used to set early ipxe options such as custom console & logo
+   # console --x 1024 --y 768
+   # console --picture https://boot.netboot.xyz/logo.png