mirror of
https://github.com/ublue-os/aurora.git
synced 2026-11-03 21:39:41 -09:00
feat: timestamp all files with epoch 0 (#3028)
* feat: timestamp all files with epoch 0 We have been using this chunkah feature [1] to put non-rpm content like the brew tarball in dedicated layers, we didn't actually save any bandwith on downloads with this as the copying sets the file modification and access time. Which makes it non-reproducible and every single update would re-download everything not in RPMs. This should make updates smaller especially noticeable on daily/multiple daily image builds. I'm not sure how much of a positive effect this is gonna have on the stable weekly images as the brew tarball is refreshed weekly. Things like the wallpapers should at least no longer be downloaded when they haven't changed. There are still some files we could do but I think it's mostly not worth it. xref: https://github.com/ublue-os/aurora/issues/2579 [1] https://github.com/coreos/chunkah#customizing-the-layers * typo Co-authored-by: Adam Fidel <ledif@users.noreply.github.com> --------- Co-authored-by: Adam Fidel <ledif@users.noreply.github.com>
This commit is contained in:
parent
2ae50c0392
commit
3ef1256cd3
4 changed files with 59 additions and 25 deletions
|
|
@ -94,7 +94,7 @@ RUN --network=none \
|
|||
/ctx/build_scripts/base/18-image-info.sh && \
|
||||
/ctx/build_scripts/base/19-initramfs.sh && \
|
||||
/ctx/build_scripts/shared/clean-stage.sh && \
|
||||
/ctx/build_scripts/shared/chunkah-xattr.sh && \
|
||||
/ctx/build_scripts/shared/unpackaged.sh && \
|
||||
/ctx/build_scripts/base/20-tests.sh
|
||||
|
||||
CMD ["/sbin/init"]
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ rm "${TMP_OS_RELEASE}"
|
|||
chmod 0600 "${INITRAMFS}"
|
||||
|
||||
# for reproducibility
|
||||
touch -a -m -d "1970-01-01T00:00:00Z" "${INITRAMFS}"
|
||||
# This is done globally now
|
||||
# touch -a -m -d "1970-01-01T00:00:00Z" "${INITRAMFS}"
|
||||
|
||||
# for debugging
|
||||
sha256sum "${INITRAMFS}"
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
# See: https://github.com/coreos/chunkah#customizing-the-layers
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eoux pipefail
|
||||
|
||||
setfattr -n user.component -v "aurora-wallpapers" /usr/share/backgrounds/aurora
|
||||
setfattr -n user.update-interval -v "monthly" /usr/share/backgrounds/aurora
|
||||
|
||||
setfattr -n user.component -v "aurora-assets" /usr/share/plasma/avatars/{echo,lumina,scope,tina,vincent}.png
|
||||
setfattr -n user.component -v "aurora-assets" /etc/bazaar/*.jxl
|
||||
setfattr -n user.update-interval -v "quarterly" /etc/bazaar/*.jxl
|
||||
|
||||
setfattr -n user.component -v "aurora-plasma-theme" /usr/share/plasma/look-and-feel/dev.getaurora.aurora{,light}.desktop
|
||||
setfattr -n user.update-interval -v "quarterly" /usr/share/plasma/look-and-feel/dev.getaurora.aurora{,light}.desktop
|
||||
|
||||
setfattr -n user.component -v "aurora-config" /usr/share/ublue-os
|
||||
setfattr -n user.component -v "homebrew" /usr/share/homebrew.tar.zst
|
||||
|
||||
setfattr -n user.component -v "aurora-offline-docs" /usr/share/doc/aurora/aurora.pdf
|
||||
|
||||
setfattr -n user.component -v "aurora-config" /usr/lib/systemd/system-generators/coreos-sulogin-force-generator
|
||||
|
||||
setfattr -n user.component -v "aurora-config" /usr/share/bash-preexec
|
||||
56
build_scripts/shared/unpackaged.sh
Executable file
56
build_scripts/shared/unpackaged.sh
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bash
|
||||
# See: https://github.com/coreos/chunkah#customizing-the-layers
|
||||
echo "::group:: ===$(basename "$0")==="
|
||||
|
||||
set -eoux pipefail
|
||||
|
||||
HOMEBREW_TARBALL=/usr/share/homebrew.tar.zst
|
||||
setfattr -n user.component -v "homebrew" "${HOMEBREW_TARBALL}"
|
||||
|
||||
# rpm-ostree creates tmpfiles from packages having owned files in /{var,run}
|
||||
RPM_OSTREE_TMPFILES=/usr/lib/rpm-ostree/tmpfiles.d
|
||||
setfattr -n user.component -v "rpm-ostree-tmpfiles.d" "${RPM_OSTREE_TMPFILES}"
|
||||
# vibes, shouldn't change super often
|
||||
setfattr -n user.update-interval -v "quarterly" "${RPM_OSTREE_TMPFILES}"
|
||||
|
||||
FONTCONFIG_CACHE=/usr/lib/fontconfig/cache
|
||||
setfattr -n user.component -v "fontconfig-cache" "${FONTCONFIG_CACHE}"
|
||||
# also vibes, no idea how often this changes, but it seems to change often
|
||||
setfattr -n user.update-interval -v "daily" "${FONTCONFIG_CACHE}"
|
||||
|
||||
WALLPAPERS=/usr/share/backgrounds/aurora
|
||||
setfattr -n user.component -v "aurora-wallpapers" "${WALLPAPERS}"
|
||||
setfattr -n user.update-interval -v "monthly" "${WALLPAPERS}"
|
||||
|
||||
AURORA_CHARS=(/usr/share/plasma/avatars/{echo,lumina,scope,tina,vincent}.png)
|
||||
setfattr -n user.component -v "aurora-assets" "${AURORA_CHARS[@]}"
|
||||
|
||||
BAZAAR=(/etc/bazaar/*.jxl)
|
||||
setfattr -n user.component -v "aurora-assets" "${BAZAAR[@]}"
|
||||
setfattr -n user.update-interval -v "quarterly" "${BAZAAR[@]}"
|
||||
|
||||
AURORA_DOCS_PDF="/usr/share/doc/aurora/aurora.pdf"
|
||||
setfattr -n user.component -v "aurora-offline-docs" "${AURORA_DOCS_PDF}"
|
||||
|
||||
# TODO: everything else we can probably add here
|
||||
FRAMEWORK_ICC=(/usr/share/color/icc/colord/framework1{3,6}.icc)
|
||||
setfattr -n user.component -v "never-change" "${FRAMEWORK_ICC[@]}"
|
||||
setfattr -n user.update-interval -v "yearly" "${FRAMEWORK_ICC[@]}"
|
||||
|
||||
# This is absolutely nasty, ideally we'd use SOURCE_DATE_EPOCH=0 on chunkah for
|
||||
# all the touch invocations but this (potentially) affects the layer plan
|
||||
# negatively
|
||||
# See: https://github.com/coreos/chunkah/issues/160
|
||||
#
|
||||
# on the composefs backend this also makes it so that bootc (uupd notification)
|
||||
# flags the image as outdated with label org.opencontainers.image.created and
|
||||
# ".Created" (it's set to 1970 after all) this doesn't happen on ostree
|
||||
# https://github.com/bootc-dev/bootc/issues/2227
|
||||
|
||||
# This shouldn't hurt anything, Epoch 0 is what RPMs are using, we don't want to override that
|
||||
find /usr /etc /opt -exec touch -h -a -m -d '1970-01-01T00:00:00Z' {} +
|
||||
|
||||
# getfattr -R -d /usr 2> /dev/null || true
|
||||
# getfattr -R -d /etc 2> /dev/null || true
|
||||
|
||||
echo "::endgroup::"
|
||||
Loading…
Reference in a new issue