From ca67b09c015d4af3ae3cce12aa72e60941dbb8b5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:29:52 +0200 Subject: Adding debian version 2.06-13+deb12u1. Signed-off-by: Daniel Baumann --- debian/prep-bootdev.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 debian/prep-bootdev.c (limited to 'debian/prep-bootdev.c') diff --git a/debian/prep-bootdev.c b/debian/prep-bootdev.c new file mode 100644 index 0000000..700a486 --- /dev/null +++ b/debian/prep-bootdev.c @@ -0,0 +1,39 @@ +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + PedDevice *dev; + + ped_exception_fetch_all(); + ped_device_probe_all(); + for (dev = ped_device_get_next(NULL); dev; + dev = ped_device_get_next(dev)) { + PedDisk *disk; + PedPartition *part; + + disk = ped_disk_new(dev); + if (!disk) + continue; + + for (part = ped_disk_next_partition(disk, NULL); part; + part = ped_disk_next_partition(disk, part)) { + if (ped_partition_is_active(part) && + ped_partition_get_flag(part, PED_PARTITION_PREP)) { + char *path; + + path = ped_partition_get_path(part); + if (path) { + printf("%s\n", path); + free(path); + return 0; + } + free(path); + } + } + } + + return 0; +} -- cgit v1.2.3