All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] fontcache: make the caches built into an image valid
@ 2026-10-13 10:49 Alex Kiernan
  2026-10-13 10:49 ` [PATCH 1/4] package_manager: pass REPRODUCIBLE_TIMESTAMP_ROOTFS to intercepts Alex Kiernan
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Alex Kiernan @ 2026-10-13 10:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alex Kiernan

The fontconfig caches update_font_cache builds into an image are never
used on the target. fontconfig accepts a cache only while the directory
mtime it recorded matches the directory, and three things disagree about
that mtime:

- fc-cache records min(directory mtime, SOURCE_DATE_EPOCH). When the
  intercept runs, the font directories still carry their packages'
  mtimes and SOURCE_DATE_EPOCH is the image's fallback value.
- reproducible_final_image_task then sets every mtime in the rootfs to
  REPRODUCIBLE_TIMESTAMP_ROOTFS.
- mke2fs clamps every inode time to the SOURCE_DATE_EPOCH in its
  environment, so an ext image ends up with a different time again from
  a tar or squashfs image of the same rootfs.

So every process using fonts rescans and writes a cache of its own, or
fails to on a read-only rootfs. fc-cache also deletes a cache it has
just written for a directory newer than SOURCE_DATE_EPOCH, so with the
default values some caches are missing from the image entirely.

Patches 1-2 run fc-cache under REPRODUCIBLE_TIMESTAMP_ROOTFS, with the
font directories' mtimes already set to it. Patch 3 keeps that time in ext
images, as oe_mksquashfs already does for squashfs. That moves every
inode and superblock time in an ext image from
SOURCE_DATE_EPOCH_FALLBACK to REPRODUCIBLE_TIMESTAMP_ROOTFS, which with
the bitbake.conf defaults is from 2011-04-05 to 2018-03-09. Patch 4
adds a selftest that boots an image carrying a font and checks that
fontconfig accepts every cache and writes none. On qemuarm64 it fails
without patches 1-3 and passes with them.

---
Alex Kiernan (4):
      package_manager: pass REPRODUCIBLE_TIMESTAMP_ROOTFS to intercepts
      update_font_cache: write caches that are valid in the final image
      image_types: keep the rootfs mtimes in ext2/3/4 images
      oeqa/selftest: check the font caches an image ships are used

 meta/classes-recipe/fontcache.bbclass         |  1 +
 meta/classes-recipe/image_types.bbclass       |  6 ++++
 meta/lib/oe/package_manager/__init__.py       |  6 ++++
 meta/lib/oeqa/selftest/cases/fontcache.py     | 42 +++++++++++++++++++++++++++
 scripts/postinst-intercepts/update_font_cache | 12 +++++++-
 5 files changed, 66 insertions(+), 1 deletion(-)
---
base-commit: 6b2dcfdbe16055edc88f72dabf07e33f8163d8eb
change-id: 20261013-fontcache-reproducible-mtime-f03aa3135def

Best regards,
--  
Alex Kiernan <alex.kiernan@gmail.com>



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-09 18:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 10:49 [PATCH 0/4] fontcache: make the caches built into an image valid Alex Kiernan
2026-10-13 10:49 ` [PATCH 1/4] package_manager: pass REPRODUCIBLE_TIMESTAMP_ROOTFS to intercepts Alex Kiernan
2026-10-13 10:49 ` [PATCH 2/4] update_font_cache: write caches that are valid in the final image Alex Kiernan
2026-10-13 10:49 ` [PATCH 3/4] image_types: keep the rootfs mtimes in ext2/3/4 images Alex Kiernan
2026-10-13 10:49 ` [PATCH 4/4] oeqa/selftest: check the font caches an image ships are used Alex Kiernan
2026-11-09 14:20 ` [PATCH 0/4] fontcache: make the caches built into an image valid Paul Barker
2026-11-09 14:57   ` Alex Kiernan
     [not found]   ` <18E6685CF84244C0.681194@lists.openembedded.org>
2026-11-09 18:45     ` [OE-core] " Alex Kiernan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.