From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RiqXt-0005HU-Pe for garchives@archives.gentoo.org; Thu, 05 Jan 2012 16:52:06 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 52D3121C1E6; Thu, 5 Jan 2012 16:51:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1EE5E21C1E2 for ; Thu, 5 Jan 2012 16:51:58 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9134B1B4017 for ; Thu, 5 Jan 2012 16:51:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id F077D80042 for ; Thu, 5 Jan 2012 16:51:56 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: Subject: [gentoo-commits] proj/genkernel:master commit in: doc/, defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts defaults/linuxrc doc/genkernel.8.txt X-VCS-Directories: doc/ defaults/ X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: c92fe6f0e654d49f00465e81f8f491ef9240fb80 Date: Thu, 5 Jan 2012 16:51:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 8544032b-3913-4a6d-a61a-caa703aa24a5 X-Archives-Hash: 189f44abb870a00d3d1719e8b12d626a commit: c92fe6f0e654d49f00465e81f8f491ef9240fb80 Author: Christian Kruse wwwtech de> AuthorDate: Thu Jan 5 16:45:38 2012 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Thu Jan 5 16:49:47 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/genkernel.git= ;a=3Dcommit;h=3Dc92fe6f0 Introduce boot parameter root_trim=3D(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 =20 - eval local LUKS_DEVICE=3D'"${CRYPT_'${TYPE}'}"' LUKS_NAME=3D"$1" LUKS_K= EY=3D'"${CRYPT_'${TYPE}'_KEY}"' LUKS_KEYDEV=3D'"${CRYPT_'${TYPE}'_KEYDEV}= "' + eval local LUKS_DEVICE=3D'"${CRYPT_'${TYPE}'}"' LUKS_NAME=3D"$1" LUKS_K= EY=3D'"${CRYPT_'${TYPE}'_KEY}"' LUKS_KEYDEV=3D'"${CRYPT_'${TYPE}'_KEYDEV}= "' LUKS_TRIM=3D'"${CRYPT_'${TYPE}'_TRIM}"' local DEV_ERROR=3D0 KEY_ERROR=3D0 KEYDEV_ERROR=3D0 local mntkey=3D"/mnt/key/" cryptsetup_options=3D'' =20 @@ -793,6 +793,12 @@ openLUKS() { continue else # Handle keys + if [ "x${LUKS_TRIM}" =3D "xyes" ] + then + good_msg "Enabling TRIM support for ${LUKS_NAME}." ${CRYPT_SILENT} + cryptsetup_options=3D"${cryptsetup_options} --allow-discards" + fi + if [ -n "${LUKS_KEY}" ]=20 then if [ ! -e "${mntkey}${LUKS_KEY}" ]=20 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=3D*) CRYPT_ROOT_KEYDEV=3D${x#*=3D} ;; + root_trim=3D*) + CRYPT_ROOT_TRIM=3D${x#*=3D} + ;; + swap_key=3D*) CRYPT_SWAP_KEY=3D${x#*=3D} ;; 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. =20 +*root_trim*=3Dyes|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*=3D<...>:: Same as root_key for swap. =20