From 0ae2b8fef6c0e32498e0df885560c3d20b2f8eb2 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 31 Mar 2022 18:02:30 -0700 Subject: meta-google: google-usb-network: Fix cleanup routine The sysfs directories are not a real filesystem and do not behave correctly if you use `rm -r`. You need to directly remove the relevant files and directories individually. Currently the script cannot successfully cleanup the interface. Change-Id: Ic7eb104fa6491347d24681ac45b4c0433ea07b23 Signed-off-by: William A. Kennington III --- .../networking/google-usb-network/usb_network.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'meta-google') diff --git a/meta-google/recipes-google/networking/google-usb-network/usb_network.sh b/meta-google/recipes-google/networking/google-usb-network/usb_network.sh index a135465f22..4ab463432a 100755 --- a/meta-google/recipes-google/networking/google-usb-network/usb_network.sh +++ b/meta-google/recipes-google/networking/google-usb-network/usb_network.sh @@ -96,11 +96,11 @@ EOF gadget_stop() { local gadget_dir="${CONFIGFS_HOME}/usb_gadget/${GADGET_DIR_NAME}" rm -f ${gadget_dir}/configs/c.1/${DEV_TYPE}.${IFACE_NAME} - rm -rf ${gadget_dir}/configs/c.1/strings/0x409 - rm -rf ${gadget_dir}/configs/c.1 - rm -rf ${gadget_dir}/strings/0x409 - rm -rf ${gadget_dir}/functions/${DEV_TYPE}.${IFACE_NAME} - rm -rf ${gadget_dir} + rmdir ${gadget_dir}/functions/${DEV_TYPE}.${IFACE_NAME} \ + ${gadget_dir}/configs/c.1/strings/0x409 \ + ${gadget_dir}/configs/c.1 \ + ${gadget_dir}/strings/0x409 \ + ${gadget_dir} || true rm -f /run/systemd/network/+-bmc-"${IFACE_NAME}".network networkctl reload -- cgit v1.2.3