Add new job to set the GPT partition label

Authored by gportay on Mar 18 2020, 6:24 PM.

Description

Add new job to set the GPT partition label

The GPT partition layout supports naming partitions.

The support for the partition label was added in the backend libparted
since commit 28fa6ac (Add support for GTP partition labels).

The libparted was removed later by commit 8fa1814 (Remove libparted
backend) and no backend sets the partition label.

The CLI sfdisk sets the partition label using the option --part-label.
See the examples below:

$ cat <<EOF | sfdisk disk.img
label: gpt
type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, size=64M
type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
EOF
(...)

$ sfdisk --part-label disk.img 1 efi
(...)

$ sfdisk --part-label disk.img 2 rootfs
(...)

$ sfdisk --dump disk.img
(...)
disk.img1 : start= 2048, size= 131072, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=D08E5B2A-4649-9F4A-AEA3-6C3048888EAA, name="efi"
disk.img2 : start= 133120, size= 1963999, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=0BEEFE82-19EA-DC4C-BB6A-27B6DA0C3BD2, name="rootfs"

This commit introduces the new job set-partition-label that is used in
the new-operation to set the label of the partition. The job uses the
newly introduced method setPartitionLabel that is implemented by the
sfdisk and dummy backends.

Details

Committed
gportayMar 25 2020, 3:20 PM
Parents
R16:59269f63df71: SVN_SILENT made messages (.desktop file) - always resolve ours
Branches
Unknown
Tags
Unknown