What does mkinitcpio-openswap do? Do I need it?

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             :
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:

## cryptsetup open $swap_device $crypt_swap_name
## get uuid using e.g. lsblk -f

## one can optionally provide a keyfile device and path on this device
## to the keyfile

## additional arguments are given to mount for keyfile_device
## has to start with --options (if so desired)

## 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.


Thanks @jonathon I asked because I’m gonna do a fresh install of Arch again and convert to EOS and had a look at the GitHub repo to see what gets installed and see if I really need eveything in the repo.

This is really better than just a simple “No” answer as you have explained it well. As I’ve googled and read thearchwiki I still couldn’t figure it out :confused:


If you want or need to enable swap after installation, you can do it through a file: