mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 03:20:38 +02:00
fix release script
This commit is contained in:
parent
263d1e6b2e
commit
b23c0114ce
3 changed files with 18 additions and 20 deletions
|
@ -2,12 +2,12 @@
|
||||||
# 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"
|
_AMD_UCODE="/boot/amd-ucode.img"
|
||||||
_CACHEDIR="/var/cache/pacman/pkg"
|
_CACHEDIR="/var/cache/pacman/pkg"
|
||||||
_CONFIG_DIR="/etc/archboot"
|
_CONFIG_DIR="/etc/archboot"
|
||||||
_DLPROG="curl -L -s"
|
_DLPROG="curl -L -s"
|
||||||
_FIX_PACKAGES="libelf libevent talloc gcc-libs glibc glib2 icu pcre2 nss terminus-font"
|
_FIX_PACKAGES="libelf libevent talloc gcc-libs glibc glib2 icu pcre2 nss terminus-font"
|
||||||
_INTEL_UCODE="boot/intel-ucode.img"
|
_INTEL_UCODE="/boot/intel-ucode.img"
|
||||||
_KERNELPKG="linux"
|
_KERNELPKG="linux"
|
||||||
_KEYRING="archlinux-keyring"
|
_KEYRING="archlinux-keyring"
|
||||||
_LABEL="Exit"
|
_LABEL="Exit"
|
||||||
|
@ -373,12 +373,6 @@ _create_cpio() {
|
||||||
echo "Build complete."
|
echo "Build complete."
|
||||||
}
|
}
|
||||||
|
|
||||||
_run_ukify() {
|
|
||||||
/usr/lib/systemd/ukify build --linux="${_KERNEL}" \
|
|
||||||
${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${initrd}" --cmdline="${_CMDLINE}" \
|
|
||||||
--os-release=@"${_OSREL}" --splash="${_SPLASH}" --output="${_UKI}" &>"${_NO_LOG}"
|
|
||||||
}
|
|
||||||
|
|
||||||
_reproducibility() {
|
_reproducibility() {
|
||||||
# Reproducibility: set all timestamps to 0
|
# Reproducibility: set all timestamps to 0
|
||||||
fd . "${1}" -u --min-depth 1 -X touch -hcd "@0"
|
fd . "${1}" -u --min-depth 1 -X touch -hcd "@0"
|
||||||
|
|
|
@ -95,7 +95,7 @@ _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
|
||||||
mv "${_W_DIR}/${_AMD_UCODE}" boot/
|
mv "${_W_DIR}/${_AMD_UCODE}" boot/
|
||||||
mv "${_W_DIR}/${_KERNEL}" boot/
|
mv "${_KERNEL}" boot/
|
||||||
if [[ "${_ARCH}" == "aarch64" ]]; then
|
if [[ "${_ARCH}" == "aarch64" ]]; then
|
||||||
# replace aarch64 Image.gz with Image kernel for UKI
|
# replace aarch64 Image.gz with Image kernel for UKI
|
||||||
# compressed image is not working at the moment
|
# compressed image is not working at the moment
|
||||||
|
@ -120,17 +120,19 @@ _create_iso() {
|
||||||
mv "${_W_DIR}/usr/share/licenses/amd-ucode" licenses/
|
mv "${_W_DIR}/usr/share/licenses/amd-ucode" licenses/
|
||||||
[[ "${_ARCH}" == "x86_64" ]] && mv "${_W_DIR}/usr/share/licenses/intel-ucode" licenses/
|
[[ "${_ARCH}" == "x86_64" ]] && mv "${_W_DIR}/usr/share/licenses/intel-ucode" licenses/
|
||||||
echo "Generating Unified Kernel Images..."
|
echo "Generating Unified Kernel Images..."
|
||||||
_KERNEL="boot/${_KERNEL##*/})"
|
_KERNEL="boot/${_KERNEL##*/}"
|
||||||
[[ -n "${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=${_INTEL_UCODE}"
|
[[ -n "${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=${_INTEL_UCODE}"
|
||||||
_AMD_UCODE="--initrd=${_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/${_NAME}-${_ARCH}.efi"
|
||||||
[[ "${initrd}" == "${_INITRD_LATEST}" ]] && _UKI="boot/${_NAME}-latest-${_ARCH}.efi"
|
[[ "${initrd}" == "${_INITRD_LATEST}" ]] && _UKI="/boot/${_NAME}-latest-${_ARCH}.efi"
|
||||||
[[ "${initrd}" == "${_INITRD_LOCAL}" ]] && _UKI="boot/${_NAME}-local-${_ARCH}.efi"
|
[[ "${initrd}" == "${_INITRD_LOCAL}" ]] && _UKI="/boot/${_NAME}-local-${_ARCH}.efi"
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
${_NSPAWN} "${_W_DIR}" _run_ukify
|
${_NSPAWN} "${_W_DIR}" /usr/lib/systemd/ukify build --linux="${_KERNEL}" \
|
||||||
|
${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${initrd}" --cmdline="${_CMDLINE}" \
|
||||||
|
--os-release=@"${_OSREL}" --splash="${_SPLASH}" --output="${_UKI}" || exit 1
|
||||||
done
|
done
|
||||||
# fix permission and timestamp
|
# fix permission and timestamp
|
||||||
mv "${_W_DIR}"/boot ./
|
mv "${_W_DIR}"/boot ./
|
||||||
|
@ -163,17 +165,17 @@ _create_iso() {
|
||||||
${_NSPAWN} "${_W_DIR}" pacman -Q | sd '\r|\x1b\[[0-9;]*m|\x1b\[.[0-9]+[h;l]' '') >>Release.txt
|
${_NSPAWN} "${_W_DIR}" pacman -Q | sd '\r|\x1b\[[0-9;]*m|\x1b\[.[0-9]+[h;l]' '') >>Release.txt
|
||||||
echo "Removing container ${_W_DIR}..."
|
echo "Removing container ${_W_DIR}..."
|
||||||
rm -r "${_W_DIR}"
|
rm -r "${_W_DIR}"
|
||||||
if ! [[ "${_ARCH}" == "riscv64" ]]; then
|
if [[ "${_ARCH}" == "riscv64" ]]; then
|
||||||
|
echo "Creating img/ directory..."
|
||||||
|
mkdir img
|
||||||
|
mv ./*.img img/
|
||||||
|
else
|
||||||
echo "Creating iso/ directory..."
|
echo "Creating iso/ directory..."
|
||||||
mkdir iso
|
mkdir iso
|
||||||
mv ./*.iso iso/
|
mv ./*.iso iso/
|
||||||
echo "Creating uki/ directory..."
|
echo "Creating uki/ directory..."
|
||||||
mkdir uki
|
mkdir uki
|
||||||
mv boot/*.efi uki/
|
mv boot/*.efi uki/
|
||||||
else
|
|
||||||
echo "Creating img/ directory..."
|
|
||||||
mkdir img
|
|
||||||
mv ./*.img img/
|
|
||||||
fi
|
fi
|
||||||
echo "Generating b2sum..."
|
echo "Generating b2sum..."
|
||||||
for i in *; do
|
for i in *; do
|
||||||
|
|
|
@ -62,7 +62,9 @@ _systemd_ukify() {
|
||||||
[[ -n "/${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=/${_INTEL_UCODE}"
|
[[ -n "/${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=/${_INTEL_UCODE}"
|
||||||
_AMD_UCODE="--initrd=/${_AMD_UCODE}"
|
_AMD_UCODE="--initrd=/${_AMD_UCODE}"
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
_run_ukify || exit 1
|
/usr/lib/systemd/ukify build --linux="${_KERNEL}" \
|
||||||
|
${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${initrd}" --cmdline="${_CMDLINE}" \
|
||||||
|
--os-release=@"${_OSREL}" --splash="${_SPLASH}" --output="${_UKI}" &>"${_NO_LOG}" || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
_create_cksum() {
|
_create_cksum() {
|
||||||
|
|
Loading…
Reference in a new issue