return 0;
if (r < 0)
return log_error_errno(r, "Failed to acquire ID_PART_ENTRY_TYPE device property, ignoring: %m");
- r = sd_id128_from_string(parttype, &id);
- if (r < 0)
- return log_debug_errno(r, "Failed to parse ID_PART_ENTRY_TYPE field '%s', ignoring: %m", parttype);
- if (!sd_id128_equal(id, GPT_USER_HOME)) {
+ if (id128_equal_string(parttype, GPT_USER_HOME) <= 0) {
log_debug("Found partition (%s) we don't care about, ignoring.", sysfs);
return 0;
}
#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
+#include "gpt.h"
+#include "id128-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "pe-header.h"
r = blkid_probe_lookup_value(b, "PART_ENTRY_TYPE", &v, NULL);
if (r != 0)
return log_error_errno(errno ?: EIO, "Failed to probe partition type UUID of \"%s\": %m", node);
- if (!streq(v, "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"))
+ if (id128_equal_string(v, GPT_ESP) <= 0)
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
SYNTHETIC_ERRNO(searching ? EADDRNOTAVAIL : ENODEV),
"File system \"%s\" has wrong type for an EFI System Partition (ESP).", node);
r = sd_device_get_property_value(d, "ID_PART_ENTRY_TYPE", &v);
if (r < 0)
return log_error_errno(r, "Failed to get device property: %m");
- if (!streq(v, "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"))
+ if (id128_equal_string(v, GPT_ESP) <= 0)
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
SYNTHETIC_ERRNO(searching ? EADDRNOTAVAIL : ENODEV),
"File system \"%s\" has wrong type for an EFI System Partition (ESP).", node);
r = blkid_probe_lookup_value(b, "PART_ENTRY_TYPE", &v, NULL);
if (r != 0)
return log_error_errno(errno ?: SYNTHETIC_ERRNO(EIO), "Failed to probe partition type UUID of \"%s\": %m", node);
- if (!streq(v, "bc13c2ff-59e6-4262-a352-b275fd6f7172"))
+ if (id128_equal_string(v, GPT_XBOOTLDR) <= 0)
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
searching ? SYNTHETIC_ERRNO(EADDRNOTAVAIL) : SYNTHETIC_ERRNO(ENODEV),
"File system \"%s\" has wrong type for extended boot loader partition.", node);
r = sd_device_get_property_value(d, "ID_PART_ENTRY_TYPE", &v);
if (r < 0)
return log_error_errno(r, "Failed to get device property: %m");
- if (!streq(v, "bc13c2ff-59e6-4262-a352-b275fd6f7172"))
+ if (id128_equal_string(v, GPT_XBOOTLDR))
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
searching ? SYNTHETIC_ERRNO(EADDRNOTAVAIL) : SYNTHETIC_ERRNO(ENODEV),
"File system \"%s\" has wrong type for extended boot loader partition.", node);