Re: can't get grub to use /etc/default/grub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

On Sun, 25 Nov 2018 12:40:08 -0500 Christopher wrote:

> personally, I'd prefer we just run mkconfig after kernel updates.

I do the same, but automatically by adding a script:

  /etc/kernel/postinst.d/setup-grub-cfg

that does:

------------------------------ cut here ------------------------------
#!/bin/bash -p

PATH=/sbin:/bin:/usr/sbin:/usr/bin

# Regenerates grub.cfg in posttrans of a kernel installation.

# Assumes that /etc/default/grub is already setup properly.

date=$(date '+%Y-%m-%d-%H-%M-%S')

grub2conf=$(readlink -f /etc/grub2-efi.cfg)
if ! [ -f "$grub2conf" ]; then
    grub2conf=$(readlink -f /etc/grub2.cfg)
fi

cp -pf $grub2conf $grub2conf-$date

grub2-mkconfig -o $grub2conf || {
    # grub2-mkconfig is safe: do not install if it fails.
    echo '*** /sbin/grub2-mkconfig failed. Aborting'
    exit 1
}

# Suppress the current saved_entry: potentially wrong since one
# rebuilds grub.cfg.
grub2-editenv - unset saved_entry

------------------------------ cut here ------------------------------

-- 
francis
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux