From 00bb366d1169aee1a8511bf037d82fddf160102b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 20 Dec 2018 12:15:09 +0100 Subject: fstab-generator: use generator_add_symlink() in one more place --- src/fstab-generator/fstab-generator.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/fstab-generator') diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index 7c847e3d61..9318d1e591 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -722,23 +722,14 @@ static int add_sysroot_usr_mount(void) { } static int add_volatile_root(void) { - const char *from, *to; - - if (arg_volatile_mode != VOLATILE_YES) - return 0; - /* Let's add in systemd-remount-volatile.service which will remount the root device to tmpfs if this is * requested, leaving only /usr from the root mount inside. */ - from = strjoina(SYSTEM_DATA_UNIT_PATH "/systemd-volatile-root.service"); - to = strjoina(arg_dest, "/" SPECIAL_INITRD_ROOT_FS_TARGET, ".requires/systemd-volatile-root.service"); - - (void) mkdir_parents(to, 0755); - - if (symlink(from, to) < 0) - return log_error_errno(errno, "Failed to hook in volatile remount service: %m"); + if (arg_volatile_mode != VOLATILE_YES) + return 0; - return 0; + return generator_add_symlink(arg_dest, SPECIAL_INITRD_ROOT_FS_TARGET, "requires", + SYSTEM_DATA_UNIT_PATH "/systemd-volatile-root.service"); } static int add_volatile_var(void) { -- cgit v1.2.1