From: Sascha Wildner Date: Sun, 13 Aug 2017 10:08:23 +0000 (+0200) Subject: installer: Don't add an entry for 'root' to /etc/crypttab. X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/e637333841c38c89889701aca04446a9e8e69aab installer: Don't add an entry for 'root' to /etc/crypttab. It is not necessary and will in fact generate a 'Device root already exists.' warning because root has already been configured and mounted at this point. --- diff --git a/usr.sbin/installer/dfuibe_installer/fn_install.c b/usr.sbin/installer/dfuibe_installer/fn_install.c index a8e1a69fbb..9ee84c15ea 100644 --- a/usr.sbin/installer/dfuibe_installer/fn_install.c +++ b/usr.sbin/installer/dfuibe_installer/fn_install.c @@ -631,11 +631,13 @@ fn_install_os(struct i_fn_args *a) subpartition_get_capacity(sp), a->os_root); } else if (subpartition_is_encrypted(sp)) { - command_add(cmds, "%s%s '%s\t/dev/%s\tnone\tnone' >>%smnt/etc/crypttab", - a->os_root, cmd_name(a, "ECHO"), - fn_mapper_name(subpartition_get_mountpoint(sp), -1), - subpartition_get_device_name(sp), - a->os_root); + if (strcmp(fn_mapper_name(subpartition_get_mountpoint(sp), -1), "root") != 0) { + command_add(cmds, "%s%s '%s\t/dev/%s\tnone\tnone' >>%smnt/etc/crypttab", + a->os_root, cmd_name(a, "ECHO"), + fn_mapper_name(subpartition_get_mountpoint(sp), -1), + subpartition_get_device_name(sp), + a->os_root); + } command_add(cmds, "%s%s '/dev/%s\t\t%s\t\t%s\trw\t\t2\t2' >>%smnt/etc/fstab", a->os_root, cmd_name(a, "ECHO"), fn_mapper_name(subpartition_get_mountpoint(sp), 0),