mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-10 11:04:36 +08:00
17 lines
568 B
Plaintext
17 lines
568 B
Plaintext
run_hook ()
|
|
{
|
|
## read openswap configurations
|
|
source openswap.conf
|
|
|
|
if [ -z "$keyfile_device" ] || [ -z "$keyfile_filename" ]
|
|
then
|
|
## case when no keyfile provided in configurations
|
|
cryptsetup open "$swap_device" "$crypt_swap_name"
|
|
else
|
|
## case when keyfile is provided in configurations
|
|
mkdir openswap_keymount
|
|
mount "$keyfile_device" openswap_keymount
|
|
cryptsetup open $miscellaneous --key-file "openswap_keymount/$keyfile_filename" "$swap_device" "$crypt_swap_name"
|
|
umount openswap_keymount
|
|
fi
|
|
} |