#!/usr/bin/env bash # shellcheck disable=SC2034 iso_name="Alvin archlinux" iso_label="AlvinArch_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)" iso_publisher="Arch Linux " iso_application="Alvin Arch Linux Live ISO" iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)" install_dir="arch" buildmodes=('iso') bootmodes=('bios.syslinux' 'uefi.systemd-boot') pacman_conf="pacman.conf" airootfs_image_type="squashfs" airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86,arm64' '-b' '1M' '-Xdict-size' '1M') bootstrap_tarball_compression=('zstd' '-c' '-T0' '--auto-threads=logical' '--long' '-19') file_permissions=( ["/etc/shadow"]="0:0:400" ["/root"]="0:0:750" ["/root/.automated_script.sh"]="0:0:755" ["/root/.gnupg"]="0:0:700" ["/usr/local/bin/choose-mirror"]="0:0:755" ["/usr/local/bin/alvin-install"]="0:0:755" ["/usr/local/bin/Installation_guide"]="0:0:755" ["/usr/local/bin/livecd-sound"]="0:0:755" ) # ── Build stamp (staged file, never committed) ──────────────────────────────── # airootfs/root/.iso-build-stamp lands at /root/.iso-build-stamp on the ISO; # customize_airootfs.sh keeps it as /etc/alvin-build-stamp and appends it to # the live medium's /etc/motd (the installed system's motd is left alone). # Only stamp builds from a git # checkout or CI — a random source-tarball build would record a bogus commit. # Sourced by mkarchiso under `set -eu`, hence every expansion is defaulted. _stamp_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" _stamp_file="${_stamp_dir}/airootfs/root/.iso-build-stamp" rm -f "${_stamp_file}" if [[ -e "${_stamp_dir}/.git" || -n "${CI:-}" || -n "${GITEA_ACTIONS:-}" ]]; then _stamp_build="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)" # git ≥2.46 honours -c safe.directory even when mkarchiso runs as root # over a user-owned checkout; older gits ignore it (protected-config # scope) and fall through to the "unknown" line below instead of failing # the build (`|| true` keeps set -e happy either way). _stamp_commit="$(git -C "${_stamp_dir}" -c safe.directory="${_stamp_dir}" \ log -1 --format='%cs|%h' 2>/dev/null || true)" if [[ -n "${_stamp_commit}" && "${_stamp_commit}" == *"|"* ]]; then _stamp_hash="${_stamp_commit##*|}" printf 'AlvinArch build %s | commit %s | %s\n' \ "${_stamp_build}" "${_stamp_commit%%|*}" "${_stamp_hash:0:4}" \ > "${_stamp_file}" else printf 'AlvinArch build %s | commit unknown\n' \ "${_stamp_build}" > "${_stamp_file}" fi fi unset _stamp_dir _stamp_file _stamp_build _stamp_commit _stamp_hash