summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/cryptsetup/0001-Move-safe-table-params-wipe-into-function-which-allo.patch37
-rw-r--r--core/cryptsetup/0002-Re-check-flags-after-DM-device-creations.patch62
-rw-r--r--core/cryptsetup/0003-Properly-allow-activation-of-discard-even-if-dm_cryp.patch92
-rw-r--r--core/cryptsetup/PKGBUILD24
-rw-r--r--core/iproute2/PKGBUILD6
5 files changed, 213 insertions, 8 deletions
diff --git a/core/cryptsetup/0001-Move-safe-table-params-wipe-into-function-which-allo.patch b/core/cryptsetup/0001-Move-safe-table-params-wipe-into-function-which-allo.patch
new file mode 100644
index 000000000..64bfa50ed
--- /dev/null
+++ b/core/cryptsetup/0001-Move-safe-table-params-wipe-into-function-which-allo.patch
@@ -0,0 +1,37 @@
+From 2250d5f71f9dd66112d5c63367169f4e6af8ad70 Mon Sep 17 00:00:00 2001
+From: Milan Broz <gmazyland@gmail.com>
+Date: Thu, 24 Jul 2014 11:37:24 +0200
+Subject: [PATCH 1/3] Move safe table params wipe into function which allocates
+ it.
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+ lib/libdevmapper.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c
+index 3ed87c0..8e5a696 100644
+--- a/lib/libdevmapper.c
++++ b/lib/libdevmapper.c
+@@ -642,8 +642,6 @@ out_no_removal:
+ if (cookie && _dm_use_udev())
+ (void)_dm_udev_wait(cookie);
+
+- if (params)
+- crypt_safe_free(params);
+ if (dmt)
+ dm_task_destroy(dmt);
+
+@@ -674,6 +672,8 @@ int dm_create_device(struct crypt_device *cd, const char *name,
+ r = _dm_create_device(name, type, dmd->data_device,
+ dmd->flags, dmd->uuid, dmd->size,
+ table_params, reload);
++
++ crypt_safe_free(table_params);
+ dm_exit_context();
+ return r;
+ }
+--
+2.0.1
+
diff --git a/core/cryptsetup/0002-Re-check-flags-after-DM-device-creations.patch b/core/cryptsetup/0002-Re-check-flags-after-DM-device-creations.patch
new file mode 100644
index 000000000..b6c0005e9
--- /dev/null
+++ b/core/cryptsetup/0002-Re-check-flags-after-DM-device-creations.patch
@@ -0,0 +1,62 @@
+From 3640eaa726b7a9d761f1c67cd8620153d791688e Mon Sep 17 00:00:00 2001
+From: Milan Broz <gmazyland@gmail.com>
+Date: Thu, 24 Jul 2014 11:52:58 +0200
+Subject: [PATCH 2/3] Re-check flags after DM device creations.
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+ lib/libdevmapper.c | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c
+index 8e5a696..6138a6b 100644
+--- a/lib/libdevmapper.c
++++ b/lib/libdevmapper.c
+@@ -566,6 +566,9 @@ static int _dm_create_device(const char *name, const char *type,
+ uint32_t cookie = 0;
+ uint16_t udev_flags = 0;
+
++ if (!params)
++ return -EINVAL;
++
+ if (flags & CRYPT_ACTIVATE_PRIVATE)
+ udev_flags = CRYPT_TEMP_UDEV_FLAGS;
+
+@@ -646,6 +649,10 @@ out_no_removal:
+ dm_task_destroy(dmt);
+
+ dm_task_update_nodes();
++
++ /* If code just loaded target module, update versions */
++ _dm_check_versions();
++
+ return r;
+ }
+
+@@ -655,7 +662,7 @@ int dm_create_device(struct crypt_device *cd, const char *name,
+ int reload)
+ {
+ char *table_params = NULL;
+- int r = -EINVAL;
++ int r;
+
+ if (!type)
+ return -EINVAL;
+@@ -668,10 +675,9 @@ int dm_create_device(struct crypt_device *cd, const char *name,
+ else if (dmd->target == DM_VERITY)
+ table_params = get_dm_verity_params(dmd->u.verity.vp, dmd);
+
+- if (table_params)
+- r = _dm_create_device(name, type, dmd->data_device,
+- dmd->flags, dmd->uuid, dmd->size,
+- table_params, reload);
++ r = _dm_create_device(name, type, dmd->data_device,
++ dmd->flags, dmd->uuid, dmd->size,
++ table_params, reload);
+
+ crypt_safe_free(table_params);
+ dm_exit_context();
+--
+2.0.1
+
diff --git a/core/cryptsetup/0003-Properly-allow-activation-of-discard-even-if-dm_cryp.patch b/core/cryptsetup/0003-Properly-allow-activation-of-discard-even-if-dm_cryp.patch
new file mode 100644
index 000000000..8570bbf26
--- /dev/null
+++ b/core/cryptsetup/0003-Properly-allow-activation-of-discard-even-if-dm_cryp.patch
@@ -0,0 +1,92 @@
+From 59fdf2a6bb461a39e6db6b7d515873419f8a8ada Mon Sep 17 00:00:00 2001
+From: Milan Broz <gmazyland@gmail.com>
+Date: Thu, 24 Jul 2014 22:11:58 +0200
+Subject: [PATCH 3/3] Properly allow activation of discard even if dm_crypt
+ module is not yet loaded.
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The dm_flags() call cannot be used if dmcrypt module is not present.
+
+Better try to activate volume with dicard flags and if it is not possible,
+try to activate device without the discard flag.
+---
+ lib/libdevmapper.c | 37 ++++++++++++++++++++++++-------------
+ 1 file changed, 24 insertions(+), 13 deletions(-)
+
+diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c
+index 6138a6b..dcc54fd 100644
+--- a/lib/libdevmapper.c
++++ b/lib/libdevmapper.c
+@@ -306,22 +306,19 @@ static void hex_key(char *hexkey, size_t key_size, const char *key)
+ }
+
+ /* http://code.google.com/p/cryptsetup/wiki/DMCrypt */
+-static char *get_dm_crypt_params(struct crypt_dm_active_device *dmd)
++static char *get_dm_crypt_params(struct crypt_dm_active_device *dmd, uint32_t flags)
+ {
+ int r, max_size, null_cipher = 0;
+ char *params, *hexkey;
+- const char *features = "";
++ const char *features;
+
+ if (!dmd)
+ return NULL;
+
+- if (dmd->flags & CRYPT_ACTIVATE_ALLOW_DISCARDS) {
+- if (dm_flags() & DM_DISCARDS_SUPPORTED) {
+- features = " 1 allow_discards";
+- log_dbg("Discard/TRIM is allowed.");
+- } else
+- log_dbg("Discard/TRIM is not supported by the kernel.");
+- }
++ if (flags & CRYPT_ACTIVATE_ALLOW_DISCARDS)
++ features = " 1 allow_discards";
++ else
++ features = "";
+
+ if (!strncmp(dmd->u.crypt.cipher, "cipher_null-", 12))
+ null_cipher = 1;
+@@ -662,6 +659,7 @@ int dm_create_device(struct crypt_device *cd, const char *name,
+ int reload)
+ {
+ char *table_params = NULL;
++ uint32_t dmd_flags;
+ int r;
+
+ if (!type)
+@@ -670,14 +668,27 @@ int dm_create_device(struct crypt_device *cd, const char *name,
+ if (dm_init_context(cd))
+ return -ENOTSUP;
+
++ dmd_flags = dmd->flags;
++
+ if (dmd->target == DM_CRYPT)
+- table_params = get_dm_crypt_params(dmd);
++ table_params = get_dm_crypt_params(dmd, dmd_flags);
+ else if (dmd->target == DM_VERITY)
+ table_params = get_dm_verity_params(dmd->u.verity.vp, dmd);
+
+- r = _dm_create_device(name, type, dmd->data_device,
+- dmd->flags, dmd->uuid, dmd->size,
+- table_params, reload);
++ r = _dm_create_device(name, type, dmd->data_device, dmd_flags,
++ dmd->uuid, dmd->size, table_params, reload);
++
++ /* If discard not supported try to load without discard */
++ if (!reload && r && dmd->target == DM_CRYPT &&
++ (dmd->flags & CRYPT_ACTIVATE_ALLOW_DISCARDS) &&
++ !(dm_flags() & DM_DISCARDS_SUPPORTED)) {
++ log_dbg("Discard/TRIM is not supported, retrying activation.");
++ dmd_flags = dmd_flags & ~CRYPT_ACTIVATE_ALLOW_DISCARDS;
++ crypt_safe_free(table_params);
++ table_params = get_dm_crypt_params(dmd, dmd_flags);
++ r = _dm_create_device(name, type, dmd->data_device, dmd_flags,
++ dmd->uuid, dmd->size, table_params, reload);
++ }
+
+ crypt_safe_free(table_params);
+ dm_exit_context();
+--
+2.0.1
+
diff --git a/core/cryptsetup/PKGBUILD b/core/cryptsetup/PKGBUILD
index 3cb39a35b..99ab1c1ff 100644
--- a/core/cryptsetup/PKGBUILD
+++ b/core/cryptsetup/PKGBUILD
@@ -1,24 +1,38 @@
-# $Id: PKGBUILD 217526 2014-07-21 10:53:05Z fyan $
+# $Id: PKGBUILD 218262 2014-07-28 21:21:54Z thomas $
# Maintainer: Thomas Bächler <thomas@archlinux.org>
pkgname=cryptsetup
pkgver=1.6.5
-pkgrel=1
+pkgrel=2
pkgdesc="Userspace setup tool for transparent encryption of block devices using dm-crypt"
arch=(i686 x86_64)
license=('GPL')
url="http://code.google.com/p/cryptsetup/"
groups=('base')
-depends=('device-mapper' 'libgcrypt' 'popt' 'util-linux')
+depends=('device-mapper' 'libgcrypt' 'popt' 'libutil-linux')
+makedepends=('util-linux')
options=('!emptydirs')
source=(https://www.kernel.org/pub/linux/utils/cryptsetup/v1.6/${pkgname}-${pkgver}.tar.xz
#https://www.kernel.org/pub/linux/utils/cryptsetup/v1.6/${pkgname}-${pkgver}.tar.sign
encrypt_hook
encrypt_install
- sd-encrypt)
+ sd-encrypt
+ 0001-Move-safe-table-params-wipe-into-function-which-allo.patch
+ 0002-Re-check-flags-after-DM-device-creations.patch
+ 0003-Properly-allow-activation-of-discard-even-if-dm_cryp.patch)
sha256sums=('267973f20be43f9d685f7193aa23954b60768c74a1d330243114d4b8bc17ca9a'
'4406f8dc83f4f1b408e49d557515f721d91b358355c71fbe51f74ab27e5c84ff'
'cfe465bdad3d958bb2332a05e04f2e1e884422a5714dfd1a0a3b9b74bf7dc6ae'
- 'd442304e6a78b3513ebc53be3fe2f1276a7df470c8da701b3ece971d59979bdd')
+ 'd442304e6a78b3513ebc53be3fe2f1276a7df470c8da701b3ece971d59979bdd'
+ '54895ebba0cf1df27da7a53b6a256b7826f9b2d4cff577f840ab457dc32b5c49'
+ 'd022e43fa96ee60e295cf6041a8b9e15225eeb03b713f32675061c4063c17ea5'
+ '16d55306a5dde637db16cb219834095432bc8579528789ee52aa975df12284d4')
+
+prepare() {
+ cd "${srcdir}"/$pkgname-${pkgver}
+ patch -p1 -i "${srcdir}"/0001-Move-safe-table-params-wipe-into-function-which-allo.patch
+ patch -p1 -i "${srcdir}"/0002-Re-check-flags-after-DM-device-creations.patch
+ patch -p1 -i "${srcdir}"/0003-Properly-allow-activation-of-discard-even-if-dm_cryp.patch
+}
build() {
cd "${srcdir}"/$pkgname-${pkgver}
diff --git a/core/iproute2/PKGBUILD b/core/iproute2/PKGBUILD
index a1b26856a..0a7fd2dab 100644
--- a/core/iproute2/PKGBUILD
+++ b/core/iproute2/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 210619 2014-04-15 20:43:33Z ronald $
+# $Id: PKGBUILD 218251 2014-07-28 16:10:39Z fyan $
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Judd Vinet <jvinet@zeroflux.org>
pkgname=iproute2
-pkgver=3.14.0
+pkgver=3.15.0
pkgrel=1
pkgdesc="IP Routing Utilities"
arch=('i686' 'x86_64')
@@ -22,7 +22,7 @@ backup=('etc/iproute2/ematch_map' 'etc/iproute2/rt_dsfield' 'etc/iproute2/rt_pro
source=(http://www.kernel.org/pub/linux/utils/net/$pkgname/$pkgname-$pkgver.tar.xz
iproute2-fhs.patch
unwanted-link-help.patch)
-sha1sums=('0b7d9db9e17da77a5bd8c2c75f6ddd607449ba3e'
+sha1sums=('82dce736488dac5af0f4b5659ae905fef87ed308'
'35b8cf2dc94b73eccad427235c07596146cd6f6c'
'3b1335f4025f657f388fbf4e5a740871e3129c2a')