Bug 90845 - Consider porting to libfdisk (instead of gdisk / partman)
Summary: Consider porting to libfdisk (instead of gdisk / partman)
Status: NEW
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium minor
Assignee: Martin Pitt
QA Contact:
Depends on:
Reported: 2015-06-04 12:50 UTC by Andreas Henriksson
Modified: 2015-06-04 17:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Andreas Henriksson 2015-06-04 12:50:10 UTC
Instead of calling out and invoking external commands sgdisk and partman, you should be able to do the same things with libfdisk which will give you a proper C API. Since recent versions of util-linux (v2.26) libfdisk is now a public shared library with API stability guarantees. It can handle both old-style MBR layout as well as new-style GPT layout.

Comment 1 Andreas Henriksson 2015-06-04 17:02:40 UTC
on a related note, udisks2 seems to also use sfdisk with the now *deprecated* --change-id commandline option.

Here's the util-linux commit message:

commit 8eab3194ce1737a167812d5e84d83b0dfc253fac
Author: Karel Zak <kzak@redhat.com>
Date:   Mon Sep 15 12:37:52 2014 +0200

    sfdisk: add --parttype
    The patch also makes --{id,change-id,print-id} deprecated in favour
    of --parttype. The original --id is too generic option name and the
    --print-id and --change-id are unnecessary and inconsistent with
    another sfdisk options (e.g. we don't have --change-bootable)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.