Mkinitcpio-openswap

First step:

$ pacman -Si mkinitcpio-openswap
Repository      : endeavouros
Name            : mkinitcpio-openswap
Version         : 0.1.0-3
Description     : mkinitcpio hook to open swap at boot time
Architecture    : any
URL             : https://aur.archlinux.org/packages/mkinitcpio-openswap/
Licenses        : unknown
Groups          : None
Provides        : None
Depends On      : mkinitcpio
Optional Deps   : None
Conflicts With  : None
Replaces        : None
Download Size   : 12.07 KiB
Installed Size  : 3.00 KiB
Packager        : Unknown Packager
Build Date      : Tue 01 Oct 2019 08:04:34 BST
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Second step:

https://aur.archlinux.org/cgit/aur.git/tree/openswap.conf?h=mkinitcpio-openswap

## cryptsetup open $swap_device $crypt_swap_name
## get uuid using e.g. lsblk -f
swap_device=/dev/disk/by-uuid/2788eb78-074d-4424-9f1d-ebffc9c37262
crypt_swap_name=cryptswap

## one can optionally provide a keyfile device and path on this device
## to the keyfile
keyfile_device=/dev/mapper/cryptroot
keyfile_filename=etc/keyfile-cryptswap

## additional arguments are given to mount for keyfile_device
## has to start with --options (if so desired)
#keyfile_device_mount_options="--options=subvol=__active/__"

## additional arguments are given to cryptsetup
## --allow-discards options is desired in case swap is on SSD partition
cryptsetup_options="--type luks"

So, it looks like a mkinitcpio hook which will unlock an encrypted swap partition on boot.

Probably not, unless you have full disk encryption and have an encrypted swap partition.

3 Likes