diff options
author | William A. Kennington III <wak@google.com> | 2022-04-01 04:02:30 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2022-04-01 19:17:04 +0300 |
commit | 0ae2b8fef6c0e32498e0df885560c3d20b2f8eb2 (patch) | |
tree | fa9dbfa224798777e9c8ea8994b20b105d25b0fd | |
parent | d1e9992f30e14e2736e91c95da3ad84293cbb8e3 (diff) | |
download | openbmc-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>
-rwxr-xr-x | meta-google/recipes-google/networking/google-usb-network/usb_network.sh | 10 |
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 |