installer: Don't add an entry for 'root' to /etc/crypttab.
authorSascha Wildner <saw@online.de>
Sun, 13 Aug 2017 10:08:23 +0000 (12:08 +0200)
committerSascha Wildner <saw@online.de>
Sun, 13 Aug 2017 10:09:11 +0000 (12:09 +0200)
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.

usr.sbin/installer/dfuibe_installer/fn_install.c

index a8e1a69..9ee84c1 100644 (file)
@@ -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),