aboutsummaryrefslogtreecommitdiffstats
path: root/initramfs-init.in
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2017-08-03 21:44:15 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2017-08-03 21:44:15 +0200
commit5cd586c09e381a530da9abdb86e5cff3e2bc6caa (patch)
tree6565f751437fc9f0e02d9faebb18b1321e4b3fb5 /initramfs-init.in
parent9d2040756a0b701c79140f14ce7c8d53d66a2d40 (diff)
downloadmkinitfs-5cd586c09e381a530da9abdb86e5cff3e2bc6caa.tar.bz2
mkinitfs-5cd586c09e381a530da9abdb86e5cff3e2bc6caa.tar.xz
init: add cryptdiscards option
When enabled allows the use of discard (TRIM) requests for the device. See cryptsetup(1) for more information.
Diffstat (limited to 'initramfs-init.in')
-rwxr-xr-xinitramfs-init.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/initramfs-init.in b/initramfs-init.in
index 9568a59..be7b1c3 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -263,8 +263,8 @@ setup_nbd() {
set -- $(cat /proc/cmdline)
myopts="alpine_dev autodetect autoraid chart cryptroot cryptdm cryptheader cryptoffset
- debug_init dma init_args keep_apk_new modules ovl_dev pkgs quiet root_size root
- usbdelay ip alpine_repo apkovl alpine_start splash blacklist
+ cryptdiscards debug_init dma init_args keep_apk_new modules ovl_dev pkgs quiet
+ root_size root usbdelay ip alpine_repo apkovl alpine_start splash blacklist
overlaytmpfs rootfstype rootflags nbd resume"
for opt; do
@@ -355,6 +355,9 @@ eend 0
if [ -n "$KOPT_cryptroot" ]; then
cryptopts="-c ${KOPT_cryptroot}"
+ if [ "$KOPT_cryptdiscards" = "yes" ]; then
+ cryptopts="$cryptopts -D"
+ fi
if [ -n "$KOPT_cryptdm" ]; then
cryptopts="$cryptopts -m ${KOPT_cryptdm}"
fi