8025-Configure_grub_startup_machine #39

Merged
xavi merged 4 commits from 8025-Configure_grub_startup_machine into main 2024-10-25 11:46:23 +00:00
Member
No description provided.
xavi added 3 commits 2024-10-24 14:38:55 +00:00
juan requested changes 2024-10-25 09:16:10 +00:00
Dismissed
@ -0,0 +141,4 @@
fi
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
else
echo "menuentry '$(echo "$os" | grub_quote)' --unrestricted ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
Owner

En lugar de copiar el fichero entero, usar una de las siguientes opciones:

  • Modificar fichero 10_linux usando una expresion regular (menos elegante)
  • Hacer un divert de update-grub y rescribirlo utilizando sed despues de llamar al comando original
  • Alterar variable menuentry_id_option en /etc/grub.d/09_unrestricted para añadir --unrestricted a todas las opciones

Ejemplo divert:

dpkg-divert --divert /usr/sbin/update-grub.diverted --rename /usr/sbin/update-grub

cat >> /usr/sbin/update-grub <<EOF
#!/bin/sh
set -e
/usr/sbin/update-grub.diverted \$@
sed -i -E "s/^(menuentry\s+'[^']+')/\1 --unrestricted/" /boot/grub/grub.cfg
EOF
chmod a+x /usr/sbin/update-grub

Enlaces:

En lugar de copiar el fichero entero, usar una de las siguientes opciones: - Modificar fichero _10_linux_ usando una expresion regular (menos elegante) - Hacer un divert de `update-grub` y rescribirlo utilizando _sed_ despues de llamar al comando original - Alterar variable `menuentry_id_option` en _/etc/grub.d/09_unrestricted_ para añadir `--unrestricted` a todas las opciones Ejemplo divert: ``` dpkg-divert --divert /usr/sbin/update-grub.diverted --rename /usr/sbin/update-grub cat >> /usr/sbin/update-grub <<EOF #!/bin/sh set -e /usr/sbin/update-grub.diverted \$@ sed -i -E "s/^(menuentry\s+'[^']+')/\1 --unrestricted/" /boot/grub/grub.cfg EOF chmod a+x /usr/sbin/update-grub ``` Enlaces: - https://docs.ansible.com/ansible/latest/collections/community/general/dpkg_divert_module.html - https://wiki.archlinux.org/title/Talk:GRUB/Tips_and_tricks
Author
Member
We use this approach https://wiki.archlinux.org/title/Talk:GRUB/Tips_and_tricks
xavi marked this conversation as resolved
xavi added 1 commit 2024-10-25 10:01:21 +00:00
xavi added 1 commit 2024-10-25 10:47:35 +00:00
xavi added 1 commit 2024-10-25 11:08:15 +00:00
juan approved these changes 2024-10-25 11:44:17 +00:00
xavi merged commit 2aacafb8b9 into main 2024-10-25 11:46:23 +00:00
xavi deleted branch 8025-Configure_grub_startup_machine 2024-10-25 11:46:23 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/vn-ansible#39
No description provided.