WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Hack-font.tcz's tce.installed file is called Hack-fonts  (Read 2741 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Hack-font.tcz's tce.installed file is called Hack-fonts
« on: April 14, 2020, 02:40:08 PM »
As in the subject. The script should be called Hack-font, not Hack-fonts. It's a merely cosmetic issue that causes tce-status -i to output an inaccurate count of the number of loaded extensions (one more than the true number).

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Hack-font.tcz's tce.installed file is called Hack-fonts
« Reply #1 on: April 14, 2020, 04:33:35 PM »
I noticed that too. I was beginning to think I was the only one who used it. It's on my todo list to fix.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Hack-font.tcz's tce.installed file is called Hack-fonts
« Reply #2 on: April 14, 2020, 04:38:02 PM »
While on the topic, the script adds 16 seconds to my boot time and causes some boot-time errors ("fonts failed to write cache").

Eliminating the script seems to have no ill side effects--boot-time errors go away, boots faster, font still works fine in the terminal

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Hack-font.tcz's tce.installed file is called Hack-fonts
« Reply #3 on: April 14, 2020, 04:44:27 PM »
Hi GNUser
What does the script do? Is it a variation of the  fontconfig fc-cache  issue that cropped up here:
http://forum.tinycorelinux.net/index.php/topic,23333.msg146167.html#msg146167

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Hack-font.tcz's tce.installed file is called Hack-fonts
« Reply #4 on: April 14, 2020, 08:25:01 PM »
Hi, Rich. It does this:
Code: [Select]
#!/bin/sh
fc-cache -r
It wreaks havoc during boot (delay and several errors/warnings). My workaround is to just delete the script from the extension. There are no bad side effects as far as I can tell.

fontconfig.tcz  is a dependency of  Hack-font.tcz  and is therefore also being loaded at boot time. Since tce.installed scripts are run as a batch after all extensions have loaded, by the time tce.installed/fontconfig runs, it "sees" Hack-font and includes it in the font cache.

I guess the only time Hack-font's tce.installed script would be needed is when the extension is loaded after boot.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Hack-font.tcz's tce.installed file is called Hack-fonts
« Reply #5 on: April 14, 2020, 09:13:29 PM »
Hi GNUser
That's the same command (different options) that caused the slow booting when fontconfig.tcz was loaded in this thread:
http://forum.tinycorelinux.net/index.php/topic,23333.msg146167.html#msg146167

Hi, Rich. It does this:
Code: [Select]
#!/bin/sh
fc-cache -r
...

Maybe try having it block if  rcS  is still running:
Code: [Select]
#!/bin/sh

while true
do
sleep 1
pgrep rcS >/dev/null && continue
sleep 1
break
done

fc-cache -r

    [EDIT]: Changed tc-config to rcS.  Rich
« Last Edit: April 15, 2020, 12:13:56 AM by Rich »

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Hack-font.tcz's tce.installed file is called Hack-fonts
« Reply #6 on: April 14, 2020, 11:40:25 PM »
One problem is that there currently does not exist a way to run a command at the end of the boot process as part of a extension loaded during boot. Right now this can only be done by manually editing files. I can however tell if the system is booting or not and run fc-cache based on that:

Code: [Select]
#!/bin/sh
#
pgrep rcS >/dev/null || fc-cache -r &

If rcS is not running, then the system is not booting and the font cache will be refreshed. This would move the requirement to the user to manually run fc-cache at the time of their choosing from one of the many files that are run at the end of tc-config, though usually this is /opt/bootlocal.sh.

I don't know what the errors are about. I added strace to my onboot, and ran fc-cache with it in bootsync.sh. It's not clear to me what the problem is.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Hack-font.tcz's tce.installed file is called Hack-fonts
« Reply #7 on: April 15, 2020, 12:15:47 AM »
Hi andyj
Updated my previous post. Thanks for the reminder. I forgot  tc-config  gets called from  rcS.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Hack-font.tcz's tce.installed file is called Hack-fonts
« Reply #8 on: April 15, 2020, 08:06:48 AM »
I can however tell if the system is booting or not and run fc-cache based on that:

Code: [Select]
#!/bin/sh
#
pgrep rcS >/dev/null || fc-cache -r &
That's beautiful, andyj. Exactly what we need here.

This would move the requirement to the user to manually run fc-cache at the time of their choosing from one of the many files that are run at the end of tc-config, though usually this is /opt/bootlocal.sh.
tce.installed/fontconfig runs fc-cache, so no need to run it manually or via bootlocal.sh.