Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: dentonlt on September 21, 2015, 11:05:04 PM

Title: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post 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:

Code: [Select]
--- /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() {
Title: Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post by: bmarkus on September 22, 2015, 01:17:25 AM

/usr/local/bin/rmdir doesn't exist in base.
Title: Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post by: curaga on September 22, 2015, 05:26:45 AM
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.
Title: Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post by: pioj on September 22, 2015, 07:00:46 AM
You don't need rmdir, rm -r  will be enough...
Title: Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post by: curaga on September 22, 2015, 07:22:35 AM
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.
Title: Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post by: dentonlt on September 22, 2015, 10:48:48 PM
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.

Code: [Select]
        [ ! "`/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
Title: Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post by: curaga on September 23, 2015, 04:59:29 AM
Use $BOOTING?
Title: Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post by: dentonlt on September 23, 2015, 10:18:58 AM
Yep, the BOOTING flag is set when tce-setup calls tce-load -b. Use that.

So, tce-load line 92:
Code: [Select]
[ $BOOTING ] || /bin/rm -r /mnt/test
and tce-setup line 164 (changed from above):
Code: [Select]
[ -e /mnt/test ] && /bin/rm -r /mnt/test

Title: Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
Post by: curaga on September 23, 2015, 04:07:05 PM
Applied, thanks.