From 3d5be3835fa1d5f5bad34779535af7e742bfa916 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 19 Mar 2018 11:51:45 +0100 Subject: [PATCH] Add SSL --- buildroot-external/configs/ova_defconfig | 1 + ...-BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL.patch | 63 +++++++++++++++++++ buildroot/linux/Config.in | 13 ++++ buildroot/linux/linux.mk | 4 ++ 4 files changed, 81 insertions(+) create mode 100644 buildroot-patches/0009-linux-add-BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL.patch diff --git a/buildroot-external/configs/ova_defconfig b/buildroot-external/configs/ova_defconfig index 064931fa1..844031ec3 100644 --- a/buildroot-external/configs/ova_defconfig +++ b/buildroot-external/configs/ova_defconfig @@ -16,6 +16,7 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSIO_PATH)/board/ova/kerne BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y # BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_ALSA_UTILS=y BR2_PACKAGE_E2FSPROGS=y diff --git a/buildroot-patches/0009-linux-add-BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL.patch b/buildroot-patches/0009-linux-add-BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL.patch new file mode 100644 index 000000000..88c9698df --- /dev/null +++ b/buildroot-patches/0009-linux-add-BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL.patch @@ -0,0 +1,63 @@ +From 93a7edf4bc9bfcf821f608815870d06198eb2adf Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sun, 4 Mar 2018 22:31:15 +0100 +Subject: [PATCH 1/1] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL + +Some Linux kernel configuration options (such as +CONFIG_SYSTEM_TRUSTED_KEYRING) require building a host program called +extract-cert, which itself needs OpenSSL. + +Users having OpenSSL installed on their system won't see a problem, +but users who don't have OpenSSL installed will get a build +failure. This commit adds a new option that allows users to indicate +that their Linux configuration requires building host-openssl. + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Peter Korsgaard +--- + linux/Config.in | 13 +++++++++++++ + linux/linux.mk | 4 ++++ + 2 files changed, 17 insertions(+) + +diff --git a/linux/Config.in b/linux/Config.in +index bc6cd1b..57bb11c 100644 +--- a/linux/Config.in ++++ b/linux/Config.in +@@ -407,6 +407,19 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET + /boot if DTBs have been generated by the kernel build + process. + ++config BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL ++ bool "Needs host OpenSSL" ++ help ++ Some Linux kernel configuration options (such as ++ CONFIG_SYSTEM_TRUSTED_KEYRING) require building a host ++ program called extract-cert, which itself needs ++ OpenSSL. Enabling this option will ensure host-openssl gets ++ built before the Linux kernel. ++ ++ Enable this option if you get a Linux kernel build failure ++ such as "scripts/extract-cert.c:21:25: fatal error: ++ openssl/bio.h: No such file or directory". ++ + # Linux extensions + source "linux/Config.ext.in" + +diff --git a/linux/linux.mk b/linux/linux.mk +index 3b69524..91d8751 100644 +--- a/linux/linux.mk ++++ b/linux/linux.mk +@@ -80,6 +80,10 @@ LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZMA) += CONFIG_KERNEL_LZMA + LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZO) += CONFIG_KERNEL_LZO + LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_XZ) += CONFIG_KERNEL_XZ + ++ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL),y) ++LINUX_DEPENDENCIES += host-openssl ++endif ++ + # If host-uboot-tools is selected by the user, assume it is needed to + # create a custom image + ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y) +-- +2.7.4 + diff --git a/buildroot/linux/Config.in b/buildroot/linux/Config.in index 025a0e1a5..4d57765b4 100644 --- a/buildroot/linux/Config.in +++ b/buildroot/linux/Config.in @@ -425,6 +425,19 @@ config BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". +config BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL + bool "Needs host OpenSSL" + help + Some Linux kernel configuration options (such as + CONFIG_SYSTEM_TRUSTED_KEYRING) require building a host + program called extract-cert, which itself needs + OpenSSL. Enabling this option will ensure host-openssl gets + built before the Linux kernel. + + Enable this option if you get a Linux kernel build failure + such as "scripts/extract-cert.c:21:25: fatal error: + openssl/bio.h: No such file or directory". + # Linux extensions source "linux/Config.ext.in" diff --git a/buildroot/linux/linux.mk b/buildroot/linux/linux.mk index b724b66f9..99d2254ef 100644 --- a/buildroot/linux/linux.mk +++ b/buildroot/linux/linux.mk @@ -84,6 +84,10 @@ ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF),y) LINUX_DEPENDENCIES += host-elfutils endif +ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL),y) +LINUX_DEPENDENCIES += host-openssl +endif + # If host-uboot-tools is selected by the user, assume it is needed to # create a custom image ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y)