]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/generator.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
8 int generator_open_unit_file(
14 int generator_add_symlink(const char *dir
, const char *dst
, const char *dep_type
, const char *src
);
16 int generator_write_fsck_deps(
23 int generator_write_timeouts(
30 int generator_write_device_deps(
36 int generator_write_initrd_root_device_deps(
40 int generator_hook_up_mkswap(
43 int generator_hook_up_mkfs(
48 int generator_hook_up_growfs(
53 int generator_enable_remount_fs_service(const char *dir
);
55 void log_setup_generator(void);
57 /* Similar to DEFINE_MAIN_FUNCTION, but initializes logging and assigns positional arguments. */
58 #define DEFINE_MAIN_GENERATOR_FUNCTION(impl) \
59 _DEFINE_MAIN_FUNCTION( \
61 log_setup_generator(); \
62 if (argc > 1 && argc != 4) \
63 return log_error_errno(SYNTHETIC_ERRNO(EINVAL), \
64 "This program takes zero or three arguments."); \
66 impl(argc > 1 ? argv[1] : "/tmp", \
67 argc > 1 ? argv[2] : "/tmp", \
68 argc > 1 ? argv[3] : "/tmp"), \
69 r < 0 ? EXIT_FAILURE : EXIT_SUCCESS)