Discussion:
Bug#1087489: [RFD] partman: Add support of the 'legacy_boot' flag to manual partitioning
(too old to reply)
Pascal Hambourg
2024-11-14 10:20:01 UTC
Permalink
Package: partman-base
Version: 229
Affects: partman-partitioning partman-efi

It was reported that setting the 'legacy_boot' flag to the boot/root
partition on GPT disk label was required in order to boot on some arm64
platforms [1]. Support of this flag was recently added to automatic
partitioning in partman-auto [2], and should also be added to manual
partitioning.

[1] <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1078871#67>
[2] <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1086051>

How should this be exposed to the user ?

The 'boot' flag is shown as "B" in the main display (by partman-base)
and as "Bootable flag" in partition settings (by partman-partitioning,
which is not very consistent IMO).

As the 'legacy_boot' flag is available only on GPT and the 'boot' flag
is irrelevant (=esp) on GPT and should be ignored, the same displays
could be used for both flags:
- GPT -> manage 'legacy_boot' flag, ignore 'boot' flag
- non-GPT -> manage 'boot' flag

My first questions:

- In the main display, should the 'legacy_boot' flag be shown with the
same marker "B" as the 'boot' flag ?

- In partition settings, should the 'legacy_boot' flag be shown with the
same label "Bootable flag" as the 'boot' flag ?
Pascal Hambourg
2024-11-20 12:40:01 UTC
Permalink
As the 'legacy_boot' flag is available only on GPT and the 'boot' flag is
irrelevant (=esp) on GPT and should be ignored, the same displays could be
- GPT -> manage 'legacy_boot' flag, ignore 'boot' flag
- non-GPT -> manage 'boot' flag
- In the main display, should the 'legacy_boot' flag be shown with the
same marker "B" as the 'boot' flag ?
- In partition settings, should the 'legacy_boot' flag be shown with the
same label "Bootable flag" as the 'boot' flag ?
No answers so far, so I propose to answer "yes" to both questions. Less
change, no extra translation effort. Objections ?
John Paul Adrian Glaubitz
2024-11-20 13:10:01 UTC
Permalink
Hi Pascal,
Post by Pascal Hambourg
As the 'legacy_boot' flag is available only on GPT and the 'boot' flag is
irrelevant (=esp) on GPT and should be ignored, the same displays could be
- GPT -> manage 'legacy_boot' flag, ignore 'boot' flag
- non-GPT -> manage 'boot' flag
- In the main display, should the 'legacy_boot' flag be shown with the
same marker "B" as the 'boot' flag ?
- In partition settings, should the 'legacy_boot' flag be shown with the
same label "Bootable flag" as the 'boot' flag ?
No answers so far, so I propose to answer "yes" to both questions. Less
change, no extra translation effort. Objections ?
Can you elaborate on this a little more to explain the background?

Doesn't this affect partman-efi only?

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Pascal Hambourg
2024-11-20 18:40:01 UTC
Permalink
Hi Adrian,
Post by John Paul Adrian Glaubitz
Can you elaborate on this a little more to explain the background?
I thought the initial bug submission provided enough background.

Some arm64 platforms need the 'legacy_boot' flag to boot on GPT but
support of this flag was missing in partman. Support was added for
guided/automatic partitioning in partman-auto but is still missing for
manual partitioning.

As part of supporting the 'legacy_boot' flag, manual partitioning needs
to do the same as what it does for the 'boot' flag:
- show the state of the flag in the main view
- add an option to toggle the flag in the partition settings view

The 'legacy_boot' flag exists only on GPT and the 'boot' flag is
irrelevant on GPT (it just reflects the 'esp' flag set on EFI system
partitions). So instead of adding new visuals for the 'legacy_boot'
option, it should be possible to use the same visuals as the 'boot' flag:
- GPT: use visuals with the 'legacy_boot' flag
- other disk labels: use visuals with the 'boot' flag
Post by John Paul Adrian Glaubitz
Doesn't this affect partman-efi only?
It does not affect partman-efi but it may be affected by it it depending
on the chosen implementation because partman-efi touches the 'bootable'
flag file used by partman-base to display the 'B' marker.

In any case partman-efi should not touch the 'boot' flag (the 'esp' flag
is enough) nor the 'bootable' flag file: on MSDOS the 'boot' flag is
independent and irrelevant for ESP partitions and on GPT it is redundant
and just reflects the 'esp' flag. The current interaction between
partman-efi and partman-base has unexpected side effects. Fixing this is
also part of my plans.
Holger Wansing
2024-11-21 04:20:01 UTC
Permalink
Hi,
As the 'legacy_boot' flag is available only on GPT and the 'boot' flag is
irrelevant (=esp) on GPT and should be ignored, the same displays could be
- GPT -> manage 'legacy_boot' flag, ignore 'boot' flag
- non-GPT -> manage 'boot' flag
- In the main display, should the 'legacy_boot' flag be shown with the same marker "B" as the 'boot' flag ?
- In partition settings, should the 'legacy_boot' flag be shown with the same label "Bootable flag" as the 'boot' flag ?
No answers so far, so I propose to answer "yes" to both questions. Less change, no extra translation effort. Objections ?
I guess not.
Please go ahead.


Holger
--
Sent from /e/ OS on Fairphone3
Pascal Hambourg
2024-12-23 00:00:02 UTC
Permalink
Post by Holger Wansing
Please go ahead.
Now going into technical implementation details.

Script partman-partitioning/active_partition/toggle_bootable/choices
enables the "Bootable flag" toggle in partition settings.

Script partman-partitioning/active_partition/toggle_bootable/do_option
sets or clears the 'boot' flag.

Script partman-base/update.d/bootable syncs the "bootable" file in the
partition directory with the 'boot' flag state.

Script partman-base/visual.d/bootable prints "B" in the partition view
if the "bootable" file is present in the partition directory.

The same "bootable" file could be sync'ed with the 'legacy_boot' flag on
GPT but other packages (I found partman-efi and partman-newworld) also
interact with the 'boot' flag and the "bootable" file. partman-newworld
was removed from the Debian archive years ago and was built only for
powermac architectures (which do not use GPT) so it should not be an
issue. However sync'ing the "bootable" file with the 'legacy_boot' flag
interferes with partman-efi logic (in update.d/efi_sync_flag) and
conversely [1].

So for now I chose to sync a separate file with the 'legacy_boot' flag.
I also chose to do minimal changes to existing code rather than
optimizing it, resulting in the following two merge requests for
partman-base and partman-partitioning:

<https://salsa.debian.org/installer-team/partman-base/-/merge_requests/11>
<https://salsa.debian.org/installer-team/partman-partitioning/-/merge_requests/5>

[1] IMO partman-efi logic is flawed and should be fixed because it
interferes with the 'boot' flag logic in partman-base in unexpected ways.
Debian Bug Tracking System
2025-01-10 21:40:01 UTC
Permalink
Your message dated Fri, 10 Jan 2025 21:26:43 +0000
with message-id <E1tWMWh-001FuY-***@fasolo.debian.org>
and subject line Bug#1087489: fixed in partman-base 232
has caused the Debian Bug report #1087489,
regarding [RFD] partman: Add support of the 'legacy_boot' flag to manual partitioning
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ***@bugs.debian.org
immediately.)
--
1087489: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087489
Debian Bug Tracking System
Contact ***@bugs.debian.org with problems
Loading...