summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2018-01-24 03:19:24 +0800
committerTing-Wei Lan <lantw@src.gnome.org>2018-01-24 03:55:30 +0800
commitd25c1995317fd3565aada09f4fafd6954db02f7a (patch)
treec5ef624c197b0ac1d035208008ebe716b667a397
parent5c0f33544ddbab1136e7743b9c355fbc4c267ca0 (diff)
downloadfreebsd-gnome-livecd-release-20180123.tar.gz
freebsd-gnome-livecd-release-20180123.tar.zst
freebsd-gnome-livecd-release-20180123.zip
Add Google Noto fonts and fix fontconfig cacherelease-20180123
In order to allow users to switch to languages other than English, we have to include fonts on the LiveCD. GNOME control center hides languages with no font installed when displaying the list of languages. Even if users set locale variables manually, the user interface is not usable because of missing glyphs. Therefore, Google Noto fonts is added to the list of packages. It takes a lot of space, but I think having a good-looking font is worth it. However, the addition of noto triggers a bug in scripts used to build LiveCD. fontconfig records inode numbers in its cache files, and it will try to regenerate the cache when inode numbers don't match. Since the UFS-formatted system image is created by makefs, the inode numbers of font files are changed when they are copied from the host filesystem to the image file, which causes fontconfig to regenerate the cache on every boot. This was not a big problem because generating caches was very fast and nobody seems to discover it. It become a real problem after noto is added because it takes several minutes to generate caches for these large sets of fonts, causing GDM to hang and the memory disk mounted for writing to run out of space quickly. To avoid generating font caches on boot, we have to run 'fc-cache' on the system image itself. The previous 'uzip' step is now split into three steps, 'ufs', 'font', 'uzip'. The 'font' step mounts the system image created in the 'ufs' step, deletes and regenerates fontconfig caches in its /var/db/fontconfig. Therefore, fontconfig cache files are considered valid in the LiveCD environment, and GDM can startup quickly.
-rw-r--r--build.sh16
-rw-r--r--gnome-debug-pkgs1
-rw-r--r--gnome-release-pkgs1
3 files changed, 16 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index e7d36c3..9123a0f 100644
--- a/build.sh
+++ b/build.sh
@@ -1,4 +1,4 @@
-steps="system packages user config uzip ramdisk boot image"
+steps="system packages user config ufs font uzip ramdisk boot image"
pwdir="$(realpath $(dirname "$0"))"
system () {
@@ -58,10 +58,22 @@ kern.coredump=0
EOF
}
-uzip () {
+ufs () {
install -o root -g wheel -m 755 -d "${cdroot}"
mkdir "${cdroot}/data"
makefs "${cdroot}/data/system.ufs" "${root}"
+}
+
+font () {
+ md_unit="$(mdconfig -a -t vnode -f "${cdroot}/data/system.ufs")"
+ mount "/dev/${md_unit}" "${root}"
+ rm -rf "${root}/var/db/fontconfig"
+ chroot "${root}" fc-cache -fsv
+ umount "${root}"
+ mdconfig -d -u "${md_unit}"
+}
+
+uzip () {
mkuzip -o "${cdroot}/data/system.uzip" "${cdroot}/data/system.ufs"
rm -f "${cdroot}/data/system.ufs"
}
diff --git a/gnome-debug-pkgs b/gnome-debug-pkgs
index 1d5545a..612e34a 100644
--- a/gnome-debug-pkgs
+++ b/gnome-debug-pkgs
@@ -3,6 +3,7 @@ x11/gnome
deskutils/gnome-shell-extra-extensions
x11-servers/xorg-server
x11-drivers/xorg-drivers
+x11-fonts/noto
dns/bind-tools
devel/cgdb
sysutils/cmdwatch
diff --git a/gnome-release-pkgs b/gnome-release-pkgs
index 30e2472..94dd4e6 100644
--- a/gnome-release-pkgs
+++ b/gnome-release-pkgs
@@ -3,3 +3,4 @@ x11/gnome
deskutils/gnome-shell-extra-extensions
x11-servers/xorg-server
x11-drivers/xorg-drivers
+x11-fonts/noto