gpt-auto-generator.c revision e48fdd84432bbf9c2ecc339183258c7c33116032
6391N/A along with systemd; If not, see <http://www.gnu.org/licenses/>.
6391N/A#ifdef HAVE_LINUX_BTRFS_H
6391N/A#include "path-util.h"
6391N/A#include "sd-id128.h"
6391N/A#include "udev-util.h"
6391N/A#include "unit-name.h"
6391N/A#include "generator.h"
6391N/Astatic int verify_gpt_partition(const char *node, sd_id128_t *type, unsigned *nr, char **fstype) {
errno = 0;
r = blkid_do_safeprobe(b);
return -EBADSLT;
errno = 0;
if (type) {
errno = 0;
if (nr) {
errno = 0;
if (fstype) {
errno = 0;
char *fst;
if (!fst)
return -ENOMEM;
if (!name)
return log_oom();
if (!unit)
return log_oom();
return -errno;
fprintf(f,
path);
fflush(f);
if (ferror(f)) {
return -errno;
if (!lnk)
return log_oom();
return -errno;
static int add_mount(const char *what, const char *where, const char *fstype, const char *description) {
if (!unit)
return log_oom();
return log_oom();
return -errno;
fprintf(f,
fprintf(f,
fflush(f);
if (ferror(f)) {
return -errno;
if (!lnk)
return log_oom();
return -errno;
return log_oom();
return log_oom();
if (!parent)
return log_oom();
return log_oom();
return log_oom();
r = udev_enumerate_scan_devices(e);
log_error("Failed to enumerate partitions on /dev/block/%u:%u: %s", major(dev), minor(dev), strerror(-r));
unsigned nr;
return log_oom();
if (!node)
return log_oom();
if (r == -EBADSLT)
if (!home)
return log_oom();
if (!srv)
return log_oom();
if (fd < 0)
return -errno;
return -errno;
return -errno;
return -errno;
return -ENODEV;
return -ENODEV;
return -ENODEV;
return -errno;
return -errno;
return log_oom();
t = udev_device_get_devnode(d);
return -ENODEV;
n = strdup(t);
return -ENOMEM;
*ret = n;
return EXIT_FAILURE;
log_open();
if (in_initrd()) {
return EXIT_SUCCESS;
return EXIT_SUCCESS;
return EXIT_FAILURE;
return EXIT_SUCCESS;
if (!udev) {
log_oom();
return EXIT_FAILURE;
return EXIT_FAILURE;
return EXIT_FAILURE;
return EXIT_SUCCESS;
return EXIT_FAILURE;
return EXIT_SUCCESS;