public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sebastian Pipping" <sping@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
Date: Thu,  5 Jan 2012 16:51:56 +0000 (UTC)	[thread overview]
Message-ID: <c92fe6f0e654d49f00465e81f8f491ef9240fb80.sping@gentoo> (raw)

commit:     c92fe6f0e654d49f00465e81f8f491ef9240fb80
Author:     Christian Kruse <cjk <AT> wwwtech <DOT> de>
AuthorDate: Thu Jan  5 16:45:38 2012 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Jan  5 16:49:47 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=c92fe6f0

Introduce boot parameter root_trim=(yes|no) for SSDs

---
 defaults/initrd.scripts |    8 +++++++-
 defaults/linuxrc        |    4 ++++
 doc/genkernel.8.txt     |    5 +++++
 3 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 89c6d8b..b7b42ab 100755
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -732,7 +732,7 @@ openLUKS() {
 			;;
 	esac
 
-	eval local LUKS_DEVICE='"${CRYPT_'${TYPE}'}"' LUKS_NAME="$1" LUKS_KEY='"${CRYPT_'${TYPE}'_KEY}"' LUKS_KEYDEV='"${CRYPT_'${TYPE}'_KEYDEV}"'
+	eval local LUKS_DEVICE='"${CRYPT_'${TYPE}'}"' LUKS_NAME="$1" LUKS_KEY='"${CRYPT_'${TYPE}'_KEY}"' LUKS_KEYDEV='"${CRYPT_'${TYPE}'_KEYDEV}"' LUKS_TRIM='"${CRYPT_'${TYPE}'_TRIM}"'
 	local DEV_ERROR=0 KEY_ERROR=0 KEYDEV_ERROR=0
 	local mntkey="/mnt/key/" cryptsetup_options=''
 
@@ -793,6 +793,12 @@ openLUKS() {
 				continue
 			else
 				# Handle keys
+				if [ "x${LUKS_TRIM}" = "xyes" ]
+				then
+					good_msg "Enabling TRIM support for ${LUKS_NAME}." ${CRYPT_SILENT}
+					cryptsetup_options="${cryptsetup_options} --allow-discards"
+				fi
+
 				if [ -n "${LUKS_KEY}" ] 
 				then
 					if [ ! -e "${mntkey}${LUKS_KEY}" ] 

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 63366bd..28d204e 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -189,6 +189,10 @@ do
 		root_keydev=*)
 			CRYPT_ROOT_KEYDEV=${x#*=}
 		;;
+		root_trim=*)
+			CRYPT_ROOT_TRIM=${x#*=}
+		;;
+
 		swap_key=*)
 			CRYPT_SWAP_KEY=${x#*=}
 		;;

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 35c7ff3..d436330 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -387,6 +387,11 @@ which the ramdisk scripts would recognize.
     root_key.   If unset while using root_key, it will automatically
     look for the device in every boot.
 
+*root_trim*=yes|no::
+    Allows you to enable TRIM support on root device. Only useful
+    for SSD setups. Have a look at http://en.wikipedia.org/wiki/TRIM
+    for more information.
+
 *swap_key*=<...>::
     Same as root_key for swap.
 



             reply	other threads:[~2012-01-05 16:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 16:51 Sebastian Pipping [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-20  0:59 [gentoo-commits] proj/genkernel:master commit in: doc/, defaults/ Robin H. Johnson
2013-03-31 12:47 Peter Hjalmarsson
2013-04-25  6:22 Fabio Erculiani
2013-04-29  8:56 Fabio Erculiani
2016-05-16  6:55 Robin H. Johnson
2018-06-12 21:26 Robin H. Johnson
2019-07-18 20:15 Thomas Deutschmann
2020-01-14  1:36 Thomas Deutschmann
2020-01-29 22:28 Thomas Deutschmann
2021-03-14 20:05 Thomas Deutschmann
2021-03-14 20:05 Thomas Deutschmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c92fe6f0e654d49f00465e81f8f491ef9240fb80.sping@gentoo \
    --to=sping@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox