This patch to Slackware 14.1's init scripts improves its handling of /etc/crypttab crypttab now supports the 'discard' option, as well as handling the "none" password correctly for non-swap volumes.
The attached script and test-crypttab file represent a small test to see the script will behave with different crypttab lines.
Some notes on /etc/crypttab in Slackware:
Only luks formatted volumes are supported (except for swap)
crypttab follows the following format: <luks name> <device> <password> <options>
<luks name>
: This is the name of your luks volume. For instance: crypt-home
<device>
: This is the device containing your luks volume. For instance: /dev/sda2
<password>
: This is either the volume password in plain text, or the name of a key file. Use 'none' to interactively enter password on boot.
<options>
: Comma-separated list of options. Note that there must be a password field for any options to be picked up (use a password of 'none' to get a password prompt at boot.) The following options are supported:
-
discard
This will cause --allow-discards to be passed to the cryptsetup program while opening the luks volume
-
ro
This will cause --readonly to be passed to the cryptsetup program while opening the luks volume
-
swap
This option cannot be used with other options. The device given will be formatted as a new encrypted volume with a random key on boot, and used as swap.