Skip to contentSkip to conversation

ocf-linux: new package

PATCH New Gustavo Zacarias 2 participants 3 messages May 5, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 ocf-linux: new package

Add the ocf-linux package and linux kernel extension.

---
 linux/Config.ext.in            |   12 ++++++++++++
 linux/linux-ext-ocf-linux.mk   |   23 +++++++++++++++++++++++
 package/Config.in              |    1 +
 package/ocf-linux/Config.in    |   12 ++++++++++++
 package/ocf-linux/ocf-linux.mk |   21 +++++++++++++++++++++
 5 files changed, 69 insertions(+), 0 deletions(-)
 create mode 100644 linux/linux-ext-ocf-linux.mk
 create mode 100644 package/ocf-linux/Config.in
 create mode 100644 package/ocf-linux/ocf-linux.mk
linux/Config.ext.in +12 -0
index 172fa76..a68cbe9 100644
@@ -23,6 +23,18 @@ config BR2_LINUX_KERNEL_EXT_XENOMAI_ADEOS_PATCH
 	  Download it at http://download.gna.org/adeos/patches/v2.6/$(ARCH)/
 	  and verify that your kernel version in buildroot matches.
 
+# ocf-linux
+config BR2_LINUX_KERNEL_EXT_OCF_LINUX
+	bool "Open Cryptographic Framework (OCF)"
+	select BR2_PACKAGE_OCF_LINUX
+	help
+	  OCF-Linux Kernel part.
+
+	  Select this option to patch your kernel with OCF for
+	  hardware-accelerated crypto support for available drivers.
+	  Some libraries need to also have OCF enabled for them,
+	  for example OpenSSL.
+
 # RTAI
 config BR2_LINUX_KERNEL_EXT_RTAI
        bool "RTAI Real-time patch"
linux/linux-ext-ocf-linux.mk new file +23 -0
new file mode 100644
index 0000000..faf7360
@@ -0,0 +1,23 @@
+##################################################
+# Linux OCF extension
+#
+# Patch the linux kernel with OCF
+##################################################
+
+ifeq ($(BR2_LINUX_KERNEL_EXT_OCF_LINUX),y)
+LINUX_DEPENDENCIES += ocf-linux
+
+# Prepare kernel patch
+# The linux-3.2.1.patch is just the main inclusion, most of the code
+# resides in the ocf/ subdir.
+# It works for older kernel versions.
+# Run tested from 2.6.38+ and build tested from 2.6.35+
+define OCF_LINUX_PREPARE_KERNEL
+	support/scripts/apply-patches.sh $(LINUX_DIR) \
+		$(OCF_LINUX_DIR)/patches/ linux-3.2.1-ocf.patch ; \
+	cp -rf $(OCF_LINUX_DIR)/ocf $(LINUX_DIR)/crypto/ocf ;
+endef
+
+LINUX_PRE_PATCH_HOOKS += OCF_LINUX_PREPARE_KERNEL
+
+endif #BR2_LINUX_EXT_OCF_LINUX
package/Config.in +1 -0
index 70fc6f0..7116202 100644
@@ -299,6 +299,7 @@ source "package/gnutls/Config.in"
 source "package/libgcrypt/Config.in"
 source "package/libgpg-error/Config.in"
 source "package/libnss/Config.in"
+source "package/ocf-linux/Config.in"
 source "package/openssl/Config.in"
 source "package/polarssl/Config.in"
 endmenu
package/ocf-linux/Config.in new file +12 -0
new file mode 100644
index 0000000..9dc5766
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_OCF_LINUX
+	bool "ocf-linux"
+	help
+	  OCF-Linux is a Linux port of the OpenBSD/FreeBSD Cryptographic
+	  Framework (OCF). This port aims to bring full asynchronous HW/SW
+	  crypto acceleration to the Linux kernel and applications
+	  running under Linux.
+
+	  You need to enable the OCF linux kernel extension or provide
+	  a prepatched kernel to make this option useful.
+
+	  http://ocf-linux.sourceforge.net/
package/ocf-linux/ocf-linux.mk new file +21 -0
new file mode 100644
index 0000000..e615225
@@ -0,0 +1,21 @@
+#############################################################
+#
+# ocf-linux
+#
+#############################################################
+
+OCF_LINUX_VERSION = 20120127
+OCF_LINUX_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/project/ocf-linux/ocf-linux/$(OCF_LINUX_VERSION)
+OCF_LINUX_INSTALL_STAGING = YES
+
+define OCF_LINUX_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 644 $(@D)/ocf/cryptodev.h \
+		$(STAGING_DIR)/usr/include/crypto/cryptodev.h
+endef
+
+define OCF_LINUX_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 644 $(@D)/ocf/cryptodev.h \
+		$(TARGET_DIR)/usr/include/crypto/cryptodev.h
+endef
+
+$(eval $(call GENTARGETS))
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH v2 2/2 openssl: switch to the ocf-linux package

Remove builtin OCF support from the openssl package into a new package. Even though ocf support is just a header file we'd rather have it in a separate package because of unrelated version bumps and to fetch it from source.

---
 package/openssl/Config.in                |    9 +-
 package/openssl/ocf-cryptodev-20101223.h |  480 ------------------------------
 package/openssl/openssl.mk               |   10 +-
 3 files changed, 9 insertions(+), 490 deletions(-)
 delete mode 100644 package/openssl/ocf-cryptodev-20101223.h
package/openssl/Config.in +7 -2
index 3e09d88..6ba644a 100644
@@ -25,9 +25,14 @@ config BR2_PACKAGE_OPENSSL_ENGINES
 config BR2_PACKAGE_OPENSSL_OCF
 	bool "openssl ocf support"
 	depends on BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_OCF_LINUX
 	help
 	  Enable openssl cryptodev (OCF) hardware acceleration support.
-	  This requires kernel patches from the ocf-linux project otherwise
-	  you'll just have a bigger openssl library that works as usual.
+	  This requires the ocf linux kernel extension or you to provide a
+	  pre-patched kernel that includes it.
+	  If kernel support isn't available it'll just make the libraries
+	  a tiny bit larger with a small CPU overhead when starting up and
+	  checking for the required kernel-side support, and then falling
+	  back to regular builtin support.
 
 	  http://ocf-linux.sourceforge.net/
package/openssl/ocf-cryptodev-20101223.h deleted +0 -480

480 lines not on this page · raw message

package/openssl/openssl.mk +2 -8
index 185522c..748252c 100644
@@ -12,14 +12,8 @@ OPENSSL_TARGET_ARCH = generic32
 OPENSSL_CFLAGS = $(TARGET_CFLAGS)
 
 ifeq ($(BR2_PACKAGE_OPENSSL_OCF),y)
-OPENSSL_CFLAGS += -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
-
-define OPENSSL_INSTALL_CRYPTODEV_H
-$(INSTALL) -D package/openssl/ocf-cryptodev-20101223.h \
-	$(STAGING_DIR)/usr/include/crypto/cryptodev.h
-endef
-
-OPENSSL_POST_EXTRACT_HOOKS += OPENSSL_INSTALL_CRYPTODEV_H
+	OPENSSL_CFLAGS += -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
+	OPENSSL_DEPENDENCIES += ocf-linux
 endif
 
 # Some architectures are optimized in OpenSSL
Signature · 1 line
1.7.3.4
#2 lore raw

PATCH v2 1/2 ocf-linux: new package

In reply to Gustavo Zacarias
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Gustavo> Add the ocf-linux package and linux kernel extension.

Committed both, thanks.

Signature · 1 line
Bye, Peter Korsgaard