installer: Fix a bug when /boot (HAMMER) or / (UFS) is are to be encrypted.
authorSascha Wildner <saw@online.de>
Sat, 4 Dec 2010 02:20:29 +0000 (03:20 +0100)
committerSascha Wildner <saw@online.de>
Sat, 4 Dec 2010 02:21:27 +0000 (03:21 +0100)
The installer will warn that this is not possible, but previously left the
encryption flag set. Clear it.

usr.sbin/installer/dfuibe_installer/fn_subpart_hammer.c
usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c
usr.sbin/installer/libinstaller/diskutil.c
usr.sbin/installer/libinstaller/diskutil.h

index ab15576..58dacbe 100644 (file)
@@ -575,6 +575,7 @@ warn_encrypted_boot(struct i_fn_args *a)
                    _("You have selected encryption for the /boot partition which "
                    "is not supported."))) {
                case 1:
+                       subpartition_clr_encrypted(sp);
                        valid = 1;
                        break;
                case 2:
index d5407c3..1ce77ba 100644 (file)
@@ -654,6 +654,7 @@ warn_encrypted_root(struct i_fn_args *a)
                    _("You have selected encryption for the root partition which "
                    "is not supported."))) {
                case 1:
+                       subpartition_clr_encrypted(sp);
                        valid = 1;
                        break;
                case 2:
index f666655..a2da8a3 100644 (file)
@@ -792,6 +792,12 @@ subpartition_get_capacity(const struct subpartition *sp)
        return(sp->capacity);
 }
 
+void
+subpartition_clr_encrypted(struct subpartition *sp)
+{
+       sp->encrypted = 0;
+}
+
 int
 subpartition_is_encrypted(const struct subpartition *sp)
 {
index ee2de80..c77f2da 100644 (file)
@@ -177,6 +177,7 @@ char                         subpartition_get_letter(const struct subpartition *);
 unsigned long           subpartition_get_fsize(const struct subpartition *);
 unsigned long           subpartition_get_bsize(const struct subpartition *);
 long                    subpartition_get_capacity(const struct subpartition *);
+void                    subpartition_clr_encrypted(struct subpartition *);
 int                     subpartition_is_encrypted(const struct subpartition *);
 int                     subpartition_is_swap(const struct subpartition *);
 int                     subpartition_is_softupdated(const struct subpartition *);