Abstract of the Device Mapper Plugin
From RockWiki
The file /etc/conf/dm/mounts is read and each line evaluated as follows:
- if the line doesn't describe the root filesystem and the root filesystem is not yet mounted, mount it.
- check what we should do with the filesystem
- plain
- Do nothing, just mount it as it is
- swap
- This is an encrypted swapdevice:
- Get 128 Byte of entropy from /dev/random
- Get the md5sum of the entropy
- Set up encryption with the md5sum and the device
- Create a swapspace on the encrypted pseudodevice
- Activate the swap
- encrypt
- Read the passphrase from /dev/console
- Check if the passphrase is shorter than 20 characters.
- yes
- Warn the user that the passphrase is very short. He can enter it again to use it anyways
- ask for confirmation to avoid typos in the passphrase
- setup encryption with dmsetup
- do a sanity check by reading from the disk and writing to /dev/null
- ask the user for permission to encrypt the data now
- encrypt the data by reading from the disk and writing to the devicemapper
- mount the filesystem and continue
- decrypt
- Read the passphrase from /dev/console
- ask for confirmation to avoid typos in the passphrase
- setup encryption with dmsetup
- do a sanity check by reading from the disk and writing to /dev/null
- ask the user for permission to decrypt the data now
- decrypt the data by reading from the devicemapper and writing to the disk
- remove the devicemapper
- mount the filesystem and continue
- plain
