Tiny Core Linux
Tiny Core Base => TCB Bugs => Topic started by: dentonlt on September 21, 2015, 11:05:04 PM
-
After installing, copyInstall unmounts the incoming extension but leaves the temporary /mnt/test directory. I've always wondered where that directory was coming from ...
FWIW, a patch to remove it after umount:
--- /usr/bin/tce-load 2015-09-18 06:54:02.000000000 +1000
+++ tce-load.patch 2015-09-22 13:02:10.071938000 +1000
@@ -89,6 +89,7 @@
fi
sudo /bin/umount -d /mnt/test
fi
+ sudo /usr/local/bin/rmdir /mnt/test
}
update_system() {
-
/usr/local/bin/rmdir doesn't exist in base.
-
It's rightly cleaner, but there's also a speed consideration, if you load a hundred extensions at boot, that's 99 mkdirs that can be avoided.
Perhaps only remove it when not called on boot? Then also remove it in tce-setup so the user never sees it.
-
You don't need rmdir, rm -r will be enough...
-
You don't need rmdir, rm -r will be enough...
rmdir is much safer, in case there's any content in the dir by accident.
-
Lots to consider - glad you all have better overview than me.
Yes, perhaps better at tce-setup line 144.
For non-boot calls ... I'll have to find a cheap test that fails at boot time but not after.
EDIT: Ah, and use /bin/rmdir for busybox instead (thanks, bmarkus)
EDIT: to let tce-load rmdir when not boot time, my first reaction is to pgrep. I imagine there is an easier test, though.
[ ! "`/usr/bin/pgrep tc-config`" ] && /bin/rmdir /mnt/test 2> /dev/null
And put the same line, without test, at tce-setup line 144.
FWIW
-
Use $BOOTING?
-
Yep, the BOOTING flag is set when tce-setup calls tce-load -b. Use that.
So, tce-load line 92:
[ $BOOTING ] || /bin/rm -r /mnt/test
and tce-setup line 164 (changed from above):
[ -e /mnt/test ] && /bin/rm -r /mnt/test
-
Applied, thanks.