summaryrefslogtreecommitdiff
path: root/meta-phosphor/dynamic-layers/nuvoton-layer
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2022-02-18 23:47:01 +0300
committerPatrick Williams <patrick@stwcx.xyz>2022-02-22 21:04:04 +0300
commita95e0907e4ced0ba950449b7ef1b04e2c75a5381 (patch)
treed972910fbd3f74e5c0cfb74831b5f7c48be16a6f /meta-phosphor/dynamic-layers/nuvoton-layer
parent8045cc5ec966ad1de76531b6ea6b3e8322a2b48b (diff)
downloadopenbmc-a95e0907e4ced0ba950449b7ef1b04e2c75a5381.tar.xz
meta-phosphor: migrate nuvoton-layer to dynamic-layers
The proper way to add extensions to another layer is with BBFILES_DYNAMIC rather than adding to BBFILES based on BBFILE_COLLECTIONS. Move nuvoton-layer to a dynamic-layers subdirectory and hook into layer.conf using BBFILES_DYNAMIC. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic1b1f0ce837a899c5060531735c75c73cf51f1f5
Diffstat (limited to 'meta-phosphor/dynamic-layers/nuvoton-layer')
-rw-r--r--meta-phosphor/dynamic-layers/nuvoton-layer/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend1
-rwxr-xr-xmeta-phosphor/dynamic-layers/nuvoton-layer/recipes-connectivity/jsnbd/jsnbd/state_hook68
-rw-r--r--meta-phosphor/dynamic-layers/nuvoton-layer/recipes-connectivity/jsnbd/jsnbd_git.bbappend9
-rw-r--r--meta-phosphor/dynamic-layers/nuvoton-layer/recipes-kernel/linux/linux-nuvoton_%.bbappend5
-rw-r--r--meta-phosphor/dynamic-layers/nuvoton-layer/recipes-phosphor/host/phosphor-host-postd_%.bbappend1
5 files changed, 84 insertions, 0 deletions
diff --git a/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
new file mode 100644
index 0000000000..ab57dadb31
--- /dev/null
+++ b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
@@ -0,0 +1 @@
+require recipes-bsp/u-boot/u-boot-obmc.inc
diff --git a/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-connectivity/jsnbd/jsnbd/state_hook b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-connectivity/jsnbd/jsnbd/state_hook
new file mode 100755
index 0000000000..d317e2e9b7
--- /dev/null
+++ b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-connectivity/jsnbd/jsnbd/state_hook
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+if [ $# -ne 2 ]
+then
+ echo "usage: $0 <start|stop> <config>" >&2
+ exit 1
+fi
+
+action=$1
+config=$2
+
+gadget_name=mass-storage
+gadget_dir=/sys/kernel/config/usb_gadget/$gadget_name
+
+case "$config" in
+0)
+ nbd_device=/dev/nbd0
+ ;;
+*)
+ echo "invalid config $config" >&2
+ exit 1
+ ;;
+esac
+
+set -ex
+
+case "$action" in
+start)
+ mkdir -p $gadget_dir
+ (
+ cd $gadget_dir
+ # http://www.linux-usb.org/usb.ids
+ # |-> 1d6b Linux Foundation
+ # |-> 0104 Multifunction Composite Gadget
+ echo "0x1d6b" > idVendor
+ echo "0x0104" > idProduct
+ mkdir -p strings/0x409
+ echo "OpenBMC" > strings/0x409/manufacturer
+ echo "Virtual Media Device" > strings/0x409/product
+ mkdir -p configs/c.1/strings/0x409
+ echo "config 1" > configs/c.1/strings/0x409/configuration
+ mkdir -p functions/mass_storage.usb0
+ ln -s functions/mass_storage.usb0 configs/c.1
+ echo 1 > functions/mass_storage.usb0/lun.0/removable
+ echo 1 > functions/mass_storage.usb0/lun.0/ro
+ echo 0 > functions/mass_storage.usb0/lun.0/cdrom
+ echo $nbd_device > functions/mass_storage.usb0/lun.0/file
+ echo "f0831000.udc" > UDC
+ )
+ ;;
+stop)
+ (
+ cd $gadget_dir
+ rm configs/c.1/mass_storage.usb0
+ rmdir functions/mass_storage.usb0
+ rmdir configs/c.1/strings/0x409
+ rmdir configs/c.1
+ rmdir strings/0x409
+ )
+ rmdir $gadget_dir
+ ;;
+*)
+ echo "invalid action $action" >&2
+ exit 1
+esac
+
+exit 0
+
diff --git a/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-connectivity/jsnbd/jsnbd_git.bbappend b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-connectivity/jsnbd/jsnbd_git.bbappend
new file mode 100644
index 0000000000..1061a9271f
--- /dev/null
+++ b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-connectivity/jsnbd/jsnbd_git.bbappend
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+FILES:${PN} += "${sysconfdir}/nbd-proxy/state"
+SRC_URI += "file://state_hook"
+
+do_install:append() {
+ install -d ${D}${sysconfdir}/nbd-proxy/
+ install -m 0755 ${WORKDIR}/state_hook ${D}${sysconfdir}/nbd-proxy/state
+}
diff --git a/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-kernel/linux/linux-nuvoton_%.bbappend b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-kernel/linux/linux-nuvoton_%.bbappend
new file mode 100644
index 0000000000..848627ac75
--- /dev/null
+++ b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-kernel/linux/linux-nuvoton_%.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+# OpenBMC loads in kernel features via other mechanisms so this check
+# in the kernel-yocto.bbclass is not required
+KERNEL_DANGLING_FEATURES_WARN_ONLY="1"
diff --git a/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-phosphor/host/phosphor-host-postd_%.bbappend b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-phosphor/host/phosphor-host-postd_%.bbappend
new file mode 100644
index 0000000000..7ab27ce0bd
--- /dev/null
+++ b/meta-phosphor/dynamic-layers/nuvoton-layer/recipes-phosphor/host/phosphor-host-postd_%.bbappend
@@ -0,0 +1 @@
+SNOOP_DEVICE:npcm7xx = "npcm7xx-lpc-bpc0"