WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: 6.4 tce-load: copyInstall() leaves temporary /mnt/test  (Read 3376 times)

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
6.4 tce-load: copyInstall() leaves temporary /mnt/test
« 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() {

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
« Reply #1 on: September 22, 2015, 01:17:25 AM »

/usr/local/bin/rmdir doesn't exist in base.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
« Reply #2 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.
The only barriers that can stop you are the ones you create yourself.

Offline pioj

  • Jr. Member
  • **
  • Posts: 76
Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
« Reply #3 on: September 22, 2015, 07:00:46 AM »
You don't need rmdir, rm -r  will be enough...

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
« Reply #4 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.
The only barriers that can stop you are the ones you create yourself.

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
« Reply #5 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
« Last Edit: September 22, 2015, 11:08:36 PM by dentonlt »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
« Reply #6 on: September 23, 2015, 04:59:29 AM »
Use $BOOTING?
The only barriers that can stop you are the ones you create yourself.

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
« Reply #7 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


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: 6.4 tce-load: copyInstall() leaves temporary /mnt/test
« Reply #8 on: September 23, 2015, 04:07:05 PM »
Applied, thanks.
The only barriers that can stop you are the ones you create yourself.