* 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>
46 lines
1.2 KiB
Bash
Executable file
46 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/bash
|
|
|
|
echo "::group:: ===$(basename "$0")==="
|
|
|
|
set -ouex pipefail
|
|
|
|
KERNEL_VERSION=$(rpm -q --queryformat="%{evr}.%{arch}" kernel-core)
|
|
INITRAMFS="/usr/lib/modules/${KERNEL_VERSION}/initramfs.img"
|
|
|
|
V4L2_PATH="$(rpm -ql kmod-v4l2loopback)"
|
|
|
|
DRACUT_REMOVE=(
|
|
# makes no difference if in initramfs or not
|
|
# this is a hack FIXME in ublue-os/akmods
|
|
${V4L2_PATH} # ko.kz file has build id's changing -> non-reproducible
|
|
)
|
|
|
|
# https://github.com/ublue-os/aurora/issues/2568
|
|
# these strings change with every build
|
|
TMP_OS_RELEASE=$(mktemp --tmpdir 'os-release-XXXXXXXXXX')
|
|
OS_RELEASE="/usr/lib/os-release"
|
|
cp "${OS_RELEASE}" "${TMP_OS_RELEASE}"
|
|
sed -Ei -e '/^((OSTREE_)?(IMAGE_)?VERSION|PRETTY_NAME|BUILD_ID)=/d' "${OS_RELEASE}"
|
|
|
|
DRACUT_NO_XATTR=1 /usr/bin/dracut \
|
|
--kver "${KERNEL_VERSION}" \
|
|
--reproducible \
|
|
--verbose \
|
|
--force \
|
|
--remove "${DRACUT_REMOVE[@]}" \
|
|
"${INITRAMFS}"
|
|
|
|
# mv causes permissions to change
|
|
cp "${TMP_OS_RELEASE}" "${OS_RELEASE}"
|
|
rm "${TMP_OS_RELEASE}"
|
|
|
|
chmod 0600 "${INITRAMFS}"
|
|
|
|
# for reproducibility
|
|
# This is done globally now
|
|
# touch -a -m -d "1970-01-01T00:00:00Z" "${INITRAMFS}"
|
|
|
|
# for debugging
|
|
sha256sum "${INITRAMFS}"
|
|
|
|
echo "::endgroup::"
|