• migrating grub from BIOS to UEFI loses /etc/default/grub

    From Harald Dunkel@21:1/5 to All on Fri May 24 11:20:01 2024
    Hi folks,

    if I migrate a bookworm installation from grub-pc to grub-uefi,
    then grub-pc.postrm removes /etc/default/grub on the final purge.

    AFAICT /etc/default/grub is still processed for UEFI, so why
    is it deleted?

    Regards
    Harri

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pascal Hambourg@21:1/5 to Harald Dunkel on Fri May 24 20:40:01 2024
    On 24/05/2024 at 11:08, Harald Dunkel wrote:

    if I migrate a bookworm installation from grub-pc to grub-uefi,
    then grub-pc.postrm removes /etc/default/grub on the final purge.

    AFAICT /etc/default/grub is still processed for UEFI, so why
    is it deleted?

    It is a known bug. At the very least, /etc/default/grub should be
    removed only if it belongs to the package being purged. But it would
    solve your issue only if postinst configure (taking ownership) happens
    before postrm purge.

    In the end I believe /etc/default/grub should be owned by grub2-common,
    not by each grub-<target> package.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Dunkel@21:1/5 to Pascal Hambourg on Sun May 26 16:10:01 2024
    On 2024-05-24 20:36:41, Pascal Hambourg wrote:


    It is a known bug.

    This is a highly destructive bug. You have UEFI boot finally working,
    you just do some cleanup, and on the next reboot of your server 8
    weeks later it doesn't boot anymore. :-(

    AFAICT the problem is the config file isn't properly managed by *any*
    package:

    # dpkg -S /etc/default/grub
    dpkg-query: no path found matching pattern /etc/default/grub

    Doesn't this violate some Debian policy manual? I remember something
    about not unconditionally overwriting config files.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Felix Zielcke@21:1/5 to All on Sun May 26 18:20:02 2024
    Am Sonntag, dem 26.05.2024 um 16:08 +0200 schrieb Harald Dunkel:
    On 2024-05-24 20:36:41, Pascal Hambourg wrote:


    It is a known bug.

    This is a highly destructive bug. You have UEFI boot finally working,
    you just do some cleanup, and on the next reboot of your server 8
    weeks later it doesn't boot anymore. :-(

    AFAICT the problem is the config file isn't properly managed by *any* package:

    # dpkg -S /etc/default/grub
    dpkg-query: no path found matching pattern /etc/default/grub

    Doesn't this violate some Debian policy manual? I remember something
    about not unconditionally overwriting config files.


    It's managed by ucf:

    $ ucfq /etc/default/grub
    Configuration file Package Exists Changed
    /etc/default/grub grub-efi-amd64 Yes Yes


    But yes, this should probable be moved to grub2-common

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pascal Hambourg@21:1/5 to Harald Dunkel on Tue May 28 00:20:01 2024
    On 26/05/2024 à 16:08, Harald Dunkel wrote:

    This is a highly destructive bug. You have UEFI boot finally working,
    you just do some cleanup, and on the next reboot of your server 8
    weeks later it doesn't boot anymore. :-(

    On the other hand, I doubt many users care to purge the old grub package
    after installing another grub flavour. But I agree this should be fixed
    anyway. There are several options:

    - Remove /etc/default/grub only if it is associated with the package
    being purged in ucf.

    - Do not remove /etc/default/grub when purging package-<target> because
    it is used by grub-install and update-grub which belong to grub2-common;
    only remove it from ucf registry if it is associated with the package
    being purged.

    Also, it appears that grub-pc.postrm purge optionally removes files in /boot/grub which may have been installed for other grub targets
    (grub.cfg, fonts, locales, device.map, grubenv, background image cache).
    My opinion is that postrm should not touch /boot/grub at all. After all,
    it does not remove GRUB boot image and core image nor EFI partition
    contents.

    Grub-team people, any comments ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Felix Zielcke@21:1/5 to All on Thu May 30 12:10:01 2024
    Am Dienstag, dem 28.05.2024 um 00:16 +0200 schrieb Pascal Hambourg:
    - Remove /etc/default/grub only if it is associated with the package
    being purged in ucf.

    - Do not remove /etc/default/grub when purging package-<target>
    because
    it is used by grub-install and update-grub which belong to grub2-
    common;
    only remove it from ucf registry if it is associated with the package
    being purged.


    I did now a MR for this:

    https://salsa.debian.org/grub-team/grub/-/merge_requests/62

    Also, it appears that grub-pc.postrm purge optionally removes files
    in
    /boot/grub which may have been installed for other grub targets
    (grub.cfg, fonts, locales, device.map, grubenv, background image
    cache).
    My opinion is that postrm should not touch /boot/grub at all. After
    all,
    it does not remove GRUB boot image and core image nor EFI partition contents.

    Grub-team people, any comments ?


    d-boot is actually the wrong mailing list to discuss grub.
    Despite its name it's mostly for debian-installer.
    I don't know if the others are even subscribed to d-boot.

    /boot/grub for grub-pc is only purged if debconf has grub-pc/postrm_purge_boot_grub == true

    But I don't know the reason why unicode.pf2 is purged for grub-efi- {amd64,i386}

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pascal Hambourg@21:1/5 to Felix Zielcke on Thu May 30 16:10:01 2024
    On 30/05/2024 at 12:07, Felix Zielcke wrote:

    d-boot is actually the wrong mailing list to discuss grub.

    Right, so I posted a digest of this thread to the GRUB maintainer list
    for further discussion. <https://alioth-lists.debian.net/pipermail/pkg-grub-devel/2024-May/018887.html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)