]> git.ipfire.org Git - thirdparty/util-linux.git/commit
sfdisk: extend --part-type, support aliases
authorKarel Zak <kzak@redhat.com>
Tue, 3 Mar 2020 15:07:00 +0000 (16:07 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Mar 2020 15:15:39 +0000 (16:15 +0100)
commit5839a4ea032b47813d4be6406e6d1ad7ee33afe1
tree6eed3d0e91b51142c1f54344b0d753524f09ddb6
parentf94e753b35cf7a8bdd3a27edb72e094917757334
sfdisk: extend --part-type, support aliases

* add support for aliases to sfdisk scripts
* add shortcuts and aliases to --part-type command

Note that --part-type evaluates shortcuts and aliases as the last
possibility (so after regular type string). This is necessary for
backward compatibility.

Example ('raid' type alias):
 # sfdisk --part-type /dev/sdc 1 raid

 # fdisk -l /dev/sdc
 ...
 Device     Boot Start    End Sectors Size Id Type
 /dev/sdc1        2048 204799  202752  99M fd Linux raid autodetect

Example ('L' type shortcut):

 # sfdisk --part-type /dev/sdc 1 L

 # fdisk -l /dev/sdc
 ...
 Device     Boot Start    End Sectors Size Id Type
 /dev/sdc1        2048 204799  202752  99M 83 Linux

Addresses: https://github.com/karelzak/util-linux/issues/958
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.8
disk-utils/sfdisk.c