try to add custom menuentry

This commit is contained in:
LinuxSquare 2023-07-16 20:18:31 +02:00
parent 481ba3610e
commit c723fb437b
2 changed files with 37 additions and 8 deletions

View file

@ -52,7 +52,6 @@ system_bootloader_mkinitfs_conf:
- require:
- system_base_pkgs
- system_bootloader_pkgs
- system_bootloader_install
system_bootloader_os-release:
file.keyvalue:
@ -63,14 +62,33 @@ system_bootloader_os-release:
- uncomment: '# '
- key_ignore_case: False
- append_if_not_found: True
- require:
- system_base_pkgs
- system_bootloader_pkgs
system_bootloader_cmdline:
file.append:
- name: /etc/default/grub
- text: 'GRUB_CMDLINE_LINUX_DEFAULT="root="LABEL=ROOT" rootflags=subvol=@root_{{ CURRENT_SUBVOLUME_TIMESTAMP }} lockdown=confidentiality"'
system_bootloader_remove_default_menuentry:
file.blockreplace:
- name: /efi/grub/grub.cfg
- marker_start: "### BEGIN /etc/grub.d/10_linux ###"
- marker_end: "### END /etc/grub.d/10_linux ###"
- content: ""
- require:
- system_bootloader_install
- system_bootloader_config
{% CUSTOM_MENUENTRY_HEADER = salt['cmd.shell']('head -n5 /etc/grub.d/40_custom') %}
system_bootloader_menuentry:
file.blockreplace:
- name: /etc/grub.d/40_custom
- marker_start: "#!/bin/sh"
- marker_end: "# the 'exec tail' line above."
- source: salt://{{ tpldir }}/files/bootloader_menuentry
- template: jinja
- context:
CURRENT_SUBVOLUME_TIMESTAMP_HUMAN: {{ CURRENT_SUBVOLUME_TIMESTAMP_HUMAN }}
CURRENT_SUBVOLUME_TIMESTAMP: {{ CURRENT_SUBVOLUME_TIMESTAMP }}
- require:
- system_base_pkgs
- system_bootloader_pkgs
- system_bootloader_remove_default_menuentry
file.append:
- name: /etc/grub.d/40_custom
- content: {{ CUSTOM_MENUENTRY_HEADER }}

View file

@ -0,0 +1,11 @@
menuentry 'Noveria Alpine {{ CURRENT_SUBVOLUME_TIMESTAMP_HUMAN }}' --class alpine --class gnu-linux --class os $menuentry_id_option 'alpine-{{ CURRENT_SUBVOLUME_TIMESTAMP }}' {
load_video
insmod gzio
insmod part_gpt
insmod btrfs
search --nofloppy --label --set=root ROOT
echo 'Loading Linuzx lts ...'
linux /@root_{{ CURRENT_SUBVOLUME_TIMESTAMP }}/boot/vmlinuz-lts root=LABEL=ROOT rootflags=subvol=@root_{{ CURRENT_SUBVOLUME_TIMESTAMP }} lockdown=confidentiality
echo 'Loading initial ramdisk ...'
initrd /@root_{{ CURRENT_SUBVOLUME_TIMESTAMP }}/boot/initramfs-lts
}