fix mk-enc-usb to use correct partition
This commit is contained in:
parent
4c2189c770
commit
c41539f275
|
@ -33,10 +33,10 @@ in (writeShellApplication {
|
|||
parted "$USB_DEVICE" -- mkpart primary 0% 100%
|
||||
|
||||
echo "Creating Encrypted Partition"
|
||||
cryptsetup luksFormat "$USB_DEVICE"
|
||||
cryptsetup luksFormat "''${USB_DEVICE}1"
|
||||
|
||||
echo "Opening Encrypted Partition"
|
||||
cryptsetup open "$USB_DEVICE" "mk_enc_usb"
|
||||
cryptsetup open "''${USB_DEVICE}1" "mk_enc_usb"
|
||||
|
||||
echo "Making Encrypted Filesystem"
|
||||
mkfs.ext4 -L "${encryptedUSBData.unencryptedLabel}" /dev/mapper/mk_enc_usb
|
||||
|
|
|
@ -60,18 +60,18 @@ in {
|
|||
mount -n -t ${encryptedUSB.unencryptedFSType} -o ro ${encryptedUSB.preBootMapperPath} ${encryptedUSB.mountpoint}
|
||||
|
||||
cp ${encryptedUSB.encryptionKeysPath}/${config.networking.hostName}.key /keys
|
||||
|
||||
chmod 0755 /keys/${config.networking.hostName}.key
|
||||
umount -f ${encryptedUSB.mountpoint}
|
||||
|
||||
cryptsetup close ${encryptedUSB.preBootMapperName}
|
||||
'';
|
||||
|
||||
initrd.luks.devices = {
|
||||
"${driveData.mapperName}" = {
|
||||
device = "${driveData.encryptedPath}";
|
||||
keyFile = "/keys/${config.networking.hostName}.key";
|
||||
preLVM = false;
|
||||
allowDiscards = true;
|
||||
fallbackToPassword = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue