diff options
author | Simon Rettberg | 2015-10-07 13:50:32 +0200 |
---|---|---|
committer | root | 2015-10-07 13:50:32 +0200 |
commit | 277f0fafca4c6f551763ca8738445ef79860beb8 (patch) | |
tree | 05092419c74f04c6ad7e710e5ae1cba1fafb41b4 /remote/setup_target | |
parent | [rfs-stage32] Add kernel modules for (mpt)sas (diff) | |
download | tm-scripts-277f0fafca4c6f551763ca8738445ef79860beb8.tar.gz tm-scripts-277f0fafca4c6f551763ca8738445ef79860beb8.tar.xz tm-scripts-277f0fafca4c6f551763ca8738445ef79860beb8.zip |
[setup_target] Fix clean_kernel_module to really clean the kernel
Diffstat (limited to 'remote/setup_target')
-rwxr-xr-x | remote/setup_target | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/remote/setup_target b/remote/setup_target index 63869979..927fde01 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -544,26 +544,16 @@ clean_kernel_module() { pinfo "Cleaning kernel module (including sources and compiled stuff)." cd "${TARGET_DIR}/kernel" || perror "Could not cd to ${TARGET_DIR}/kernel" if [ -e build ]; then - rm -rf build || perror "Could not delete ${TARGET_DIR}/kernel/build" + rm -rf build || pwarning "Could not delete ${TARGET_DIR}/kernel/build" fi - # little workaround to actually list names of entries - # (if only a dir exists, ls kernel/linux-* would just list - # the contents of that directory....) - for FILE in $(ls | grep linux); do - rm -rf $FILE || perror "Could not delete $TARGET_DIR}/$FILE" - done - # finally clean the config generated - if [ -e openslx.config ]; then - rm openslx.config || perror "Could not delete ${TARGET_DIR}/kernel/openslx.config" - fi - if [ -e .fetched_source ]; then - rm .fetched_source || perror "Could not delete ${TARGET_DIR}/kernel/.fetched_source" - fi - if [ -e .built ]; then - rm .built || perror "Could not delete ${TARGET_DIR}/kernel/.built" - fi - if [ -L ksrc ]; then - unlink ksrc || perror "Could not unlink ${TARGET_DIR}/kernel/ksrc." + # clean any git repos in nonstandard dirs + find . -maxdepth 1 -type d -name "linux-*" -exec rm -rf -- {} \; + # clean the config generated and flag files + rm -f -- "openslx.config" ".fetched_source" ".built" + if [ -L "ksrc" ]; then + unlink "ksrc" || perror "Could not unlink ${TARGET_DIR}/kernel/ksrc." + elif [ -d "ksrc" ]; then + rm -rf -- "ksrc" || perror "Could not delete directory ${TARGET_DIR}/kernel/ksrc." fi pinfo "Done cleaning kernel." else |