summaryrefslogtreecommitdiffstats
path: root/external/meta-updater/recipes-support
diff options
context:
space:
mode:
authorToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
committerToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
commit5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch)
treeb4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/meta-updater/recipes-support
parent706ad73eb02caf8532deaf5d38995bd258725cb8 (diff)
agl-basesystem
Diffstat (limited to 'external/meta-updater/recipes-support')
-rw-r--r--external/meta-updater/recipes-support/fuse/fuse_%.bbappend3
-rw-r--r--external/meta-updater/recipes-support/gpgme/gpgme_%.bbappend1
-rw-r--r--external/meta-updater/recipes-support/libp11/libp11_git.bb40
-rw-r--r--external/meta-updater/recipes-support/libssh2/libssh2_%.bbappend2
-rw-r--r--external/meta-updater/recipes-support/lshw/files/cross-compile.patch39
-rw-r--r--external/meta-updater/recipes-support/lshw/files/ldflags.patch42
-rw-r--r--external/meta-updater/recipes-support/lshw/lshw_02.17.bb36
-rw-r--r--external/meta-updater/recipes-support/slcand-start/files/slcand@.service8
-rw-r--r--external/meta-updater/recipes-support/slcand-start/slcand-start.bb21
-rw-r--r--external/meta-updater/recipes-support/softhsm-testtoken/files/createtoken.service12
-rw-r--r--external/meta-updater/recipes-support/softhsm-testtoken/files/createtoken.sh27
-rw-r--r--external/meta-updater/recipes-support/softhsm-testtoken/softhsm-testtoken.bb25
-rw-r--r--external/meta-updater/recipes-support/softhsm/softhsm_git.bb26
-rw-r--r--external/meta-updater/recipes-support/systemd-journald-persistent/files/10-persistent-journal.conf3
-rw-r--r--external/meta-updater/recipes-support/systemd-journald-persistent/systemd-journald-persistent.bb20
15 files changed, 305 insertions, 0 deletions
diff --git a/external/meta-updater/recipes-support/fuse/fuse_%.bbappend b/external/meta-updater/recipes-support/fuse/fuse_%.bbappend
new file mode 100644
index 00000000..85bdf502
--- /dev/null
+++ b/external/meta-updater/recipes-support/fuse/fuse_%.bbappend
@@ -0,0 +1,3 @@
+BBCLASSEXTEND_append_sota = " native"
+
+PACKAGES_append_class-native_sota = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ' fuse-utils-dbg-native fuse-utils-native libulockmgr-native libulockmgr-dev-native libulockmgr-dbg-native', ' ', d)}"
diff --git a/external/meta-updater/recipes-support/gpgme/gpgme_%.bbappend b/external/meta-updater/recipes-support/gpgme/gpgme_%.bbappend
new file mode 100644
index 00000000..fccb9499
--- /dev/null
+++ b/external/meta-updater/recipes-support/gpgme/gpgme_%.bbappend
@@ -0,0 +1 @@
+BBCLASSEXTEND_append_sota = " native"
diff --git a/external/meta-updater/recipes-support/libp11/libp11_git.bb b/external/meta-updater/recipes-support/libp11/libp11_git.bb
new file mode 100644
index 00000000..bedcdc82
--- /dev/null
+++ b/external/meta-updater/recipes-support/libp11/libp11_git.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Library for using PKCS"
+DESCRIPTION = "\
+Libp11 is a library implementing a small layer on top of PKCS \
+make using PKCS"
+HOMEPAGE = "http://www.opensc-project.org/libp11"
+SECTION = "Development/Libraries"
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fad9b3332be894bab9bc501572864b29"
+DEPENDS = "libtool openssl"
+RDEPENDS_${PN} += " opensc"
+
+SRC_URI = "git://github.com/OpenSC/libp11.git"
+SRCREV = "57ca68ff67efa08e3be1f26dec6d23bf5bb977f2"
+
+PV = "0.4.9+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+# Currently, Makefile dependencies are incorrectly defined which causes build errors
+# if the number of jobs is high
+# See https://github.com/OpenSC/libp11/issues/94
+PARALLEL_MAKE = ""
+EXTRA_OECONF = "--disable-static"
+
+do_install_append () {
+ rm -rf ${D}${libdir}/*.la
+ rm -rf ${D}${docdir}/${BPN}
+}
+
+FILES_${PN} = "${libdir}/engines*/pkcs11.so \
+ ${libdir}/engines*/libpkcs11${SOLIBS} \
+ ${libdir}/libp11${SOLIBS}"
+
+FILES_${PN}-dev = " \
+ ${libdir}/engines*/libpkcs11${SOLIBSDEV} \
+ ${libdir}/libp11${SOLIBSDEV} \
+ ${libdir}/pkgconfig/libp11.pc \
+ /usr/include"
diff --git a/external/meta-updater/recipes-support/libssh2/libssh2_%.bbappend b/external/meta-updater/recipes-support/libssh2/libssh2_%.bbappend
new file mode 100644
index 00000000..bebaf84c
--- /dev/null
+++ b/external/meta-updater/recipes-support/libssh2/libssh2_%.bbappend
@@ -0,0 +1,2 @@
+# meta-oe/recipes-support/libssh2
+BBCLASSEXTEND_append_sota = " native"
diff --git a/external/meta-updater/recipes-support/lshw/files/cross-compile.patch b/external/meta-updater/recipes-support/lshw/files/cross-compile.patch
new file mode 100644
index 00000000..221b7e53
--- /dev/null
+++ b/external/meta-updater/recipes-support/lshw/files/cross-compile.patch
@@ -0,0 +1,39 @@
+---
+ src/Makefile | 2 +-
+ src/core/Makefile | 2 +-
+ src/gui/Makefile | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -18,7 +18,7 @@ export MANDIR
+ export DATADIR
+ export SQLITE
+
+-CXX?=c++
++CXX?=$(CROSS_COMPILE)c++
+ INCLUDES=-I./core/
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+ CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+--- a/src/core/Makefile
++++ b/src/core/Makefile
+@@ -1,6 +1,6 @@
+ PACKAGENAME?=lshw
+
+-CXX=c++
++CXX?=$(CROSS_COMPILE)c++
+ INCLUDES=
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+ CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+--- a/src/gui/Makefile
++++ b/src/gui/Makefile
+@@ -1,7 +1,7 @@
+ PACKAGENAME?=lshw
+
+-CXX?=c++
+-CC?=cc
++CXX?=$(CROSS_COMPILE)c++
++CC?=$(CROSS_COMPILE)cc
+ STRIP?=strip
+ OBJCOPY?=objcopy
+
diff --git a/external/meta-updater/recipes-support/lshw/files/ldflags.patch b/external/meta-updater/recipes-support/lshw/files/ldflags.patch
new file mode 100644
index 00000000..d95699d2
--- /dev/null
+++ b/external/meta-updater/recipes-support/lshw/files/ldflags.patch
@@ -0,0 +1,42 @@
+diff -Naur /home/anton/lshw-old/src/Makefile lshw-B.02.17/src/Makefile
+--- /home/anton/lshw-old/src/Makefile 2017-02-07 16:21:52.554738182 +0100
++++ lshw-B.02.17/src/Makefile 2017-02-07 16:22:45.578588072 +0100
+@@ -25,9 +25,9 @@
+ ifeq ($(SQLITE), 1)
+ CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
+ endif
+-LDFLAGS=-L./core/ -g
++LDEXTRAS=-L./core/ -g
+ ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
+- LDFLAGS+= -Wl,--as-needed
++ LDEXTRAS+= -Wl,--as-needed
+ endif
+ LDSTATIC=-static
+ LIBS=-llshw -lresolv
+@@ -37,7 +37,7 @@
+
+ export CXXFLAGS
+ export LIBS
+-export LDFLAGS
++export LDEXTRAS
+
+ DATAFILES = pci.ids usb.ids oui.txt manuf.txt
+
+@@ -51,7 +51,7 @@
+ +make -C core all
+
+ $(PACKAGENAME): core $(PACKAGENAME).o
+- $(CXX) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
++ $(CXX) $(LDFLAGS) ${LDEXTRAS} -o $@ $(PACKAGENAME).o $(LIBS)
+
+ .PHONY: po
+ po:
+@@ -69,7 +69,7 @@
+ static: $(PACKAGENAME)-static
+
+ $(PACKAGENAME)-static: core core/lib$(PACKAGENAME).a $(PACKAGENAME).o
+- $(CXX) $(LDSTATIC) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
++ $(CXX) $(LDSTATIC) $(LDFLAGS) ${LDEXTRAS} -o $@ $(PACKAGENAME).o $(LIBS)
+ $(STRIP) $@
+
+ .PHONY: compressed
diff --git a/external/meta-updater/recipes-support/lshw/lshw_02.17.bb b/external/meta-updater/recipes-support/lshw/lshw_02.17.bb
new file mode 100644
index 00000000..1ecc4c10
--- /dev/null
+++ b/external/meta-updater/recipes-support/lshw/lshw_02.17.bb
@@ -0,0 +1,36 @@
+# From meta-linaro
+# http://git.linaro.org/openembedded/meta-linaro.git
+
+DESCRIPTION = "A small tool to provide detailed information on the hardware \
+configuration of the machine. It can report exact memory configuration, \
+firmware version, mainboard configuration, CPU version and speed, cache \
+configuration, bus speed, etc. on DMI-capable or EFI systems."
+SUMMARY = "Hardware lister"
+HOMEPAGE = "http://ezix.org/project/wiki/HardwareLiSter"
+SECTION = "console/tools"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "pciutils \
+ usbutils"
+COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
+
+SRC_URI="http://ezix.org/software/files/lshw-B.${PV}.tar.gz \
+ file://cross-compile.patch \
+ file://ldflags.patch \
+ "
+
+SRC_URI[md5sum] = "a5feb796cb302850eaf5b4530888e3ed"
+SRC_URI[sha256sum] = "eb9cc053fa0f1e78685cb695596e73931bfb55d2377e3bc3b8b94aff4c5a489c"
+
+S="${WORKDIR}/lshw-B.${PV}"
+
+do_compile() {
+ # build core only - don't ship gui
+ oe_runmake -C src core
+}
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+ # data files provided by dependencies
+ rm -rf ${D}/usr/share/lshw
+}
diff --git a/external/meta-updater/recipes-support/slcand-start/files/slcand@.service b/external/meta-updater/recipes-support/slcand-start/files/slcand@.service
new file mode 100644
index 00000000..c5395680
--- /dev/null
+++ b/external/meta-updater/recipes-support/slcand-start/files/slcand@.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Serial CAN daemon (can-utils)
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/slcand -o -c -s4 %I can0
+ExecStartPost=/bin/sh -c '/bin/sleep 3; /sbin/ip link set can0 up'
+
diff --git a/external/meta-updater/recipes-support/slcand-start/slcand-start.bb b/external/meta-updater/recipes-support/slcand-start/slcand-start.bb
new file mode 100644
index 00000000..dfefaeab
--- /dev/null
+++ b/external/meta-updater/recipes-support/slcand-start/slcand-start.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Mock smartcard for aktualizr"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+
+inherit systemd
+
+RDEPENDS_${PN} = "can-utils"
+
+SRC_URI = "file://slcand@.service"
+
+SYSTEMD_SERVICE_${PN} = "slcand@.service"
+
+do_install() {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/slcand@.service ${D}${systemd_unitdir}/system/slcand@.service
+}
+
+FILES_${PN} = "${systemd_unitdir}/system/createtoken.service"
+
diff --git a/external/meta-updater/recipes-support/softhsm-testtoken/files/createtoken.service b/external/meta-updater/recipes-support/softhsm-testtoken/files/createtoken.service
new file mode 100644
index 00000000..23317b90
--- /dev/null
+++ b/external/meta-updater/recipes-support/softhsm-testtoken/files/createtoken.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Create a mock smartcard for testing
+Before=aktualizr.service
+RequiredBy=aktualizr.service
+
+[Service]
+RestartSec=10
+Restart=on-failure
+ExecStart=/usr/bin/createtoken.sh
+
+[Install]
+WantedBy=aktualizr.service
diff --git a/external/meta-updater/recipes-support/softhsm-testtoken/files/createtoken.sh b/external/meta-updater/recipes-support/softhsm-testtoken/files/createtoken.sh
new file mode 100644
index 00000000..fa4569d9
--- /dev/null
+++ b/external/meta-updater/recipes-support/softhsm-testtoken/files/createtoken.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so -O; then
+ # The token has already been initialized, exit
+ exit 0
+fi
+
+if ! ls /var/sota/import/pkey.pem /var/sota/import/client.pem; then
+ # Key/certificate pair is not present, repeat
+ exit 1
+fi
+
+mkdir -p /var/lib/softhsm/tokens
+softhsm2-util --init-token --slot 0 --label "Virtual token" --pin 1234 --so-pin 1234
+
+openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in /var/sota/import/pkey.pem -out /var/sota/import/pkey.p8
+softhsm2-util --import /var/sota/import/pkey.p8 --label "pkey" --id 02 --token 'Virtual token' --pin 1234
+openssl x509 -outform der -in /var/sota/import/client.pem -out /var/sota/import/client.der
+pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so --id 1 --write-object /var/sota/import/client.der --type cert --login --pin 1234
+
+# Import UPTANE keypair if it exists
+if [ -f /var/sota/import/ecukey.pem ]; then
+ openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in /var/sota/import/ecukey.pem -out /var/sota/import/ecukey.p8
+ softhsm2-util --import /var/sota/import/ecukey.p8 --label "uptanekey" --id 03 --token 'Virtual token' --pin 1234
+fi
+
+exit 0
diff --git a/external/meta-updater/recipes-support/softhsm-testtoken/softhsm-testtoken.bb b/external/meta-updater/recipes-support/softhsm-testtoken/softhsm-testtoken.bb
new file mode 100644
index 00000000..58b521c3
--- /dev/null
+++ b/external/meta-updater/recipes-support/softhsm-testtoken/softhsm-testtoken.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Mock smartcard for aktualizr"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit systemd
+
+RDEPENDS_${PN} = "softhsm libp11 openssl-bin"
+DEPENDS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
+
+
+SRC_URI = "file://createtoken.service \
+ file://createtoken.sh"
+
+SYSTEMD_SERVICE_${PN} = "createtoken.service"
+
+do_install() {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/createtoken.service ${D}${systemd_unitdir}/system/createtoken.service
+ install -d ${D}${bindir}
+ install -m 0744 ${WORKDIR}/createtoken.sh ${D}${bindir}/createtoken.sh
+}
+
+FILES_${PN} = "${bindir}/createtoken.sh \
+ ${systemd_unitdir}/system/createtoken.service"
+
diff --git a/external/meta-updater/recipes-support/softhsm/softhsm_git.bb b/external/meta-updater/recipes-support/softhsm/softhsm_git.bb
new file mode 100644
index 00000000..4dcfe7db
--- /dev/null
+++ b/external/meta-updater/recipes-support/softhsm/softhsm_git.bb
@@ -0,0 +1,26 @@
+SUMMARY = "HSM emulator"
+HOMEPAGE = "https://www.opendnssec.org/softhsm/"
+LICENSE = "BSD-2-Clause & ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ef3f77a3507c3d91e75b9f2bdaee4210"
+
+DEPENDS = "openssl"
+
+SRC_URI = "git://github.com/opendnssec/SoftHSMv2.git;branch=master"
+SRCREV = "369df0383d101bc8952692c2a368ac8bc887d1b4"
+
+PV = "2.5.0"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+# EdDSA requires OpenSSL >= 1.1.1
+EXTRA_OECONF = "--enable-eddsa --disable-gost"
+
+do_configure_prepend() {
+ (
+ cd ${S}
+ unset docdir
+ sh ./autogen.sh
+ )
+}
diff --git a/external/meta-updater/recipes-support/systemd-journald-persistent/files/10-persistent-journal.conf b/external/meta-updater/recipes-support/systemd-journald-persistent/files/10-persistent-journal.conf
new file mode 100644
index 00000000..a56527c8
--- /dev/null
+++ b/external/meta-updater/recipes-support/systemd-journald-persistent/files/10-persistent-journal.conf
@@ -0,0 +1,3 @@
+[Journal]
+Storage=persistent
+SystemMaxUse=64M
diff --git a/external/meta-updater/recipes-support/systemd-journald-persistent/systemd-journald-persistent.bb b/external/meta-updater/recipes-support/systemd-journald-persistent/systemd-journald-persistent.bb
new file mode 100644
index 00000000..1715fe11
--- /dev/null
+++ b/external/meta-updater/recipes-support/systemd-journald-persistent/systemd-journald-persistent.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Configuration for systemd-journald"
+DESCRIPTION = "Provides configuration for systemd-journald, so that logs are \
+stored on persistent storage"
+LICENSE = "MPL-2.0"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SRC_URI_append = " file://10-persistent-journal.conf"
+PR = "r1"
+
+S = "${WORKDIR}"
+
+FILES_${PN} = "${systemd_unitdir}/journald.conf.d/*"
+
+do_install() {
+ install -d ${D}/${systemd_unitdir}/journald.conf.d
+ install -m 0644 ${WORKDIR}/10-persistent-journal.conf ${D}/${systemd_unitdir}/journald.conf.d
+}
+