Commit 048b1361 authored by Daniele's avatar Daniele
Browse files

Changing grub2.install again, so that it restores the old configuration also...

Changing grub2.install again, so that it restores the old configuration also when the package is upgraded.

That is because grub2 1.99 did own /boot/grub/grub.cfg, so upgrading to grub2 2.00 would result in that file being moved to its .pacsave entry.
To avoid this, which would break systems, I'll restore the old configuration, so that the configuration on disk and the bootloader in the MBR should match.
Any other choice (automatically run grub-mkconfig, or automatically run grub-install) is conceptually wrong and could lead to unwanted results or broken systems.
parent 27e669a6
......@@ -8,11 +8,17 @@ show_important_message() {
echo -e "\033[0;0m Also you can run \033[0;32m 'update-grub' \033[0;0m as root for generating grub.cfg"
}
post_install() {
restore_grubcfg() {
if [ -f /boot/grub/grub.cfg.pacsave ]; then
echo "Copying /boot/grub/grub.cfg.pacsave to /boot/grub/grub.cfg"
install -D -m644 /boot/grub/grub.cfg.pacsave /boot/grub/grub.cfg
echo -n "Copying /boot/grub/grub.cfg.pacsave to /boot/grub/grub.cfg... "
install -D -m644 /boot/grub/grub.cfg.pacsave \
/boot/grub/grub.cfg
echo "done."
fi
}
post_install() {
restore_grubcfg
echo -n "Generating grub.cfg.example config file... "
grub-mkconfig -o /boot/grub/grub.cfg.example 2> /dev/null
......@@ -26,6 +32,8 @@ post_install() {
}
post_upgrade() {
restore_grubcfg
for file in "${filelist[@]}"; do
install-info "${infodir}/${file}.gz" "${infodir}/dir" 2> /dev/null
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment