diff --git a/iso/airootfs/etc/systemd/system/graphical.target.wants/display-manager.service b/iso/airootfs/etc/systemd/system/graphical.target.wants/display-manager.service new file mode 120000 index 0000000..1c2de7a --- /dev/null +++ b/iso/airootfs/etc/systemd/system/graphical.target.wants/display-manager.service @@ -0,0 +1 @@ +../display-manager.service \ No newline at end of file diff --git a/iso/airootfs/etc/systemd/system/graphical.target.wants/pacman-init.service b/iso/airootfs/etc/systemd/system/graphical.target.wants/pacman-init.service new file mode 120000 index 0000000..d09eec6 --- /dev/null +++ b/iso/airootfs/etc/systemd/system/graphical.target.wants/pacman-init.service @@ -0,0 +1 @@ +../pacman-init.service \ No newline at end of file diff --git a/iso/airootfs/etc/systemd/system/pacman-init.service b/iso/airootfs/etc/systemd/system/pacman-init.service index b824884..576580e 100644 --- a/iso/airootfs/etc/systemd/system/pacman-init.service +++ b/iso/airootfs/etc/systemd/system/pacman-init.service @@ -9,7 +9,7 @@ Before=archlinux-keyring-wkd-sync.service Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/pacman-key --init -ExecStart=/usr/bin/pacman-key --populate +ExecStart=/usr/bin/pacman-key --populate archlinux archimedeos chaotic [Install] -WantedBy=multi-user.target +WantedBy=multi-user.target graphical.target diff --git a/iso/mkarchiso b/iso/mkarchiso new file mode 100755 index 0000000..853d595 --- /dev/null +++ b/iso/mkarchiso @@ -0,0 +1,2178 @@ +#!/usr/bin/env bash +# +# mkarchiso - ArchimedeOS Edition +# Based on archiso's mkarchiso with ArchimedeOS-specific modifications +# Original archiso project: https://gitlab.archlinux.org/archlinux/archiso +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# Modifications for ArchimedeOS: +# - Added run_before_squashfs.sh support for custom pre-squashfs scripts +# - Adapted version handling for ArchimedeOS +# - Customized for ArchimedeOS ISO building workflow + +set -e -u +shopt -s extglob + +# Control the environment +umask 0022 +export LC_ALL="C.UTF-8" +[[ -v SOURCE_DATE_EPOCH ]] || printf -v SOURCE_DATE_EPOCH '%(%s)T' -1 +export SOURCE_DATE_EPOCH + +# Set application name from the script's file name +app_name="${0##*/}" + +# Define global variables. All of them will be overwritten later +pkg_list=() +bootstrap_pkg_list=() +quiet="" +work_dir="" +out_dir="" +gpg_key="" +gpg_sender="" +iso_name="" +iso_label="" +iso_uuid="" +iso_publisher="" +iso_application="" +iso_version="" +install_dir="" +arch="" +pacman_conf="" +packages="" +bootstrap_packages="" +bootstrap_parent="" +pacstrap_dir="" +search_filename="" +declare -i rm_work_dir=0 +buildmodes=() +bootmodes=() +airootfs_image_type="" +airootfs_image_tool_options=() +bootstrap_tarball_compression="" +cert_list=() +declare -A file_permissions=() +efibootimg="" +efiboot_files=() +# adapted from GRUB_EARLY_INITRD_LINUX_STOCK in https://git.savannah.gnu.org/cgit/grub.git/tree/util/grub-mkconfig.in +readonly ucodes=('intel-uc.img' 'intel-ucode.img' 'amd-uc.img' 'amd-ucode.img' 'early_ucode.cpio' 'microcode.cpio') +declare -i need_external_ucodes=0 + +# ArchimedeOS modification: Custom pre-squashfs script support +# This allows running custom scripts before creating the squashfs filesystem +# Used for GPG key initialization, user setup, and other ArchimedeOS-specific tasks + +script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && pwd )" +RUN_BEFORE_SQUASHFS="$script_path/run_before_squashfs.sh" + +# End ArchimedeOS modification + +# Show an INFO message +# $1: message string +_msg_info() { + local _msg="${1}" + [[ "${quiet}" == "y" ]] || printf '[%s] INFO: %s\n' "${app_name}" "${_msg}" +} + +# Show a WARNING message +# $1: message string +_msg_warning() { + local _msg="${1}" + printf '[%s] WARNING: %s\n' "${app_name}" "${_msg}" >&2 +} + +# Show an ERROR message then exit with status +# $1: message string +# $2: exit code number (with 0 does not exit) +_msg_error() { + local _msg="${1}" + local _error=${2} + printf '[%s] ERROR: %s\n' "${app_name}" "${_msg}" >&2 + if (( _error > 0 )); then + exit "${_error}" + fi +} + +# Show help usage, with an exit status. +# $1: exit status number. +_usage() { + IFS='' read -r -d '' usagetext < + options: + -A Set an application name for the ISO + Default: '${iso_application}' + -C pacman configuration file. + Default: '${pacman_conf}' + -D Set an install_dir. All files will be located here. + Default: '${install_dir}' + NOTE: Max 8 characters, use only [a-z0-9] + -L