Feature/ipxe customization
parent
b5cb86950d
commit
1769770e79
|
@ -9,6 +9,24 @@
|
||||||
server_name: faiserver
|
server_name: faiserver
|
||||||
# ip of the server of the installer network
|
# ip of the server of the installer network
|
||||||
server_ip: 192.168.33.1
|
server_ip: 192.168.33.1
|
||||||
|
|
||||||
|
ipxe_additional_entries:
|
||||||
|
dban:
|
||||||
|
name: Memtest86+
|
||||||
|
files: tools/memtest
|
||||||
|
kernel: memtest86+-5.31b.bin
|
||||||
|
# other:
|
||||||
|
# files: path/to/files/to/copy
|
||||||
|
# name: Menu Entry
|
||||||
|
# initrd:
|
||||||
|
# - initrd0.img
|
||||||
|
# - initrd1.img
|
||||||
|
# - ...
|
||||||
|
# multiboot:
|
||||||
|
# - module0.img
|
||||||
|
# - module1.img
|
||||||
|
# - ...
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- fai
|
- fai
|
||||||
|
|
||||||
|
|
|
@ -19,3 +19,5 @@ tftp_dir: "/srv/tftp/fai"
|
||||||
http_mirror_ipxe_path_prefix: "ipxe"
|
http_mirror_ipxe_path_prefix: "ipxe"
|
||||||
http_mirror_fai_path_prefix: "fai"
|
http_mirror_fai_path_prefix: "fai"
|
||||||
|
|
||||||
|
ipxe_additional_entries:
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -10,16 +10,17 @@
|
||||||
with_items:
|
with_items:
|
||||||
- /usr/lib/ipxe/ipxe.efi
|
- /usr/lib/ipxe/ipxe.efi
|
||||||
- /usr/lib/ipxe/ipxe.pxe
|
- /usr/lib/ipxe/ipxe.pxe
|
||||||
|
- /usr/lib/ipxe/ipxe.lkrn
|
||||||
|
|
||||||
- name: write ipxe menu
|
- name: write ipxe menu
|
||||||
copy:
|
copy:
|
||||||
content: |
|
content: |
|
||||||
#!ipxe
|
#!ipxe
|
||||||
set boot-root {{ http_mirror_ipxe_root_url }}
|
set boot-root {{ http_mirror_ipxe_root_url }}
|
||||||
set menu-default fai
|
set menu-default __exit
|
||||||
set menu-timeout 5000
|
set menu-timeout 5000
|
||||||
set submenu-timeout ${menu-timeout}
|
set submenu-timeout ${menu-timeout}
|
||||||
isset ${menu-default} || set menu-default exit
|
isset ${menu-default} || set menu-default __exit
|
||||||
|
|
||||||
# Figure out if client is 64-bit capable
|
# Figure out if client is 64-bit capable
|
||||||
cpuid --ext 29 && set arch x64 || set arch x86
|
cpuid --ext 29 && set arch x64 || set arch x86
|
||||||
|
@ -27,53 +28,72 @@
|
||||||
|
|
||||||
:start
|
:start
|
||||||
menu iPXE boot menu
|
menu iPXE boot menu
|
||||||
item --key f fai FAI Installer
|
item --key x __exit Exit iPXE and continue local boot
|
||||||
item --gap --
|
item --gap --
|
||||||
item --key d dban Dariks boot and nuke (DBAN)
|
item --key f __fai FAI Installer
|
||||||
|
{% for k, v in ipxe_additional_entries.items() %}
|
||||||
|
item {% if 'key' in v %}--key v.key {% endif %}{{ k }} {% if 'name' in v %}{{ v.name }}{% else %}{{ k }}{% endif %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
item --gap --
|
item --gap --
|
||||||
item --key c config Configure settings
|
item __reload_after_fail Reload iPXE
|
||||||
item shell Drop to iPXE shell
|
item --gap --
|
||||||
item reboot Reboot computer
|
item --key c __config Configure settings
|
||||||
item
|
item __shell Drop to iPXE shell
|
||||||
item --key x exit Exit iPXE and continue BIOS boot
|
item __reboot Reboot computer
|
||||||
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
|
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
|
||||||
set menu-timeout 0
|
set menu-timeout 0
|
||||||
goto ${selected}
|
goto ${selected}
|
||||||
|
|
||||||
:cancel
|
:__cancel
|
||||||
echo You cancelled the menu, dropping you to a shell
|
echo You cancelled the menu, dropping you to a shell
|
||||||
|
|
||||||
:shell
|
:__shell
|
||||||
echo Type 'exit' to get the back to the menu
|
echo Type 'exit' to get the back to the menu
|
||||||
shell
|
shell
|
||||||
set menu-timeout 0
|
set menu-timeout 0
|
||||||
set submenu-timeout 0
|
set submenu-timeout 0
|
||||||
goto start
|
goto start
|
||||||
|
|
||||||
:failed
|
:__failed
|
||||||
echo Booting failed, dropping to shell
|
echo Booting failed, dropping to shell
|
||||||
goto shell
|
goto __shell
|
||||||
|
|
||||||
:config
|
:__config
|
||||||
config
|
config
|
||||||
goto start
|
goto start
|
||||||
|
|
||||||
:reboot
|
:__reload_after_fail
|
||||||
|
echo Reloading iPXE
|
||||||
|
sleep 3
|
||||||
|
chain --replace --autofree menu.ipxe || goto failed
|
||||||
|
|
||||||
|
:__reboot
|
||||||
reboot
|
reboot
|
||||||
|
|
||||||
:exit
|
:__exit
|
||||||
exit
|
exit
|
||||||
|
|
||||||
:fai
|
:__fai
|
||||||
kernel --name fai ${boot-root}/{{ fai_live_vmlinuz }} root=live:{{ http_mirror_fai_squashfs_url }} FAI_FLAGS=verbose,sshd,createv,menu FAI_CONFIG_SRC={{ http_mirror_fai_profiles_url }} FAI_ACTION=install net.ifnames=0 ip=dhcp
|
kernel ${boot-root}/{{ fai_live_vmlinuz }} root=live:{{ http_mirror_fai_squashfs_url }} FAI_FLAGS=verbose,sshd,createv,menu FAI_CONFIG_SRC={{ http_mirror_fai_profiles_url }} FAI_ACTION=install net.ifnames=0 ip=dhcp || goto __reload_after_fail
|
||||||
imgfetch --name fai ${boot-root}/{{ fai_live_initrd }}
|
initrd ${boot-root}/{{ fai_live_initrd }} || goto __reload_after_fail
|
||||||
boot || goto failed
|
boot || goto __reload_after_fail
|
||||||
goto start
|
goto start
|
||||||
|
|
||||||
:dban
|
{% for k, v in ipxe_additional_entries.items() %}{% if 'kernel' %}
|
||||||
kernel ${boot-root}/dban.bzi silent vga=785
|
|
||||||
boot || goto failed
|
:{{ k }}
|
||||||
goto start
|
kernel ${boot-root}/{{ k }}/{{ v.kernel }} {% if 'args' in v %}{{ v['args'] }}{% endif %} || goto __reload_after_fail
|
||||||
|
{% if 'initrd' in v %}{% for initrd in v.initrd %}
|
||||||
|
initrd ${boot-root}/{{ k }}/{{ initrd }} || goto __reload_after_fail
|
||||||
|
{% endfor %}{% endif %}
|
||||||
|
{% if 'module' in v %}{% for module in v.multiboot %}
|
||||||
|
module ${boot-root}/{{ k }}/{{ module }} || goto __reload_after_fail
|
||||||
|
{% endfor %}{% endif %}
|
||||||
|
boot || goto __reload_after_fail
|
||||||
|
goto start{% endif %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
dest: /srv/tftp/fai/menu.ipxe
|
dest: /srv/tftp/fai/menu.ipxe
|
||||||
mode: 0644
|
mode: 0644
|
||||||
owner: root
|
owner: root
|
||||||
|
|
|
@ -33,10 +33,11 @@
|
||||||
shell: "fai-cd -f -M -S {{ fai_squashfs_path }} -d {{ http_mirror_fai_profiles_url }}"
|
shell: "fai-cd -f -M -S {{ fai_squashfs_path }} -d {{ http_mirror_fai_profiles_url }}"
|
||||||
when: "not squash_img.stat.exists"
|
when: "not squash_img.stat.exists"
|
||||||
|
|
||||||
- name: copy dban image
|
- name: copy additional files
|
||||||
copy:
|
synchronize:
|
||||||
src: files/dban/dban.bzi
|
src: "{{ item.value.files }}/"
|
||||||
dest: "{{ ipxe_download_dir }}/dban.bzi"
|
dest: "{{ ipxe_download_dir }}/{{ item.key }}"
|
||||||
owner: root
|
mode: push
|
||||||
group: root
|
delete: yes
|
||||||
mode: u=rw,g=r,o=r
|
recursive: yes
|
||||||
|
with_dict: "{{ ipxe_additional_entries }}"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
*
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Additional tools für PXE menu
|
||||||
|
|
||||||
|
Content:
|
||||||
|
|
||||||
|
* *memtest* [Memtest86+](http://memtest.org)
|
Binary file not shown.
Loading…
Reference in New Issue