mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +00:00
Merge a745d00acd
into 89a95f958e
This commit is contained in:
commit
c82b8fcd9d
@ -114,7 +114,6 @@ done
|
|||||||
## if a condition failed:
|
## if a condition failed:
|
||||||
### Required? exit 1
|
### Required? exit 1
|
||||||
### Else? exit 0
|
### Else? exit 0
|
||||||
|
|
||||||
if [ "$ENCRYPT" == "true" ]; then
|
if [ "$ENCRYPT" == "true" ]; then
|
||||||
SWAPDEV=/dev/mapper/swapfile
|
SWAPDEV=/dev/mapper/swapfile
|
||||||
else
|
else
|
||||||
@ -142,6 +141,10 @@ if [ ! -f $path ] || ! [ $(stat -c "%s" $path) == $count ]; then
|
|||||||
cryptsetup open --type plain --key-file /dev/urandom --key-size=256 --cipher=aes-cbc-essiv:sha256 --offset=0 ${path} swapfile
|
cryptsetup open --type plain --key-file /dev/urandom --key-size=256 --cipher=aes-cbc-essiv:sha256 --offset=0 ${path} swapfile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
/sbin/mkswap $SWAPDEV
|
||||||
|
elif [ "$ENCRYPT" == "true" ]; then
|
||||||
|
## Ensure the encrypted swap is created as it won't persist on a reboot
|
||||||
|
cryptsetup open --type plain --key-file /dev/urandom --key-size=256 --cipher=aes-cbc-essiv:sha256 --offset=0 ${path} swapfile
|
||||||
/sbin/mkswap $SWAPDEV
|
/sbin/mkswap $SWAPDEV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user