Skip to content

Draft: parted_server: SET_FLAGS: Set only the last type flag (#1093565)

Pascal Hambourg requested to merge pham/partman-base:parted_type_flag into master

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1093565 for the full story.

Type flags (libparted abstractions for partition type identifiers) are mutually exclusive and a higher priority flag masks a lower priority flag. When partman scripts use SET_FLAG to change the partition type, they do not always remove the current flag but the new type flag is always sent last. So setting only the last type flag will avoid it to be masked by the current flag.

This change actually checks if each flag is a known abstraction for an attribute (currently "boot", "hidden", "legacy_boot", "no_automount" and "lba") with a few approximations.

  • On msdos disk label, "hidden" and "lba" are modifiers for fat16/fat32/ntfs types.
  • On gpt, mac and sun disk labels, "boot" is a type (=esp) but it has the lowest priority, so it cannot mask other type flags.
  • On amiga disk label, "lvm" and "raid" are attributes but they are only informative and setting them toguether does not make sense so I think it is acceptable to make them mutually exclusive.
  • On mac disk label, "root" and "swap" are partition names but I think it is acceptable to make them mutually exclusive with types ("boot", "lvm" and "raid").

It would be more accurate to use different flag lists for each supported disk label type but I am not sure it is worth the effort. Opinions welcome.

EDIT: Added commit implementing per-disk label flag classification.

Closes: 1093565

Edited by Pascal Hambourg

Merge request reports

Loading