From c7245d5886365a7c61b1965226ce3ddaa71d5a5c Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 27 Oct 2019 21:30:44 -0700 Subject: [PATCH 1/2] x86: fix x86/x64 image packed in wrong format --- Makefile | 14 ++------------ rules.mk | 5 +++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 181c33b180..5301883061 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir world: -DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep -E '\/usr' | head -n 1) export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH) ifneq ($(OPENWRT_BUILD),1) @@ -90,21 +89,12 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages checksum: FORCE $(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT)) -buildversion: FORCE - $(SCRIPT_DIR)/getver.sh > $(BIN_DIR)/version.buildinfo - -feedsversion: FORCE - $(SCRIPT_DIR)/feeds list -fs > $(BIN_DIR)/feeds.buildinfo - diffconfig: FORCE mkdir -p $(BIN_DIR) - $(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.buildinfo - -buildinfo: FORCE - $(_SINGLE)$(SUBMAKE) -r diffconfig buildversion feedsversion + $(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile) - $(_SINGLE)$(SUBMAKE) -r buildinfo + $(_SINGLE)$(SUBMAKE) -r diffconfig world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE $(_SINGLE)$(SUBMAKE) -r package/index diff --git a/rules.mk b/rules.mk index fbf42f725d..1bf59fbb4a 100644 --- a/rules.mk +++ b/rules.mk @@ -70,7 +70,6 @@ TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX)) BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX)) SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR}) BUILD_SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR}) -NPROC:=$(shell sysctl -n hw.ncpu 2>/dev/null || nproc) export SHELL:=/usr/bin/env bash IS_PACKAGE_BUILD := $(if $(filter package/%,$(BUILD_SUBDIR)),1) @@ -160,7 +159,7 @@ TARGET_ROOTFS_DIR?=$(if $(call qstrip,$(CONFIG_TARGET_ROOTFS_DIR)),$(call qstrip TARGET_DIR:=$(TARGET_ROOTFS_DIR)/root-$(BOARD) STAGING_DIR_ROOT:=$(STAGING_DIR)/root-$(BOARD) STAGING_DIR_IMAGE:=$(STAGING_DIR)/image -BUILD_LOG_DIR:=$(if $(call qstrip,$(CONFIG_BUILD_LOG_DIR)),$(call qstrip,$(CONFIG_BUILD_LOG_DIR)),$(TOPDIR)/logs) +BUILD_LOG_DIR:=$(TOPDIR)/logs PKG_INFO_DIR := $(STAGING_DIR)/pkginfo BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR_BASE)/hostpkg,$(BUILD_DIR_BASE)/host) @@ -184,6 +183,8 @@ else LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.a)) LIBGCC_S=$(if $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so),-L$(TOOLCHAIN_DIR)/lib -lgcc_s,$(LIBGCC_A)) endif +LIBRPC=-lrpc +LIBRPC_DEPENDS=+librpc ifeq ($(CONFIG_ARCH_64BIT),y) LIB_SUFFIX:=64 From 5a5c1367e941ab06a4fe444ecad61e538bd4ddb2 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 27 Oct 2019 21:55:39 -0700 Subject: [PATCH 2/2] x86: fix kmod-crypto-deflate compile error in kernel 4.19 --- package/kernel/linux/modules/crypto.mk | 78 +++++++++++++++++++++++--- target/linux/x86/Makefile | 2 +- 2 files changed, 72 insertions(+), 8 deletions(-) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index d70eb924c3..dc7eb77986 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -40,15 +40,26 @@ define KernelPackage/crypto-aead CONFIG_CRYPTO_AEAD2 FILES:=$(LINUX_DIR)/crypto/aead.ko AUTOLOAD:=$(call AutoLoad,09,aead,1) - $(call AddDepends/crypto, +!LINUX_3_18:kmod-crypto-null) + $(call AddDepends/crypto, +kmod-crypto-null) endef $(eval $(call KernelPackage,crypto-aead)) +define KernelPackage/crypto-arc4 + TITLE:=ARC4 cipher CryptoAPI module + KCONFIG:=CONFIG_CRYPTO_ARC4 + FILES:=$(LINUX_DIR)/crypto/arc4.ko + AUTOLOAD:=$(call AutoLoad,09,arc4) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-arc4)) + + define KernelPackage/crypto-authenc TITLE:=Combined mode wrapper for IPsec - DEPENDS:=+kmod-crypto-manager +!LINUX_3_18:kmod-crypto-null + DEPENDS:=+kmod-crypto-manager +kmod-crypto-null KCONFIG:=CONFIG_CRYPTO_AUTHENC FILES:=$(LINUX_DIR)/crypto/authenc.ko AUTOLOAD:=$(call AutoLoad,09,authenc) @@ -145,7 +156,7 @@ $(eval $(call KernelPackage,crypto-cts)) define KernelPackage/crypto-deflate TITLE:=Deflate compression CryptoAPI module - DEPENDS:=+kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +!(LINUX_3_18||LINUX_4_9):kmod-crypto-acompress + DEPENDS:=+kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +!LINUX_4_9:kmod-crypto-acompress KCONFIG:=CONFIG_CRYPTO_DEFLATE FILES:=$(LINUX_DIR)/crypto/deflate.ko AUTOLOAD:=$(call AutoLoad,09,deflate) @@ -180,7 +191,7 @@ $(eval $(call KernelPackage,crypto-ecb)) define KernelPackage/crypto-ecdh TITLE:=ECDH algorithm - DEPENDS:=@!LINUX_3_18 +kmod-crypto-kpp + DEPENDS:=+kmod-crypto-kpp KCONFIG:= CONFIG_CRYPTO_ECDH FILES:= \ $(LINUX_DIR)/crypto/ecdh_generic.ko @@ -226,6 +237,18 @@ endef $(eval $(call KernelPackage,crypto-gcm)) +define KernelPackage/crypto-xcbc + TITLE:=XCBC CryptoAPI module + DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager + KCONFIG:=CONFIG_CRYPTO_XCBC + FILES:=$(LINUX_DIR)/crypto/xcbc.ko + AUTOLOAD:=$(call AutoLoad,09,xcbc) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-xcbc)) + + define KernelPackage/crypto-gf128 TITLE:=GF(2^128) multiplication functions CryptoAPI module KCONFIG:=CONFIG_CRYPTO_GF128MUL @@ -274,7 +297,7 @@ $(eval $(call KernelPackage,crypto-hmac)) define KernelPackage/crypto-hw-ccp TITLE:=AMD Cryptographic Coprocessor - DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash +kmod-crypto-manager +kmod-random-core +kmod-crypto-sha1 +kmod-crypto-sha256 +!(LINUX_3_18||LINUX_4_9):kmod-crypto-rsa + DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash +kmod-crypto-manager +kmod-random-core +kmod-crypto-sha1 +kmod-crypto-sha256 +!LINUX_4_9:kmod-crypto-rsa KCONFIG:= \ CONFIG_CRYPTO_HW=y \ CONFIG_CRYPTO_DEV_CCP=y \ @@ -338,6 +361,31 @@ endef $(eval $(call KernelPackage,crypto-hw-padlock)) +define KernelPackage/crypto-hw-safexcel + TITLE:= MVEBU SafeXcel Crypto Engine module + DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) \ + +kmod-crypto-authenc +kmod-crypto-md5 +kmod-crypto-hmac +kmod-crypto-sha256 +kmod-crypto-sha512 + KCONFIG:= \ + CONFIG_CRYPTO_HW=y \ + CONFIG_CRYPTO_DEV_SAFEXCEL + FILES:=$(LINUX_DIR)/drivers/crypto/inside-secure/crypto_safexcel.ko + AUTOLOAD:=$(call AutoLoad,90,crypto_safexcel) + $(call AddDepends/crypto) +endef + +define KernelPackage/crypto-hw-safexcel/description +MVEBU's EIP97 and EIP197 Cryptographic Engine driver designed by +Inside Secure. This is found on Marvell Armada 37xx/7k/8k SoCs. + +Particular version of these IP (EIP197B and EIP197D) require firmware. +Unfortunately it's not freely available and needs signed Non-Disclosure +Agreement (NDA) with Marvell. For those who have signed NDA the firmware can be +obtained at https://extranet.marvell.com. +endef + +$(eval $(call KernelPackage,crypto-hw-safexcel)) + + define KernelPackage/crypto-hw-talitos TITLE:=Freescale integrated security engine (SEC) driver DEPENDS:=+kmod-crypto-manager +kmod-crypto-hash +kmod-random-core +kmod-crypto-authenc +kmod-crypto-des @@ -571,7 +619,7 @@ $(eval $(call KernelPackage,crypto-pcompress)) define KernelPackage/crypto-rsa TITLE:=RSA algorithm - DEPENDS:=@!LINUX_3_18 +kmod-crypto-manager +kmod-asn1-decoder + DEPENDS:=+kmod-crypto-manager +kmod-asn1-decoder KCONFIG:= CONFIG_CRYPTO_RSA HIDDEN:=1 FILES:= \ @@ -585,6 +633,18 @@ endef $(eval $(call KernelPackage,crypto-rsa)) +define KernelPackage/crypto-rmd160 + TITLE:=RIPEMD160 digest CryptoAPI module + DEPENDS:=+kmod-crypto-hash + KCONFIG:=CONFIG_CRYPTO_RMD160 + FILES:=$(LINUX_DIR)/crypto/rmd160.ko + AUTOLOAD:=$(call AutoLoad,09,rmd160) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-rmd160)) + + define KernelPackage/crypto-rng TITLE:=CryptoAPI random number generation DEPENDS:=+kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha256 @@ -709,13 +769,17 @@ define KernelPackage/crypto-user DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager KCONFIG:= \ CONFIG_CRYPTO_USER_API \ + CONFIG_CRYPTO_USER_API_AEAD \ CONFIG_CRYPTO_USER_API_HASH \ + CONFIG_CRYPTO_USER_API_RNG \ CONFIG_CRYPTO_USER_API_SKCIPHER FILES:= \ $(LINUX_DIR)/crypto/af_alg.ko \ + $(LINUX_DIR)/crypto/algif_aead.ko \ $(LINUX_DIR)/crypto/algif_hash.ko \ + $(LINUX_DIR)/crypto/algif_rng.ko \ $(LINUX_DIR)/crypto/algif_skcipher.ko - AUTOLOAD:=$(call AutoLoad,09,af_alg algif_hash algif_skcipher) + AUTOLOAD:=$(call AutoLoad,09,af_alg algif_aead algif_hash algif_rng algif_skcipher) $(call AddDepends/crypto) endef diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index 259cecd0e8..26b13dca16 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -13,7 +13,7 @@ FEATURES:=squashfs vdi vmdk pcmcia fpu SUBTARGETS:=64 generic legacy geode MAINTAINER:=Felix Fietkau -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.19 KERNELNAME:=bzImage