Bug 9155 - update_font_cache postinst failing with read-only filesystem
Summary: update_font_cache postinst failing with read-only filesystem
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.1 M3
Assignee: Martin Jansa
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-02-22 20:39 UTC by Martin Jansa
Modified: 2016-03-17 22:11 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jansa 2016-02-22 20:39:08 UTC
It was working fine with last time I've checked with jethro, but now building any image with fonts with latest master fails.

And this postinst failure is fatal when the IMAGE_FEATURES also set such image as read-only (because the postinst script cannot be executed to create the cache during first boot)

The fc-cache output is pretty useless (even when executed manually):

OE @ ~/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs $ ../intercept_scripts/update_font_cache+ ../intercept_scripts/update_font_cache
FC_DEBUG=1
[/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/share/fonts: skipping, existing cache is valid: 0 fonts, 1 dirs
[/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/share/fonts/ttf: skipping, existing cache is valid: 12 fonts, 0 dirs
[/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/lib/X11/fonts: /usr/lib/X11/fonts: error scanning
Re-scanning [/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/share/fonts: caching, new cache contents: 0 fonts, 1 dirs
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//var/cache/fontconfig: cleaning cache directory
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/usr/bin/fc-cache: failed


Please set one of autobuilder targets to build read-only images so that these issues can be catched as soon as possible next time it gets broken.
Comment 1 Ross Burton 2016-02-22 20:40:18 UTC
Adding something to the selftest to verify that images are buildable without any delayed postinst would be good.
Comment 2 Martin Jansa 2016-02-23 13:16:06 UTC
NOTE: recipe core-image-weston-1.0-r0: task do_rootfs: Started
WARNING: core-image-weston-1.0-r0 do_rootfs: The postinstall intercept hook 'update_icon_cache' failed (exit code: 1)! See log for details!
WARNING: core-image-weston-1.0-r0 do_rootfs: The postinstall intercept hook 'update_font_cache' failed (exit code: 1)! See log for details!
ERROR: core-image-weston-1.0-r0 do_rootfs: The following packages could not be configured offline and rootfs is read-only: ['liberation-fonts', 'libgdk-pixbuf-2.0-loader-png', 'adwaita-icon-theme-symbolic']
ERROR: core-image-weston-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/temp/log.do_rootfs.15093

With FC_DEBUG=16 it shows a bit more info:

OE @ ~/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs $ qemu-i386 -r 2.6.32 -L /OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs -E LD_LIBRARY_PATH=/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/lib:/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//lib -E FC_DEBUG=16 /OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/usr/bin/fc-cache --sysroot=/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs --system-only
FC_DEBUG=16
FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts: cache: 1, fs: 1
FcCacheTimeValid dir "/usr/share/fonts/ttf" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts/ttf: cache: 0, fs: 0
FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts: cache: 1, fs: 1
FcCacheTimeValid dir "/usr/share/fonts/ttf" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts/ttf: cache: 0, fs: 0
/usr/lib/X11/fonts: error scanning
FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts: cache: 1, fs: 1
FcDirCacheWriteDir dir "/usr/share/fonts" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//3830d5c3ddfd5cd38a049b759396e72e-le32d4.cache-6"
Created CACHEDIR.TAG at /OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//var/cache/fontconfig
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//var/cache/fontconfig: cleaning cache directory
FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts: cache: 1, fs: 1
FcCacheTimeValid dir "/usr/share/fonts/ttf" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts/ttf: cache: 0, fs: 0

There is no usr/lib/X11/fonts in the image, but maybe it's scanning the hosts filesystem? Other paths are prefixed with rootfs path.

OE @ ~/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs $ find usr/lib/X11/fonts
find: 'usr/lib/X11/fonts': No such file or directory
Comment 3 Martin Jansa 2016-02-23 14:06:02 UTC
I've tried to revert last 3 fontconfig changes
027ba09 Revert "fontconfig: Upgrade to 2.11.93"
740682d Revert "fontconfig: Fix pkgconfig file generation to not have absolute paths"
5843264 Revert "fontconfig: Upgrade 2.11.93 -> 2.11.94"

and it didn't help
Comment 4 Martin Jansa 2016-02-23 14:10:19 UTC
As work around you can create usr/lib/X11/fonts (it's empty in weston image), then it doesn't fail

OE @ ~/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs $ mkdir usr/lib/X11
OE @ ~/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs $ cp -ra usr/share/fonts/ usr/lib/X11/fonts
OE @ ~/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs $ qemu-i386 -r 2.6.32 -L /OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs -E LD_LIBRARY_PATH=/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/lib:/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//lib -E FC_DEBUG=16 /OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/usr/bin/fc-cache --sysroot=/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs --system-only -vf
FC_DEBUG=16
FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts: cache: 1, fs: 1
FcDirCacheWriteDir dir "/usr/lib/X11/fonts" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//983f9ea3cd1b62854d3a0538dc38ca90-le32d4.cache-6"
FcCacheTimeValid dir "/usr/share/fonts/ttf" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts/ttf: cache: 0, fs: 0

charsets 12 -> 4 leaves 164 -> 16
FcDirCacheWriteDir dir "/usr/lib/X11/fonts/ttf" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//f31dea61cee4bc0f078bd14628df7c7f-le32d4.cache-6"
[/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/share/fonts: FcDirCacheWriteDir dir "/usr/share/fonts" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//3830d5c3ddfd5cd38a049b759396e72e-le32d4.cache-6"
caching, new cache contents: 0 fonts, 1 dirs
[/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/share/fonts/ttf: 
charsets 12 -> 4 leaves 164 -> 16
FcDirCacheWriteDir dir "/usr/share/fonts/ttf" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//94322f4d3cdf1bd54794b691285ca062-le32d4.cache-6"
caching, new cache contents: 12 fonts, 0 dirs
[/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/lib/X11/fonts: FcDirCacheWriteDir dir "/usr/lib/X11/fonts" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//983f9ea3cd1b62854d3a0538dc38ca90-le32d4.cache-6"
caching, new cache contents: 0 fonts, 1 dirs
[/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/lib/X11/fonts/ttf: 
charsets 12 -> 4 leaves 164 -> 16
FcDirCacheWriteDir dir "/usr/lib/X11/fonts/ttf" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//f31dea61cee4bc0f078bd14628df7c7f-le32d4.cache-6"
caching, new cache contents: 12 fonts, 0 dirs
Re-scanning [/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/share/fonts: FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts: cache: 1, fs: 1
FcDirCacheWriteDir dir "/usr/share/fonts" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//3830d5c3ddfd5cd38a049b759396e72e-le32d4.cache-6"
caching, new cache contents: 0 fonts, 1 dirs
Re-scanning [/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs]/usr/lib/X11/fonts: FcCacheTimeValid dir "/usr/lib/X11/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/lib/X11/fonts: cache: 1, fs: 1
FcDirCacheWriteDir dir "/usr/lib/X11/fonts" file "/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/var/cache/fontconfig//983f9ea3cd1b62854d3a0538dc38ca90-le32d4.cache-6"
caching, new cache contents: 0 fonts, 1 dirs
Created CACHEDIR.TAG at /OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//var/cache/fontconfig
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//var/cache/fontconfig: cleaning cache directory
FcCacheTimeValid dir "/usr/lib/X11/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/lib/X11/fonts: cache: 1, fs: 1
FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts: cache: 1, fs: 1
FcCacheTimeValid dir "/usr/lib/X11/fonts/ttf" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/lib/X11/fonts/ttf: cache: 0, fs: 0
FcCacheTimeValid dir "/usr/share/fonts/ttf" cache checksum 1456232724 dir checksum 1456232724
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs//usr/share/fonts/ttf: cache: 0, fs: 0
/OE/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs/usr/bin/fc-cache: succeeded
OE @ ~/build/oe-core/tmp-glibc/work/qemux86-oe-linux/core-image-weston/1.0-r0/rootfs $ echo $?
0
Comment 5 Martin Jansa 2016-02-23 14:11:56 UTC
Even better, remove
<dir>/usr/lib/X11/fonts</dir>
from
/etc/fonts/fonts.conf
when DISTRO_FEATURES don't have x11
Comment 7 Ross Burton 2016-03-17 22:11:50 UTC
Fixed in oe-core 8cc47e6bfb7f623711d9cd9e71a7f72ab2838f57