Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso/mkarchiso
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-01-01 11:13:28 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2023-01-01 11:13:28 +0100
commit876044a7b4432ffcf6f9d163c90fb4c982328b8e (patch)
treeb4dc38ef1ce87d99baa649c9c7ff5069d453e968 /archiso/mkarchiso
parent20e6f9e0fbdb5b3a4bb331e4e4ee3b38cb9ca67e (diff)
parentcd621f5f4a180ddbf5b6ddf2eb53c9d17cd9a14c (diff)
Merge branch 'upstreamMaster'
A
Diffstat (limited to 'archiso/mkarchiso')
-rwxr-xr-xarchiso/mkarchiso43
1 files changed, 33 insertions, 10 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index 820688d..7f6de7c 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -165,9 +165,10 @@ _cleanup_pacstrap_dir() {
[[ -d "${pacstrap_dir}/var/tmp" ]] && find "${pacstrap_dir}/var/tmp" -mindepth 1 -delete
# Delete package pacman related files.
find "${work_dir}" \( -name '*.pacnew' -o -name '*.pacsave' -o -name '*.pacorig' \) -delete
- # Create an empty /etc/machine-id
+ # Create /etc/machine-id with special value 'uninitialized': the final id is
+ # generated on first boot, systemd's first-boot mechanism applies (see machine-id(5))
rm -f -- "${pacstrap_dir}/etc/machine-id"
- printf '' > "${pacstrap_dir}/etc/machine-id"
+ printf 'uninitialized\n' > "${pacstrap_dir}/etc/machine-id"
_msg_info "Done!"
}
@@ -337,16 +338,16 @@ _make_custom_airootfs() {
_make_packages() {
_msg_info "Installing packages to '${pacstrap_dir}/'..."
- if [[ -n "${gpg_key}" ]]; then
- exec {ARCHISO_GNUPG_FD}<>"${work_dir}/pubkey.gpg"
+ if [[ -v gpg_publickey ]]; then
+ exec {ARCHISO_GNUPG_FD}<"$gpg_publickey"
export ARCHISO_GNUPG_FD
fi
if [[ -v cert_list[0] ]]; then
- exec {ARCHISO_TLS_FD}<>"${cert_list[0]}"
+ exec {ARCHISO_TLS_FD}<"${cert_list[0]}"
export ARCHISO_TLS_FD
fi
if [[ -v cert_list[2] ]]; then
- exec {ARCHISO_TLSCA_FD}<>"${cert_list[2]}"
+ exec {ARCHISO_TLSCA_FD}<"${cert_list[2]}"
export ARCHISO_TLSCA_FD
fi
@@ -366,7 +367,7 @@ _make_packages() {
exec {ARCHISO_TLSCA_FD}<&-
unset ARCHISO_TLSCA_FD
fi
- if [[ -n "${gpg_key}" ]]; then
+ if [[ -v gpg_publickey ]]; then
exec {ARCHISO_GNUPG_FD}<&-
unset ARCHISO_GNUPG_FD
fi
@@ -714,6 +715,14 @@ _make_bootmode_uefi-x64.grub.esp() {
mcopy -i "${efibootimg}" "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi
fi
+ # Add other aditional/extra files to ${install_dir}/boot/
+ if [[ -e "${pacstrap_dir}/boot/memtest86+/memtest.efi" ]]; then
+ install -m 0644 -- "${pacstrap_dir}/boot/memtest86+/memtest.efi" "${isofs_dir}/${install_dir}/boot/memtest.efi"
+ install -d -m 0755 -- "${isofs_dir}/${install_dir}/boot/licenses/memtest86+/"
+ install -m 0644 -- "${pacstrap_dir}/usr/share/licenses/common/GPL2/license.txt" \
+ "${isofs_dir}/${install_dir}/boot/licenses/memtest86+/"
+ fi
+
_msg_info "Done! GRUB set up for UEFI booting successfully."
}
@@ -999,6 +1008,10 @@ _validate_requirements_bootmode_uefi-x64.grub.esp() {
if [[ ! " ${pkg_list[*]} " =~ ' edk2-shell ' ]]; then
_msg_info "'edk2-shell' is not in the package list. The ISO will not contain a bootable UEFI shell."
fi
+ # shellcheck disable=SC2076
+ if [[ ! " ${pkg_list[*]} " =~ ' memtest86+-efi ' ]]; then
+ _msg_info "Validating '${bootmode}': 'memtest86+-efi' is not in the package list. Memory testing will not be available from GRUB."
+ fi
}
_validate_requirements_bootmode_uefi-x64.grub.eltorito() {
@@ -1512,7 +1525,7 @@ _read_profile() {
# Validate set options
_validate_options() {
- local validation_error=0 _buildmode
+ local validation_error=0 _buildmode certfile
_msg_info "Validating options..."
@@ -1522,6 +1535,14 @@ _validate_options() {
_msg_error "File '${pacman_conf}' does not exist." 0
fi
+ # Check if the code signing certificate files exist
+ for certfile in "${cert_list[@]}"; do
+ if [[ ! -e "$certfile" ]]; then
+ (( validation_error=validation_error+1 ))
+ _msg_error "Code signing certificate '${certfile}' does not exist." 0
+ fi
+ done
+
# Check if the specified buildmodes are supported
for _buildmode in "${buildmodes[@]}"; do
if typeset -f "_build_buildmode_${_buildmode}" &> /dev/null; then
@@ -1604,8 +1625,10 @@ _set_overrides() {
}
_export_gpg_publickey() {
- rm -f -- "${work_dir}/pubkey.gpg"
- gpg --batch --no-armor --output "${work_dir}/pubkey.gpg" --export "${gpg_key}"
+ gpg_publickey="${work_dir}/pubkey.gpg"
+ rm -f -- "$gpg_publickey"
+ gpg --batch --no-armor --output "$gpg_publickey" --export "${gpg_key}"
+ [[ -s "$gpg_publickey" ]] || return
}
_make_version() {