Initial commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
[Match]
|
||||
Name=usb0
|
||||
[Address]
|
||||
Address=169.254.95.118/16
|
||||
[Network]
|
||||
LinkLocalAddressing=no
|
||||
IPv6AcceptRA=no
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=enable usb network
|
||||
After=phosphor-ipmi-host.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c '/usr/sbin/usb_network.sh'
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /sys/kernel/config/usb_gadget || exit
|
||||
|
||||
if [ ! -f "g1" ]; then
|
||||
mkdir g1
|
||||
cd g1 || exit
|
||||
|
||||
echo 0x1d6b > idVendor # Linux foundation
|
||||
echo 0x0104 > idProduct # Multifunction composite gadget
|
||||
mkdir -p strings/0x409
|
||||
echo "Linux" > strings/0x409/manufacturer
|
||||
echo "Ethernet/RNDIS gadget" > strings/0x409/product
|
||||
|
||||
mkdir -p configs/c.1
|
||||
echo 100 > configs/c.1/MaxPower
|
||||
mkdir -p configs/c.1/strings/0x409
|
||||
echo "RNDIS" > configs/c.1/strings/0x409/configuration
|
||||
|
||||
mkdir -p functions/rndis.usb0
|
||||
|
||||
ln -s functions/rndis.usb0 configs/c.1
|
||||
|
||||
echo f0839000.udc > UDC
|
||||
|
||||
fi
|
||||
exit 0
|
||||
@@ -0,0 +1,29 @@
|
||||
FILESEXTRAPATHS:append := "${THISDIR}/files:"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
|
||||
DEPENDS += "systemd"
|
||||
RDEPENDS:${PN} += "libsystemd"
|
||||
RDEPENDS:${PN} += "bash"
|
||||
|
||||
SRC_URI += "file://usb_network.sh \
|
||||
file://usb_network.service \
|
||||
file://00-bmc-usb0.network"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/${sbindir}
|
||||
install -m 0755 ${WORKDIR}/usb_network.sh ${D}/${sbindir}
|
||||
|
||||
install -d ${D}${systemd_unitdir}/system/
|
||||
install -m 0644 ${WORKDIR}/usb_network.service ${D}${systemd_unitdir}/system
|
||||
|
||||
install -d ${D}${sysconfdir_native}/systemd/network/
|
||||
install -m 0644 ${WORKDIR}/00-bmc-usb0.network ${D}${sysconfdir_native}/systemd/network
|
||||
}
|
||||
|
||||
NATIVE_SYSTEMD_SUPPORT = "1"
|
||||
SYSTEMD_PACKAGES = "${PN}"
|
||||
SYSTEMD_SERVICE:${PN} = "usb_network.service"
|
||||
FILES:${PN} += "${sysconfdir_native}/systemd/network/00-bmc-usb0.network"
|
||||
|
||||
inherit allarch systemd
|
||||
Reference in New Issue
Block a user