From dde1fede1f832f029742a1d27290cfe252ab1bc5 Mon Sep 17 00:00:00 2001 From: "Thang Q. Nguyen" Date: Thu, 4 Nov 2021 08:30:27 +0000 Subject: meta-ampere: fix shellcheck issues Fix all issues from the shellcheck checked on bash shells under meta-ampere. Tested: Verify the following features: 1. Power control (on,off, cycle, graceful shutdown, hard reset). 2. UART switching. 3. UEFI firmware update. Signed-off-by: Thang Q. Nguyen Change-Id: Idabf839b7521ecadb642230cc8bb3472c787002e --- .../console/obmc-console/ampere_uartmux_ctrl.sh | 25 ++++++---------------- .../obmc-console/obmc-console-server-setup.sh | 4 +--- .../gpio/fault-monitor/toggle_fault_led.sh | 10 ++++----- .../gpio/id-button/toggle_identify_led.sh | 20 ++++++++--------- .../psu-hotswap-reset/ampere_psu_reset_hotswap.sh | 14 ++++++------ 5 files changed, 29 insertions(+), 44 deletions(-) mode change 100644 => 100755 meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh (limited to 'meta-ampere/meta-jade/recipes-phosphor') diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh index 58fffd8fe..f28589894 100755 --- a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh +++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/ampere_uartmux_ctrl.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2020 Ampere Computing LLC +# Copyright (c) 2021 Ampere Computing LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,24 +19,13 @@ # of 1 sets CPU To HDR_CONN # of 2 sets BMC to CPU (eg dropbear ssh server on port 2200) +# shellcheck source=/dev/null +source /usr/sbin/gpio-lib.sh + if [ $# -lt 2 ]; then exit 1 fi -function set_gpio_active_low() { - if [ $# -ne 2 ]; then - echo "set_gpio_active_low: need both GPIO# and initial level"; - return; - fi - - if [ ! -d /sys/class/gpio/gpio$1 ]; then - echo $1 > /sys/class/gpio/export - fi - echo $2 > /sys/class/gpio/gpio$1/direction -} - -GPIO_BASE=$(cat /sys/class/gpio/gpio*/base) - case "$1" in 1) GPIO_UARTx_MODE0=56 # CPU0 UART0 connects to BMC UART1 @@ -65,17 +54,17 @@ esac # of requested console port. # Example format: Accepted: 1; Connected: 1; CONNECTED=$(systemctl --no-pager status obmc-console-ttyS${CONSOLE_PORT}-ssh.socket | grep -w Connected | cut -d ':' -f 3 | tr -d ' ;') -if [ ! $CONNECTED -le 1 ]; then +if [ ! "$CONNECTED" -le 1 ]; then exit 0 fi echo "Ampere UART MUX CTRL UART port $1 to mode $2" case "$2" in - 1) set_gpio_active_low $((${GPIO_BASE} + ${GPIO_UARTx_MODE0})) low + 1) gpio_configure_output "${GPIO_UARTx_MODE0}" 0 exit 0 ;; - 2) set_gpio_active_low $((${GPIO_BASE} + ${GPIO_UARTx_MODE0})) high + 2) gpio_configure_output "${GPIO_UARTx_MODE0}" 1 exit 0 ;; *) echo "Invalid UART mode selection" diff --git a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh index fe2d5ab03..4e0a01350 100644 --- a/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh +++ b/meta-ampere/meta-jade/recipes-phosphor/console/obmc-console/obmc-console-server-setup.sh @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -euo pipefail - tty="$1" uart=0 @@ -39,4 +37,4 @@ esac # this value should be set to 1 /usr/sbin/ampere_uartmux_ctrl.sh ${uart} 2 -/usr/sbin/obmc-console-server --config /etc/obmc-console/server.${tty}.conf ${tty} +/usr/sbin/obmc-console-server --config /etc/obmc-console/server."${tty}".conf "${tty}" diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor/toggle_fault_led.sh b/meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor/toggle_fault_led.sh index 8d3d54374..1e1cbc588 100644 --- a/meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor/toggle_fault_led.sh +++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/fault-monitor/toggle_fault_led.sh @@ -22,14 +22,14 @@ PROPERTY="Asserted" # Get current state object=$(busctl tree $SERVICE --list | grep system_fault) -state=$(busctl get-property $SERVICE $object $INTERFACE $PROPERTY \ +state=$(busctl get-property $SERVICE "$object" $INTERFACE $PROPERTY \ | awk '{print $NF;}') -if [ "$state" == "false" ]; then - target='true' +if [ "$state" = "false" ]; then + target='true' else - target='false' + target='false' fi # Set target state -busctl set-property $SERVICE $object $INTERFACE $PROPERTY b $target +busctl set-property $SERVICE "$object" $INTERFACE $PROPERTY b $target diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh b/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh index d62c84ae1..06b2d55f1 100755 --- a/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh +++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/id-button/toggle_identify_led.sh @@ -22,24 +22,24 @@ PROPERTY="Asserted" # Get enclosure_identify state identify_object=$(busctl tree $SERVICE --list | grep -m 1 identify) -identify_state=$(busctl get-property $SERVICE $identify_object $INTERFACE $PROPERTY \ - | awk '{print $NF;}') +identify_state=$(busctl get-property $SERVICE "$identify_object" $INTERFACE $PROPERTY \ + | awk '{print $NF;}') # Get enclosure_identify_blink state identify_blink_object=$(busctl tree $SERVICE --list | grep identify_blink) -identify_blink_state=$(busctl get-property $SERVICE $identify_blink_object $INTERFACE $PROPERTY \ - | awk '{print $NF;}') +identify_blink_state=$(busctl get-property $SERVICE "$identify_blink_object" $INTERFACE $PROPERTY \ + | awk '{print $NF;}') # Set state -if [[ "$identify_state" == "false" && "$identify_blink_state" == "false" ]]; then +if [ "$identify_state" = "false" ] && [ "$identify_blink_state" = "false" ]; then # Turn on the UID LED - busctl set-property $SERVICE $identify_object $INTERFACE $PROPERTY b true -elif [[ "$identify_state" == "false" && "$identify_blink_state" == "true" ]]; then + busctl set-property $SERVICE "$identify_object" $INTERFACE $PROPERTY b true +elif [ "$identify_state" = "false" ] && [ "$identify_blink_state" = "true" ]; then # Turn off the UID LED when LED is blinking state - busctl set-property $SERVICE $identify_blink_object $INTERFACE $PROPERTY b false -elif [[ "$identify_state" == "true" && "$identify_blink_state" == "false" ]]; then + busctl set-property $SERVICE "$identify_blink_object" $INTERFACE $PROPERTY b false +elif [ "$identify_state" = "true" ] && [ "$identify_blink_state" = "false" ]; then # Turn off the UID LED - busctl set-property $SERVICE $identify_object $INTERFACE $PROPERTY b false + busctl set-property $SERVICE "$identify_object" $INTERFACE $PROPERTY b false else echo "Invalid case! When identify_blink_state is true, the identify_state will set to false" fi diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh b/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh old mode 100644 new mode 100755 index 65bff9dc1..37a3ce301 --- a/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh +++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/psu-hotswap-reset/ampere_psu_reset_hotswap.sh @@ -29,10 +29,10 @@ STATUS_MFR_SPECIFIC=0x80 # $1 will be the name of the psu PSU=$1 -if [[ $PSU == 1 ]]; then +if [ "$PSU" = 1 ]; then HSC_PMBUS_NUM=$HSC1_PMBUS_NUM HSC_SLAVE_ADDR=$HSC1_SLAVE_ADDR -elif [[ $PSU == 2 ]]; then +elif [ "$PSU" = 2 ]; then HSC_PMBUS_NUM=$HSC2_PMBUS_NUM HSC_SLAVE_ADDR=$HSC2_SLAVE_ADDR else @@ -43,22 +43,20 @@ fi # Check HOST state chassisstate=$(obmcutil chassisstate | awk -F. '{print $NF}') -if [[ "$chassisstate" == 'Off' ]]; then +if [ "$chassisstate" = 'Off' ]; then echo "HOST is being OFF, so can't access the i2c $HSC_PMBUS_NUM. Please Turn ON HOST !" exit 1 fi # Check FET health problems -data=$(i2cget -f -y $HSC_PMBUS_NUM $HSC_SLAVE_ADDR $STATUS_MFR_SPECIFIC) - -if [[ $? -ne 0 ]]; then +if ! data=$(i2cget -f -y $HSC_PMBUS_NUM $HSC_SLAVE_ADDR $STATUS_MFR_SPECIFIC); then echo "ERROR: Can't access the i2c. Please check /dev/i2c-$HSC_PMBUS_NUM" exit 1 fi psu_sts=$(((data & 0x80) != 0)) -if [[ $psu_sts == 1 ]]; then +if [ $psu_sts = 1 ]; then echo "PSU $PSU: FET health problems have been detected" echo "Reset Hot swap output on PSU $PSU" # Disable Hot swap output @@ -71,4 +69,4 @@ if [[ $psu_sts == 1 ]]; then else echo "PSU $PSU: FET health problems have not been detected" -fi \ No newline at end of file +fi -- cgit v1.2.3 From ff38979bf9dbc8bc02ee6852d707140ca97b80aa Mon Sep 17 00:00:00 2001 From: "Thang Q. Nguyen" Date: Fri, 15 Oct 2021 14:04:44 +0000 Subject: meta-ampere: usbnet: implement using usb-ctrl Change to implement virtual USB Ethernet using phosphor-misc's usb-ctrl. Tested: 1. Boot BMC to Linux. Login and check if usb0 ethernet interface exists. 2. Power ON the Host. Check if usb0 automatically sets its IP to 192.168.0.10 3. Restart the ampere-usbnet.service service. Check if no error happens. Signed-off-by: Thang Q. Nguyen Change-Id: I4de722a691a112db851b6dda0a7821b9f78b4d72 --- .../recipes-ac01/usbnet/ampere-usbnet.bb | 30 ------- .../usbnet/ampere-usbnet/00-bmc-usb0.network | 7 -- .../ampere-usbnet/ampere_add_usbnet_gadget.service | 13 --- .../ampere-usbnet/ampere_add_usbnet_gadget.sh | 93 ---------------------- .../recipes-phosphor/network/ampere-usbnet.bb | 28 +++++++ .../network/ampere-usbnet/00-bmc-usb0.network | 7 ++ .../network/ampere-usbnet/ampere-usbnet.service | 12 +++ .../network/ampere-usbnet/ampere_usbnet.sh | 21 +++++ .../packagegroups/packagegroup-obmc-apps.bbappend | 1 + 9 files changed, 69 insertions(+), 143 deletions(-) delete mode 100644 meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet.bb delete mode 100644 meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/00-bmc-usb0.network delete mode 100644 meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.service delete mode 100644 meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.sh create mode 100644 meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet.bb create mode 100644 meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/00-bmc-usb0.network create mode 100644 meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/ampere-usbnet.service create mode 100644 meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/ampere_usbnet.sh (limited to 'meta-ampere/meta-jade/recipes-phosphor') diff --git a/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet.bb b/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet.bb deleted file mode 100644 index 3045fa557..000000000 --- a/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet.bb +++ /dev/null @@ -1,30 +0,0 @@ -SUMMARY = "Ampere Computing LLC Add Ethernet over USB gadget device" -DESCRIPTION = "Add Ethernet over USB gadget device for Ampere systems" -PR = "r1" - -LICENSE = "Apache-2.0" -S = "${WORKDIR}" - -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" - -inherit systemd -inherit obmc-phosphor-systemd - -DEPENDS = "systemd" -RDEPENDS:${PN} = "bash" - -SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE:${PN} = " \ - ampere_add_usbnet_gadget.service \ - " - -SRC_URI += "file://00-bmc-usb0.network" -SRC_URI += "file://ampere_add_usbnet_gadget.sh" - -do_install:append() { - install -d ${D}${sbindir} - install -d ${D}/etc/systemd/network - install -m 744 ${WORKDIR}/ampere_add_usbnet_gadget.sh ${D}${sbindir}/ - install -m 644 ${WORKDIR}/00-bmc-usb0.network \ - ${D}/etc/systemd/network/ -} diff --git a/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/00-bmc-usb0.network b/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/00-bmc-usb0.network deleted file mode 100644 index 640fe04b9..000000000 --- a/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/00-bmc-usb0.network +++ /dev/null @@ -1,7 +0,0 @@ -[Match] -Name=usb0 -[Address] -Address=192.168.0.10/16 -[Network] -LinkLocalAddressing=no -IPv6AcceptRA=no diff --git a/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.service b/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.service deleted file mode 100644 index 428263a89..000000000 --- a/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Ampere adds Ethernet over USB gadget device -Wants=systemd-networkd.service -Before=systemd-networkd.service -After=phosphor-ipmi-host.service - -[Service] -ExecStart=/usr/bin/env ampere_add_usbnet_gadget.sh -SyslogIdentifier=ampere_add_usbnet_gadget.sh -Type=oneshot - -[Install] -WantedBy=systemd-networkd.service diff --git a/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.sh b/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.sh deleted file mode 100644 index c4c2c273f..000000000 --- a/meta-ampere/meta-common/recipes-ac01/usbnet/ampere-usbnet/ampere_add_usbnet_gadget.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh - -# Add an Ethernet over USB gadget device and connect to a port of Aspeed USB -# virtual hub. If can't find any free port on virtual hub, exit with failure. -# If can't find the virtual hub, exit with failure. - -# Author: Thinh Hung Pham -# Signed-off-by: Chanh Nguyen - -UDC_SYSPATH=/sys/class/udc -VHUB_DEVICE=1e6a0000.usb-vhub:p -GADGET_CONFIG_SYSPATH=/sys/kernel/config/usb_gadget -USBNET=usbnet -# The number of port on AST2500 USB virtual hub -NUM_PORT_USB_HUB=5 -# idVendor = 0x1d6b: Linux Foundation -VENDORID=0x1d6b -# idProduct = 0x0103: NCM (Ethernet) Gadget -PRODUCTID=0x0103 -# Language code = 0x409: English – United States -LANGUAGEID=0x409 -SERIALNUMBER=cafecafe -MANUFACTURER=Aspeed -FUNCTION=ecm.usb0 - -if [ ! -d ${GADGET_CONFIG_SYSPATH} ]; then - # GADGET_CONFIG_SYSPATH is not exist - # Return 1 so that systemd knows the service failed to start - echo "ERROR: ${GADGET_CONFIG_SYSPATH} : doesn't exist!" - exit 1 -fi - -find_free_vhub_port(){ - for ((i=1;i<=${NUM_PORT_USB_HUB};i++)) - do - state=$(cat ${UDC_SYSPATH}/${VHUB_DEVICE}${i}/state) - func=$(cat ${UDC_SYSPATH}/${VHUB_DEVICE}${i}/function) - if [ "${state}" == "not attached" -a "${func}" == "" ]; then - FREEUDC=${VHUB_DEVICE}${i} - break - fi - done - if [ ${i} -eq 6 ]; then - # Can't find a free port - # Return 1 so that systemd knows the service failed to start - echo "ERROR: Can't find a free port !" - exit 1 - fi -} - -if [ -d ${GADGET_CONFIG_SYSPATH}/${USBNET} ]; then - cd ${GADGET_CONFIG_SYSPATH}/${USBNET} -else - # Create the gadget - mkdir ${GADGET_CONFIG_SYSPATH}/${USBNET} - cd ${GADGET_CONFIG_SYSPATH}/${USBNET} - - # Configure the gadget - echo ${VENDORID} > idVendor - echo ${PRODUCTID} > idProduct - mkdir strings/${LANGUAGEID} - echo ${SERIALNUMBER} > strings/${LANGUAGEID}/serialnumber - echo ${MANUFACTURER} > strings/${LANGUAGEID}/manufacturer - echo ${USBNET} > strings/${LANGUAGEID}/product - - # Create the configuration - mkdir configs/c.1 - mkdir configs/c.1/strings/${LANGUAGEID} - - # Create the function - mkdir functions/${FUNCTION} - - # Associate the function with its configuration - ln -s functions/${FUNCTION} configs/c.1 -fi - -# Find an available virtual hub port -find_free_vhub_port - -# Enable the gadget -echo ${FREEUDC} > UDC - -if [[ $? -ne 0 ]]; then - # End - cd - > /dev/null - # Virtual HUB is not available - # Return 1 so that systemd knows the service failed to start - exit 1 -fi - -# End -cd - > /dev/null - diff --git a/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet.bb b/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet.bb new file mode 100644 index 000000000..d1dff35ec --- /dev/null +++ b/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet.bb @@ -0,0 +1,28 @@ +SUMMARY = "Enable USB ethernet" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +DEPENDS += "systemd" +RDEPENDS:${PN} += "libsystemd bash" + +inherit allarch systemd + +SRC_URI += "file://ampere-usbnet.service \ + file://ampere_usbnet.sh \ + file://00-bmc-usb0.network" + +do_install() { + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/ampere-usbnet.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 + + install -d ${D}/${sbindir} + install -m 755 ${WORKDIR}/ampere_usbnet.sh ${D}/${sbindir} +} + +NATIVE_SYSTEMD_SUPPORT = "1" +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE:${PN} = "ampere-usbnet.service" diff --git a/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/00-bmc-usb0.network b/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/00-bmc-usb0.network new file mode 100644 index 000000000..640fe04b9 --- /dev/null +++ b/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/00-bmc-usb0.network @@ -0,0 +1,7 @@ +[Match] +Name=usb0 +[Address] +Address=192.168.0.10/16 +[Network] +LinkLocalAddressing=no +IPv6AcceptRA=no diff --git a/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/ampere-usbnet.service b/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/ampere-usbnet.service new file mode 100644 index 000000000..349954325 --- /dev/null +++ b/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/ampere-usbnet.service @@ -0,0 +1,12 @@ +[Unit] +Description=Ampere Ethernet over USB gadget device +After=phosphor-ipmi-host.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/sbin/ampere_usbnet.sh +ExecStop=/usr/bin/usb-ctrl ecm usbnet off + +[Install] +WantedBy=multi-user.target diff --git a/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/ampere_usbnet.sh b/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/ampere_usbnet.sh new file mode 100644 index 000000000..fd2dce610 --- /dev/null +++ b/meta-ampere/meta-common/recipes-phosphor/network/ampere-usbnet/ampere_usbnet.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +ENV_MAC_ADDR=$(fw_printenv eth1addr) +if [ -z "$ENV_MAC_ADDR" ]; then + ENV_MAC_ADDR=$(fw_printenv ethaddr) +fi + +MAC_ADDR=$(echo "$ENV_MAC_ADDR" | cut -d "=" -f 2) + +if [ -n "$MAC_ADDR" ]; then + # Generate MAC Address from eth1addr using locally administered MAC + # https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local_(U/L_bit + SUBMAC=$(echo "$MAC_ADDR" | cut -d ":" -f 2-6) + /usr/bin/usb-ctrl ecm usbnet on "06:$SUBMAC" "02:$SUBMAC" +else + /usr/bin/usb-ctrl ecm usbnet on +fi + +# Use NCM (Ethernet) Gadget instead of FunctionFS Gadget +echo 0x0103 > /sys/kernel/config/usb_gadget/usbnet/idProduct +echo "OpenBMC usbnet Device" > /sys/kernel/config/usb_gadget/usbnet/strings/0x409/product diff --git a/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend index 7136be64f..56db56883 100644 --- a/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend +++ b/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend @@ -2,6 +2,7 @@ RDEPENDS:${PN}-extras:append:mtjade = " \ webui-vue \ phosphor-image-signing \ phosphor-virtual-sensor \ + phosphor-misc-usb-ctrl \ " RDEPENDS:${PN}-inventory:append:mtjade = " \ -- cgit v1.2.3