added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,15 @@
SUMMARY = "Add udev rules to set GPIO to dialout group"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
DEPENDS = "udev"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI = "file://99-gpio-group.rules"
do_install() {
install -D -p -m0664 ${WORKDIR}/99-gpio-group.rules \
${D}${sysconfdir}/udev/rules.d/99-gpio-group.rules
}

View File

@@ -0,0 +1,2 @@
# Add /dev/gpiochip to dialout group, like Raspberry, to allow weston user to access GPIO
ACTION=="add", KERNEL=="gpio*", SUBSYSTEM=="gpio", GROUP="dialout"

View File

@@ -0,0 +1,4 @@
ACTION=="remove", SUBSYSTEM=="usb", RUN+="/usr/sbin/stm32mp-usbip-bind-unbind.sh remove %p"
ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", RUN+="/usr/sbin/stm32mp-usbip-bind-unbind.sh add %p"

View File

@@ -0,0 +1,45 @@
USB IP:
------
REF:
https://developer.ridgerun.com/wiki/index.php?title=How_to_setup_and_use_USB/IP
Server configuration:
---------------------
The package usbip provide the tools and service to enable a serveur for usbip.
To enable it on server:
$> systemctl enable usbip
$> systemctl start usbip
Client configuration and way of working (Linux ubuntu PC):
----------------------------------------------------------
Pre-requisite on ubuntu:
sudo apt-get install sysfsutils libwrap0-dev libglib2.0-dev libtool automake autoconf pkg-config linux-tools-generic
Download ids file and install it:
wget http://www.linux-usb.org/usb.ids
sudo mkdir -p /usr/share/hwdata/
sudo cp usb.ids /usr/share/hwdata/
Setup:
sudo modprobe usbip-core
sudo modprobe vhci-hcd
Can be automaticaly load at runtime by putting it on module load:
echo "usbip-core" > /etc/modules-load.d/usbip.conf
echo "vhci-hcd" >> /etc/modules-load.d/usbip.conf
List usb remote available on specific server:
sudo usbip list -r <server IP>
attach an USB:
sudo usbip attach -r <server IP> -b <USB ID>
Detach
sudo usbip port
sudo usbip detach -p 00
NOTE: if "usbip attach" return an error like:
"usbip: info: no exportable devices found on 10.48.0.144"
That meanin there is no usb device plugged on server.

View File

@@ -0,0 +1,41 @@
#!/bin/sh -
#echo "Parameter number $#" >> /tmp/usbip.log
action=$1
devpath=$2
#echo "Parameter: $1" >> /tmp/usbip.log
#echo "Parameter: $2" >> /tmp/usbip.log
case $1 in
unload)
modprobe -r usbip-core
modprobe -r usbip-host
kill -9 `pgrep usbipd`
exit 0
;;
esac
subpath=$(echo $2 | sed "s|.*/\([^/]*\)|\1|")
#echo "subpath >$subpath<" >> /tmp/usbip.log
if $(echo $subpath | grep -q ":");
then
#echo "No valid path" >> /tmp/usbip.log
exit 0
fi
# if usbip-core are not loaded, do nothing
if [ -z "$(cat /proc/modules | grep usbip_core)" ]; then
#echo "no module usbip_core loaded" >> /tmp/usbip.log
exit 0
fi
case $1 in
add)
#echo ">>> bind $subpath" >> /tmp/usbip.log
usbip bind -b $subpath
;;
remove)
#echo "<<< unbind $subpath" >> /tmp/usbip.log
usbip unbind -b $subpath
;;
esac

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
blacklist usbip-core
blacklist usbip-host

View File

@@ -0,0 +1,15 @@
[Unit]
Description=USB-IP Bindind
After=network.target
Wants=network.target
[Service]
Type=forking
ExecStartPre=-/sbin/modprobe usbip-core
ExecStartPre=-/sbin/modprobe usbip-host
ExecStart=/usr/sbin/usbipd -D
ExecStop=/usr/sbin/stm32mp-usbip-bind-unbind.sh unload
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,66 @@
SUMMARY = "USB ip tools"
DESCRIPTION = "USB ip tools from linux kernel"
HOMEPAGE = "https://www.kernel.org"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
PV = "2.0"
PR = "r1"
SRC_URI += " \
file://99-usb-usbip.rules \
file://stm32mp-usbip-bind-unbind.sh \
file://usb.ids \
file://usbip.service \
file://usbip.conf \
"
DEPENDS = " \
tcp-wrappers \
systemd \
"
USBIP_SRC ?= "tools/usb/usbip"
do_configure[depends] += "virtual/kernel:do_shared_workdir"
inherit linux-kernel-base kernel-arch manpages
do_populate_lic[depends] += "virtual/kernel:do_patch"
inherit kernelsrc
S = "${WORKDIR}/tools/usb/usbip"
inherit autotools gettext pkgconfig systemd
SYSTEMD_SERVICE:${PN} = "usbip.service"
SYSTEMD_AUTO_ENABLE:${PN} = "disable"
EXTRA_OECONF += "--with-tcp-wrappers"
do_configure[prefuncs] += "base_do_unpack"
do_configure:prepend() {
# copy source source from kernel to workdir
mkdir -p ${WORKDIR}/${USBIP_SRC}
tar --xattrs --xattrs-include='*' -cf - -S -C ${STAGING_KERNEL_DIR}/${USBIP_SRC} -p . | tar --xattrs --xattrs-include='*' -xf - -C ${WORKDIR}/${USBIP_SRC}
}
do_install:append() {
install -d ${D}${datadir}/hwdata/
install -m 0644 ${WORKDIR}/usb.ids ${D}${datadir}/hwdata/
install -d ${D}${sbindir}
install -m 0755 ${WORKDIR}/stm32mp-usbip-bind-unbind.sh ${D}${sbindir}/
install -d ${D}${sysconfdir}/udev/rules.d/
install -m 0644 ${WORKDIR}/99-usb-usbip.rules ${D}${sysconfdir}/udev/rules.d/
install -d ${D}${sysconfdir}/modprobe.d/
install -m 0644 ${WORKDIR}/usbip.conf ${D}${sysconfdir}/modprobe.d/
install -d ${D}${systemd_system_unitdir}/
install -m 0644 ${WORKDIR}/usbip.service ${D}${systemd_system_unitdir}/
}
FILES:${PN} += "${datadir}/hwdata/ ${sbindir} ${sysconfdir}/udev/rules.d/ ${systemd_system_unitdir}/ ${sysconfdir}/modprobe.d/"