summaryrefslogtreecommitdiff
path: root/meta-google
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2022-04-01 04:02:30 +0300
committerWilliam A. Kennington III <wak@google.com>2022-04-01 19:17:04 +0300
commit0ae2b8fef6c0e32498e0df885560c3d20b2f8eb2 (patch)
treefa9dbfa224798777e9c8ea8994b20b105d25b0fd /meta-google
parentd1e9992f30e14e2736e91c95da3ad84293cbb8e3 (diff)
downloadopenbmc-0ae2b8fef6c0e32498e0df885560c3d20b2f8eb2.tar.xz
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 <wak@google.com>
Diffstat (limited to 'meta-google')
-rwxr-xr-xmeta-google/recipes-google/networking/google-usb-network/usb_network.sh10
1 files changed, 5 insertions, 5 deletions
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