mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
Compare commits
No commits in common. "1f9bab0af0c3ceaa1e2f20d802069d97ef7eeab2" and "5931918d8f9fc5f4c0d9dcef920c8f7f5fae2995" have entirely different histories.
1f9bab0af0
...
5931918d8f
9 changed files with 37 additions and 30 deletions
|
@ -3,7 +3,6 @@ On the road to 2024.09:
|
||||||
- added custom autorun script support
|
- added custom autorun script support
|
||||||
- added archboot-x86_64-uki.sh script
|
- added archboot-x86_64-uki.sh script
|
||||||
- added archboot-aarch64-uki.sh script
|
- added archboot-aarch64-uki.sh script
|
||||||
- switched name scheme for UKI images
|
|
||||||
setup:
|
setup:
|
||||||
- switched to new limine 8.0 config layout (issue #4)
|
- switched to new limine 8.0 config layout (issue #4)
|
||||||
- switched to mkinitcpio uki generation (issue #3)
|
- switched to mkinitcpio uki generation (issue #3)
|
||||||
|
|
|
@ -26,9 +26,6 @@ else
|
||||||
_ARCHBOOT="archboot"
|
_ARCHBOOT="archboot"
|
||||||
_ARCH="x86_64"
|
_ARCH="x86_64"
|
||||||
fi
|
fi
|
||||||
_CONFIG_DIR="/etc/archboot"
|
|
||||||
_AMD_UCODE="/boot/amd-ucode.img"
|
|
||||||
_INTEL_UCODE="/boot/intel-ucode.img"
|
|
||||||
_PACMAN_MIRROR="/etc/pacman.d/mirrorlist"
|
_PACMAN_MIRROR="/etc/pacman.d/mirrorlist"
|
||||||
_PACMAN_CONF="/etc/pacman.conf"
|
_PACMAN_CONF="/etc/pacman.conf"
|
||||||
_PACMAN_LIB="/var/lib/pacman"
|
_PACMAN_LIB="/var/lib/pacman"
|
||||||
|
@ -362,8 +359,3 @@ _create_cpio() {
|
||||||
popd >"${_NO_LOG}" || return 1
|
popd >"${_NO_LOG}" || return 1
|
||||||
echo "Build complete."
|
echo "Build complete."
|
||||||
}
|
}
|
||||||
|
|
||||||
_reproducibility() {
|
|
||||||
# Reproducibility: set all timestamps to 0
|
|
||||||
fd . "${1}" -u --min-depth 1 -X touch -hcd "@0"
|
|
||||||
}
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ _copy_archboot_defaults() {
|
||||||
cp /etc/archboot/defaults "${1}"/etc/archboot/defaults
|
cp /etc/archboot/defaults "${1}"/etc/archboot/defaults
|
||||||
}
|
}
|
||||||
|
|
||||||
_container_reproducibility() {
|
_reproducibility() {
|
||||||
echo "Reproducibility changes..."
|
echo "Reproducibility changes..."
|
||||||
#shellcheck disable=SC2016
|
#shellcheck disable=SC2016
|
||||||
sd '(INSTALLDATE%)\n.*' '$1\n0' "${1}""${_PACMAN_LIB}"/local/*/desc
|
sd '(INSTALLDATE%)\n.*' '$1\n0' "${1}""${_PACMAN_LIB}"/local/*/desc
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||||
. /etc/archboot/defaults
|
. /etc/archboot/defaults
|
||||||
|
_CONFIG_DIR="/etc/archboot"
|
||||||
_ISODIR="$(mktemp -d ISODIR.XXX)"
|
_ISODIR="$(mktemp -d ISODIR.XXX)"
|
||||||
_BOOTLOADER="/usr/share/archboot/bootloader"
|
_BOOTLOADER="/usr/share/archboot/bootloader"
|
||||||
|
|
||||||
|
@ -106,14 +107,14 @@ _prepare_ucode() {
|
||||||
# only x86_64
|
# only x86_64
|
||||||
if [[ "${_ARCH}" == "x86_64" ]]; then
|
if [[ "${_ARCH}" == "x86_64" ]]; then
|
||||||
echo "Preparing intel-ucode..."
|
echo "Preparing intel-ucode..."
|
||||||
cp "${_INTEL_UCODE}" "${_ISODIR}/boot/"
|
cp /boot/intel-ucode.img "${_ISODIR}/boot/"
|
||||||
mkdir -p "${_ISODIR}"/licenses/intel-ucode
|
mkdir -p "${_ISODIR}"/licenses/intel-ucode
|
||||||
cp /usr/share/licenses/intel-ucode/LICENSE "${_ISODIR}/licenses/intel-ucode"
|
cp /usr/share/licenses/intel-ucode/LICENSE "${_ISODIR}/licenses/intel-ucode"
|
||||||
fi
|
fi
|
||||||
# both x86_64 and aarch64
|
# both x86_64 and aarch64
|
||||||
if ! [[ "${_ARCH}" == "riscv64" ]]; then
|
if ! [[ "${_ARCH}" == "riscv64" ]]; then
|
||||||
echo "Preparing amd-ucode..."
|
echo "Preparing amd-ucode..."
|
||||||
cp "${_AMD_UCODE}" "${_ISODIR}/boot/"
|
cp /boot/amd-ucode.img "${_ISODIR}/boot/"
|
||||||
mkdir -p "${_ISODIR}"/licenses/amd-ucode
|
mkdir -p "${_ISODIR}"/licenses/amd-ucode
|
||||||
cp /usr/share/licenses/amd-ucode/LICENSE.amd-ucode "${_ISODIR}/licenses/amd-ucode"
|
cp /usr/share/licenses/amd-ucode/LICENSE.amd-ucode "${_ISODIR}/licenses/amd-ucode"
|
||||||
fi
|
fi
|
||||||
|
@ -174,6 +175,11 @@ _prepare_background() {
|
||||||
cp ${_GRUB_BACKGROUND} "${_ISODIR}/boot/grub/archboot-background.png"
|
cp ${_GRUB_BACKGROUND} "${_ISODIR}/boot/grub/archboot-background.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_reproducibility() {
|
||||||
|
# Reproducibility: set all timestamps to 0
|
||||||
|
fd . "${_ISODIR}" -u --min-depth 1 -X touch -hcd "@0"
|
||||||
|
}
|
||||||
|
|
||||||
_prepare_uefi_image() {
|
_prepare_uefi_image() {
|
||||||
echo "Preparing UEFI image..."
|
echo "Preparing UEFI image..."
|
||||||
## get size of boot files
|
## get size of boot files
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||||
. /etc/archboot/defaults
|
. /etc/archboot/defaults
|
||||||
|
_AMD_UCODE="boot/amd-ucode.img"
|
||||||
|
_INTEL_UCODE="boot/intel-ucode.img"
|
||||||
_INITRD="boot/initrd-${_ARCH}.img"
|
_INITRD="boot/initrd-${_ARCH}.img"
|
||||||
_INITRD_LATEST="boot/initrd-latest-${_ARCH}.img"
|
_INITRD_LATEST="boot/initrd-latest-${_ARCH}.img"
|
||||||
_INITRD_LOCAL="boot/initrd-local-${_ARCH}.img"
|
_INITRD_LOCAL="boot/initrd-local-${_ARCH}.img"
|
||||||
|
@ -39,7 +41,7 @@ _create_iso() {
|
||||||
. "${_W_DIR}/etc/archboot/${_ARCH}.conf"
|
. "${_W_DIR}/etc/archboot/${_ARCH}.conf"
|
||||||
#shellcheck disable=SC2116,SC2046,2086
|
#shellcheck disable=SC2116,SC2046,2086
|
||||||
_KVER="$(_kver $(echo ${_W_DIR}${_KERNEL}))"
|
_KVER="$(_kver $(echo ${_W_DIR}${_KERNEL}))"
|
||||||
_NAME="archboot-$(date +%Y.%m.%d-%H.%M)-${_KVER}"
|
_ISONAME="archboot-$(date +%Y.%m.%d-%H.%M)-${_KVER}"
|
||||||
if ! [[ "${_RUNNING_ARCH}" == "${_ARCH}" ]]; then
|
if ! [[ "${_RUNNING_ARCH}" == "${_ARCH}" ]]; then
|
||||||
### to speedup build for riscv64 and aarch64 on x86_64, run compressor on host system
|
### to speedup build for riscv64 and aarch64 on x86_64, run compressor on host system
|
||||||
echo "Generating initramdisks..."
|
echo "Generating initramdisks..."
|
||||||
|
@ -68,16 +70,16 @@ _create_iso() {
|
||||||
echo "Generating local ISO..."
|
echo "Generating local ISO..."
|
||||||
# generate local iso in container
|
# generate local iso in container
|
||||||
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*;archboot-${_ARCH}-iso.sh -g -s \
|
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*;archboot-${_ARCH}-iso.sh -g -s \
|
||||||
-c=${_CONFIG_LOCAL} -i=${_NAME}-local-${_ARCH}" || exit 1
|
-c=${_CONFIG_LOCAL} -i=${_ISONAME}-local-${_ARCH}" || exit 1
|
||||||
echo "Generating latest ISO..."
|
echo "Generating latest ISO..."
|
||||||
# generate latest iso in container
|
# generate latest iso in container
|
||||||
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*;archboot-${_ARCH}-iso.sh -g \
|
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*;archboot-${_ARCH}-iso.sh -g \
|
||||||
-c=${_CONFIG_LATEST} -i=${_NAME}-latest-${_ARCH}" || exit 1
|
-c=${_CONFIG_LATEST} -i=${_ISONAME}-latest-${_ARCH}" || exit 1
|
||||||
fi
|
fi
|
||||||
echo "Generating normal ISO..."
|
echo "Generating normal ISO..."
|
||||||
# generate iso in container
|
# generate iso in container
|
||||||
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-${_ARCH}-iso.sh -g -s \
|
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-${_ARCH}-iso.sh -g -s \
|
||||||
-i=${_NAME}-${_ARCH}" || exit 1
|
-i=${_ISONAME}-${_ARCH}" || exit 1
|
||||||
# move iso out of container
|
# move iso out of container
|
||||||
mv "${_W_DIR}"/*.iso ./ &>"${_NO_LOG}"
|
mv "${_W_DIR}"/*.iso ./ &>"${_NO_LOG}"
|
||||||
mv "${_W_DIR}"/*.img ./ &>"${_NO_LOG}"
|
mv "${_W_DIR}"/*.img ./ &>"${_NO_LOG}"
|
||||||
|
@ -100,8 +102,8 @@ _create_iso() {
|
||||||
for i in *.iso; do
|
for i in *.iso; do
|
||||||
if echo "${i}" | rg -v 'local' | rg -vq 'latest'; then
|
if echo "${i}" | rg -v 'local' | rg -vq 'latest'; then
|
||||||
isoinfo -R -i "${i}" -x /efi.img 2>"${_NO_LOG}" > efi.img
|
isoinfo -R -i "${i}" -x /efi.img 2>"${_NO_LOG}" > efi.img
|
||||||
mcopy -m -i efi.img ::"${_AMD_UCODE}" ."${_AMD_UCODE}"
|
mcopy -m -i efi.img ::/"${_AMD_UCODE}" ./"${_AMD_UCODE}"
|
||||||
[[ "${_ARCH}" == "aarch64" ]] || mcopy -m -i efi.img ::"${_INTEL_UCODE}" ."${_INTEL_UCODE}"
|
[[ "${_ARCH}" == "aarch64" ]] || mcopy -m -i efi.img ::/"${_INTEL_UCODE}" ./"${_INTEL_UCODE}"
|
||||||
mcopy -m -i efi.img ::/"${_INITRD}" ./"${_INITRD}"
|
mcopy -m -i efi.img ::/"${_INITRD}" ./"${_INITRD}"
|
||||||
mcopy -m -i efi.img ::/"${_KERNEL_ARCHBOOT}" ./"${_KERNEL_ARCHBOOT}"
|
mcopy -m -i efi.img ::/"${_KERNEL_ARCHBOOT}" ./"${_KERNEL_ARCHBOOT}"
|
||||||
elif echo "${i}" | rg -q 'latest'; then
|
elif echo "${i}" | rg -q 'latest'; then
|
||||||
|
@ -135,14 +137,14 @@ _create_iso() {
|
||||||
cp "${_W_DIR}/boot/Image" "boot/Image-${_ARCH}"
|
cp "${_W_DIR}/boot/Image" "boot/Image-${_ARCH}"
|
||||||
_KERNEL_ARCHBOOT="boot/Image-${_ARCH}"
|
_KERNEL_ARCHBOOT="boot/Image-${_ARCH}"
|
||||||
fi
|
fi
|
||||||
[[ -n "${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=.${_INTEL_UCODE}"
|
[[ -n "${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=${_INTEL_UCODE}"
|
||||||
[[ -n "${_AMD_UCODE}" ]] && _AMD_UCODE="--initrd=.${_AMD_UCODE}"
|
[[ -n "${_AMD_UCODE}" ]] && _AMD_UCODE="--initrd=${_AMD_UCODE}"
|
||||||
rm -r "${_W_DIR:?}"/boot
|
rm -r "${_W_DIR:?}"/boot
|
||||||
mv boot "${_W_DIR}"
|
mv boot "${_W_DIR}"
|
||||||
for initrd in ${_INITRD} ${_INITRD_LATEST} ${_INITRD_LOCAL}; do
|
for initrd in ${_INITRD} ${_INITRD_LATEST} ${_INITRD_LOCAL}; do
|
||||||
[[ "${initrd}" == "${_INITRD}" ]] && _UKI="boot/${_NAME}-${_ARCH}.efi"
|
[[ "${initrd}" == "${_INITRD}" ]] && _UKI="boot/archboot-${_ARCH}.efi"
|
||||||
[[ "${initrd}" == "${_INITRD_LATEST}" ]] && _UKI="boot/${_NAME}-latest-${_ARCH}.efi"
|
[[ "${initrd}" == "${_INITRD_LATEST}" ]] && _UKI="boot/archboot-latest-${_ARCH}.efi"
|
||||||
[[ "${initrd}" == "${_INITRD_LOCAL}" ]] && _UKI="boot/${_NAME}-local-${_ARCH}.efi"
|
[[ "${initrd}" == "${_INITRD_LOCAL}" ]] && _UKI="boot/archboot-local-${_ARCH}.efi"
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
${_NSPAWN} "${_W_DIR}" /usr/lib/systemd/ukify build --linux=${_KERNEL_ARCHBOOT} \
|
${_NSPAWN} "${_W_DIR}" /usr/lib/systemd/ukify build --linux=${_KERNEL_ARCHBOOT} \
|
||||||
${_INTEL_UCODE} ${_AMD_UCODE} --initrd=${initrd} --cmdline=@${_CMDLINE} \
|
${_INTEL_UCODE} ${_AMD_UCODE} --initrd=${initrd} --cmdline=@${_CMDLINE} \
|
||||||
|
|
|
@ -53,7 +53,7 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
_change_pacman_conf "${1}" || exit 1
|
_change_pacman_conf "${1}" || exit 1
|
||||||
_container_reproducibility "${1}"
|
_reproducibility "${1}"
|
||||||
_set_hostname "${1}" || exit 1
|
_set_hostname "${1}" || exit 1
|
||||||
_ssh_keys "${1}" || exit 1
|
_ssh_keys "${1}" || exit 1
|
||||||
echo "Finished container setup in ${1}."
|
echo "Finished container setup in ${1}."
|
||||||
|
|
|
@ -26,9 +26,9 @@ if echo "${_BASENAME}" | rg -qw 'aarch64' || echo "${_BASENAME}" | rg -qw 'x86_6
|
||||||
_prepare_memtest || exit 1
|
_prepare_memtest || exit 1
|
||||||
fi
|
fi
|
||||||
_prepare_background || exit 1
|
_prepare_background || exit 1
|
||||||
_reproducibility "${_ISODIR}"
|
_reproducibility
|
||||||
_prepare_uefi_image || exit 1
|
_prepare_uefi_image || exit 1
|
||||||
_reproducibility "${_ISODIR}"
|
_reproducibility
|
||||||
_grub_mkrescue || exit 1
|
_grub_mkrescue || exit 1
|
||||||
_unify_gpt_partitions || exit 1
|
_unify_gpt_partitions || exit 1
|
||||||
else
|
else
|
||||||
|
@ -36,7 +36,7 @@ else
|
||||||
echo "Starting Image creation..."
|
echo "Starting Image creation..."
|
||||||
_prepare_kernel_initrd_files || exit 1
|
_prepare_kernel_initrd_files || exit 1
|
||||||
_prepare_extlinux_conf || exit 1
|
_prepare_extlinux_conf || exit 1
|
||||||
_reproducibility "${_ISODIR}"
|
_reproducibility
|
||||||
_uboot || exit 1
|
_uboot || exit 1
|
||||||
fi
|
fi
|
||||||
_create_cksum || exit 1
|
_create_cksum || exit 1
|
||||||
|
|
|
@ -12,9 +12,9 @@ _config
|
||||||
echo "Starting UKI creation..."
|
echo "Starting UKI creation..."
|
||||||
_prepare_kernel_initramfs || exit 1
|
_prepare_kernel_initramfs || exit 1
|
||||||
_prepare_ucode || exit 1
|
_prepare_ucode || exit 1
|
||||||
_prepare_splash || exit 1
|
_prepare_background || exit 1
|
||||||
_prepare_osrelease || exit 1
|
_prepare_osrelease || exit 1
|
||||||
_reproducibility "${_UKIDIR}"
|
_reproducibility || exit 1
|
||||||
_systemd_ukify || exit 1
|
_systemd_ukify || exit 1
|
||||||
_create_cksum || exit 1
|
_create_cksum || exit 1
|
||||||
_cleanup_uki || exit 1
|
_cleanup_uki || exit 1
|
||||||
|
|
|
@ -2,8 +2,11 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||||
. /etc/archboot/defaults
|
. /etc/archboot/defaults
|
||||||
|
_AMD_UCODE="/boot/amd-ucode.img"
|
||||||
|
_INTEL_UCODE="/boot/intel-ucode.img"
|
||||||
_SPLASH="/usr/share/archboot/uki/archboot-background.bmp"
|
_SPLASH="/usr/share/archboot/uki/archboot-background.bmp"
|
||||||
_OSREL="/usr/share/archboot/base/etc/os-release"
|
_OSREL="/usr/share/archboot/base/etc/os-release"
|
||||||
|
_CONFIG_DIR="/etc/archboot"
|
||||||
_UKIDIR="$(mktemp -d UKIDIR.XXX)"
|
_UKIDIR="$(mktemp -d UKIDIR.XXX)"
|
||||||
|
|
||||||
_usage () {
|
_usage () {
|
||||||
|
@ -69,7 +72,7 @@ _prepare_ucode() {
|
||||||
cp "${_AMD_UCODE}" "${_UKIDIR}/"
|
cp "${_AMD_UCODE}" "${_UKIDIR}/"
|
||||||
}
|
}
|
||||||
|
|
||||||
_prepare_splash() {
|
_prepare_background() {
|
||||||
echo "Preparing UKI splash..."
|
echo "Preparing UKI splash..."
|
||||||
cp "${_SPLASH}" "${_UKIDIR}/splash.bmp"
|
cp "${_SPLASH}" "${_UKIDIR}/splash.bmp"
|
||||||
}
|
}
|
||||||
|
@ -79,6 +82,11 @@ _prepare_osrelease() {
|
||||||
cp "${_OSREL}" "${_UKIDIR}/os-release"
|
cp "${_OSREL}" "${_UKIDIR}/os-release"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_reproducibility() {
|
||||||
|
# Reproducibility: set all timestamps to 0
|
||||||
|
fd . "${_UKIDIR}" -u --min-depth 1 -X touch -hcd "@0"
|
||||||
|
}
|
||||||
|
|
||||||
_systemd_ukify() {
|
_systemd_ukify() {
|
||||||
echo "Generating ${_ARCH} UKI image..."
|
echo "Generating ${_ARCH} UKI image..."
|
||||||
pushd "${_UKIDIR}" &>"${_NO_LOG}" || exit 1
|
pushd "${_UKIDIR}" &>"${_NO_LOG}" || exit 1
|
||||||
|
|
Loading…
Reference in a new issue