bsp: remove nrsw specific parts

id: 413750
This commit is contained in:
Marcel Reichmuth 2023-08-08 08:06:28 +02:00
parent df41099105
commit 8f2f98d15b
11 changed files with 50 additions and 239 deletions

View File

@ -13,6 +13,6 @@ INODE_SIZE = "1024"
DIR_INODE_SIZE = "1024"
FILE_INODE_SIZE = "0"
DISTRO_FEATURES:remove += "bluetooth bluez5"
MACHINE_FEATURES:remove = "bluetooth"
PREFERRED_PROVIDER_virtual/kernel = "linux-nrsw"

View File

@ -1,2 +0,0 @@
RDEPENDS_${PN}:remove += "python"

View File

@ -1,22 +0,0 @@
diff --git a/arch/arm/boot/dts/am335x-nbhw16-prod2.dts b/arch/arm/boot/dts/am335x-nbhw16-prod2.dts
index 1871d78bca89..b4830a8ef61c 100755
--- a/arch/arm/boot/dts/am335x-nbhw16-prod2.dts
+++ b/arch/arm/boot/dts/am335x-nbhw16-prod2.dts
@@ -73,7 +73,7 @@ netbox_dio: netbox_dio {
wlan_bt_clock: wlan_bt_clock {
compatible = "pwm-clock";
#clock-cells = <0>;
- pwms = <&ecap2 0 30518 0>;
+ pwms = <&ecap_2 0 30518 0>;
};
wlan_bt_oscillator: wlan_bt_oscillator {
@@ -93,7 +93,7 @@ &reset_button {
&epwmss2 {
status = "okay";
- ecap2: ecap@48304100 {
+ ecap_2: ecap@48304100 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&ecap2_pins>;

View File

@ -1,6 +0,0 @@
#ifndef _BD_KEY_H
#define _BD_KEY_H
static const unsigned char BD_KEY[] = { 0xa1, 0x73, 0x17, 0x9a, 0x5e, 0xf4, 0x42, 0xb9, 0xae, 0x8c,
0xa3, 0xcd, 0x75, 0x63, 0xd3, 0x91, 0x4f, 0x11, 0xf1, 0x7b};
#endif

View File

@ -1,7 +0,0 @@
#ifndef _BOFH_KEY
#define _BOFH_KEY
#define BOFH_KEY_PRESENT 0
#warning bofh key is missing
#endif

View File

@ -4041,7 +4041,7 @@ CONFIG_CRYPTO_JITTERENTROPY=y
# CONFIG_CRYPTO_USER_API_RNG is not set
# CONFIG_CRYPTO_USER_API_AEAD is not set
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_BOFH_KEY=y
# CONFIG_BOFH_KEY is not set
#
# Crypto library routines
@ -4072,8 +4072,8 @@ CONFIG_PKCS7_MESSAGE_PARSER=y
#
# Certificates for signature checking
#
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS="certs/firmware_signing.pem"
# CONFIG_SYSTEM_TRUSTED_KEYRING is not set
# CONFIG_SYSTEM_TRUSTED_KEYS is not set
# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set
# CONFIG_SECONDARY_TRUSTED_KEYRING is not set
# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set

View File

@ -4390,7 +4390,7 @@ CONFIG_CRYPTO_JITTERENTROPY=y
# CONFIG_CRYPTO_USER_API_RNG is not set
# CONFIG_CRYPTO_USER_API_AEAD is not set
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_BOFH_KEY=y
# CONFIG_BOFH_KEY is not set
#
# Crypto library routines
@ -4423,8 +4423,8 @@ CONFIG_PKCS7_MESSAGE_PARSER=y
#
# Certificates for signature checking
#
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS="certs/firmware_signing.pem"
# CONFIG_SYSTEM_TRUSTED_KEYRING is not set
# CONFIG_SYSTEM_TRUSTED_KEYS is not set
# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set
# CONFIG_SECONDARY_TRUSTED_KEYRING is not set
# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set

View File

@ -1,48 +0,0 @@
#ifndef _LICENSE_KEY_H
#define _LICENSE_KEY_H
#define HMAC_KEY_SIZE 20
#define SHA1_DIGEST_SIZE 20
#define MOD_LENGTH 1536
/* RSA public key */
static
unsigned char rsa1536E[MOD_LENGTH/8] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01,
} ;
static
unsigned char rsa1536N[MOD_LENGTH/8] =
{
0xA1, 0xFD, 0x5A, 0xC5, 0x77, 0xB8, 0xCC, 0x20, 0xFC, 0x80, 0xC2, 0xF0, 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AC_KEY_SIZE] = {0x17, 0x5e, 0x73, 0x42, 0xb9, 0xae, 0x11, 0xcd, 0x91, 0xa3,
0x9a, 0xf4, 0x8c, 0xa1, 0x7b, 0x4f, 0x63, 0xf1, 0x75, 0xd3};
#endif

View File

@ -1,44 +0,0 @@
#!/usr/bin/python3
def config_merge_log_is_ok(log_file):
import re
str1_pattern = re.compile("^Value requested for (.*) not in final \.config")
requested_pattern = re.compile("^Requested value: (.*)$")
actual_pattern = re.compile("^Actual value: (.*)$")
is_not_set_pattern = re.compile("^# (.*) is not set$")
val, requested = None, None
with open(log_file, "r") as f:
for line in f:
if requested:
match = actual_pattern.match(line)
if not match:
raise ValueError("Can't determine actual config value")
actual = match.group(1)
if (not actual) and is_not_set:
val, requested = None, None
continue
return False
if val:
match = requested_pattern.match(line)
if not match:
raise ValueError("Can't determine requested config value")
requested = match.group(1)
match = is_not_set_pattern.match(requested)
is_not_set = True if match else False
continue
if not val:
match = str1_pattern.match(line)
if not match:
continue
val = match.group(1)
continue
return True
if __name__ == "__main__":
import sys
try:
ret = config_merge_log_is_ok(sys.argv[1])
except Exception as err:
ret = False
if not ret:
sys.exit(1)

View File

@ -1,103 +0,0 @@
HOMEPAGE = "http://www.kernel.org"
DESCRIPTION = "Linux kernel for various NetModule hardware"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
inherit kernel
ROOTFS_RELEASE ?= "0.0.0.0"
KERNEL_MODULES_CONF_DIR = "${BPN}/modules"
require ${KERNEL_MODULES_CONF_DIR}/${DISTRO}.inc
require ${KERNEL_MODULES_CONF_DIR}/${NM_TARGET}.inc
headers_to_copy = "\
bd-key.h \
bofh-key.h \
license-key.h \
"
config = "${@' '.join(['conf/' + f for f in "\
${NM_TARGET}_defconfig \
".split()])}"
SRC_URI = "git://git.netmodule.intranet/NRSW/nmlinux-kernel.git;protocol=ssh;user=gitea;branch=nmlinux-kernel-upgrade\
${@' '.join(['file://' + f for f in " ${headers_to_copy} ${config} ".split()])} \
"
SRCREV ?= "${AUTOREV}"
PV = "5.X+git${SRCPV}"
PR = "r0"
S = "${WORKDIR}/git"
INSANE_SKIP_${PN} += "version-going-backwards"
DEPENDS += "openssl-native"
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
KERNEL_DEFCONFIG = "${NM_TARGET}_defconfig"
do_configure:append() {
for f in ${config}; do
cp ${WORKDIR}/${f} ${S}/arch/arm/configs/
done
if [ "${KERNEL_DEFCONFIG}" != "" ]; then
oe_runmake ${KERNEL_DEFCONFIG}
fi
re="\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)"
NBSW_VERSION_MAJOR=$(echo ${ROOTFS_RELEASE} | sed "s/${re}/\1/")
NBSW_VERSION_MINOR=$(echo ${ROOTFS_RELEASE} | sed "s/${re}/\2/")
NBSW_VERSION_PATCH=$(echo ${ROOTFS_RELEASE} | sed "s/${re}/\3/")
NBSW_VERSION_BUILD=$(echo ${ROOTFS_RELEASE} | sed "s/${re}/\4/")
cat << EOF > ${S}/include/nbsw.h
#define NBSW_VERSION_MAJOR ${NBSW_VERSION_MAJOR}
#define NBSW_VERSION_MINOR ${NBSW_VERSION_MINOR}
#define NBSW_VERSION_PATCH ${NBSW_VERSION_PATCH}
#define NBSW_VERSION_BUILD ${NBSW_VERSION_BUILD}
#define NBSW_VERSION_DATE "$(date +%Y%m%d%H%M%S)"
#define NBSW_PROFILE "$(echo ${NM_TARGET} | awk '{ print toupper($0) }')"
#define NBSW_TARGET_${NM_TARGET}_${NM_ARCH} 1
EOF
for f in ${headers_to_copy}; do
cp ${WORKDIR}/${f} ${S}/include/
done
openssl x509 -in ${S}/firmware.crt -outform PEM -out ${S}/certs/firmware_signing.pem
bbnote "Writing genkey config to ${B}/certs/x509.genkey"
mkdir -p ${B}/certs/
cat > ${B}/certs/x509.genkey << EOF
[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
prompt = no
string_mask = utf8only
x509_extensions = myexts
[ req_distinguished_name ]
O = ${VENDOR_NAME} ${VENDOR_EXT}
L = ${VENDOR_LOCATION}
CN = ${PRODUCT} signing key
emailAddress = ${VENDOR_EMAIL}
[ myexts ]
basicConstraints=critical,CA:FALSE
keyUsage=digitalSignature
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
EOF
# install BOFH key, if available
PROFILE=$(echo "${NM_TARGET}" | tr '[:lower:]' '[:upper:]')
BOFH_CERT="${BOFH_KEY_PATH}/public/bofhkey-${PROFILE}.pub.crt"
if [ -r "$BOFH_CERT" ] ; then
BOFH_KEY_FILE="${S}/include/bofh-key.h"
GENBOFHKEY="genbofhkey"
if ! $GENBOFHKEY -c $BOFH_CERT -o $BOFH_KEY_FILE; then
bbfatal_log "unable to add bofh key"
fi
fi
}
FILES_${KERNEL_PACKAGE_NAME}-image += "${KERNEL_IMAGEDEST}/kernel.bin"

View File

@ -0,0 +1,43 @@
HOMEPAGE = "http://www.kernel.org"
DESCRIPTION = "Linux kernel for various NetModule hardware"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
inherit kernel
ROOTFS_RELEASE ?= "0.0.0.0"
KERNEL_MODULES_CONF_DIR = "${BPN}/modules"
require ${KERNEL_MODULES_CONF_DIR}/${DISTRO}.inc
require ${KERNEL_MODULES_CONF_DIR}/${NM_TARGET}.inc
config = "${@' '.join(['conf/' + f for f in "\
${NM_TARGET}_defconfig \
".split()])}"
SRC_URI = "git://git.netmodule.intranet/NRSW/nmlinux-kernel.git;protocol=ssh;user=gitea;branch=nmlinux-kernel-upgrade\
${@' '.join(['file://' + f for f in " ${config} ".split()])} \
"
SRCREV ?= "85f5f38b6ced73852a213bba35fb83102b7aa167"
PV = "git${SRCPV}"
PR = "r0"
S = "${WORKDIR}/git"
INSANE_SKIP_${PN} += "version-going-backwards"
DEPENDS += "openssl-native"
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
KERNEL_DEFCONFIG = "${NM_TARGET}_defconfig"
do_configure:append() {
for f in ${config}; do
cp ${WORKDIR}/${f} ${S}/arch/arm/configs/
done
if [ "${KERNEL_DEFCONFIG}" != "" ]; then
oe_runmake ${KERNEL_DEFCONFIG}
fi
}
FILES_${KERNEL_PACKAGE_NAME}-image += "${KERNEL_IMAGEDEST}/kernel.bin"