Rearrange and simplify ISO setup
No files matched your search
@@ -0,0 +1,149 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Set Tokyo Night color scheme for the terminal
|
||||
set_tokyo_night_colors() {
|
||||
if [[ $(tty) == "/dev/tty"* ]]; then
|
||||
# Tokyo Night color palette
|
||||
echo -en "\e]P01a1b26" # black (background)
|
||||
echo -en "\e]P1f7768e" # red
|
||||
echo -en "\e]P29ece6a" # green
|
||||
echo -en "\e]P3e0af68" # yellow
|
||||
echo -en "\e]P47aa2f7" # blue
|
||||
echo -en "\e]P5bb9af7" # magenta
|
||||
echo -en "\e]P67dcfff" # cyan
|
||||
echo -en "\e]P7a9b1d6" # white
|
||||
echo -en "\e]P8414868" # bright black
|
||||
echo -en "\e]P9f7768e" # bright red
|
||||
echo -en "\e]PA9ece6a" # bright green
|
||||
echo -en "\e]PBe0af68" # bright yellow
|
||||
echo -en "\e]PC7aa2f7" # bright blue
|
||||
echo -en "\e]PDbb9af7" # bright magenta
|
||||
echo -en "\e]PE7dcfff" # bright cyan
|
||||
echo -en "\e]PFc0caf5" # bright white (foreground)
|
||||
|
||||
# Set default foreground and background
|
||||
echo -en "\033[0m"
|
||||
clear
|
||||
fi
|
||||
}
|
||||
|
||||
run_configurator() {
|
||||
set -euo pipefail
|
||||
|
||||
# Configurator for user information, disk selection, and wifi configuration
|
||||
NETWORK_NOT_NEEDED=true ./configurator
|
||||
|
||||
# Get username from installer config for reliable error recovery
|
||||
export OMARCHY_USER="$(jq -r '.users[0].username' user_credentials.json)"
|
||||
}
|
||||
|
||||
install_base_system() {
|
||||
set -euo pipefail
|
||||
|
||||
# Initialize and populate the keyring
|
||||
pacman-key --init
|
||||
pacman-key --populate archlinux
|
||||
|
||||
# Sync the offline database so pacman can find packages
|
||||
pacman -Sy --noconfirm
|
||||
|
||||
# Install using files generated by the ./configurator
|
||||
# Skip NTP and WKD sync since we're offline (keyring is pre-populated in ISO)
|
||||
archinstall \
|
||||
--config user_configuration.json \
|
||||
--creds user_credentials.json \
|
||||
--silent \
|
||||
--skip-ntp \
|
||||
--skip-wkd
|
||||
|
||||
# After archinstall sets up the base system but before our installer runs,
|
||||
# we need to ensure the offline pacman.conf is in place
|
||||
cp /etc/pacman.conf /mnt/etc/pacman.conf
|
||||
|
||||
# Mount the offline mirror so it's accessible in the chroot
|
||||
mkdir -p /mnt/var/cache/omarchy/mirror/offline
|
||||
mount --bind /var/cache/omarchy/mirror/offline /mnt/var/cache/omarchy/mirror/offline
|
||||
|
||||
# Mount the ruby directory so it's accessible in the chroot
|
||||
mkdir -p /mnt/var/cache/omarchy/ruby
|
||||
mount --bind /var/cache/omarchy/ruby /mnt/var/cache/omarchy/ruby
|
||||
|
||||
# No need to ask for sudo during the installation (omarchy itself responsible for removing after install)
|
||||
mkdir -p /mnt/etc/sudoers.d
|
||||
cat >/mnt/etc/sudoers.d/99-omarchy-installer <<EOF
|
||||
root ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
%wheel ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
$OMARCHY_USER ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
EOF
|
||||
chmod 440 /mnt/etc/sudoers.d/99-omarchy-installer
|
||||
|
||||
# Copy the local omarchy repo to the user's home directory
|
||||
mkdir -p /mnt/home/$OMARCHY_USER/.local/share/
|
||||
cp -r /root/omarchy /mnt/home/$OMARCHY_USER/.local/share/
|
||||
|
||||
# Copy icons to user's applications directory
|
||||
mkdir -p /mnt/home/$OMARCHY_USER/.local/share/applications/icons
|
||||
cp -r /root/.local/share/applications/icons/* /mnt/home/$OMARCHY_USER/.local/share/applications/icons/
|
||||
|
||||
# Copy the log upload utility to the installed system
|
||||
mkdir -p /mnt/usr/local/bin
|
||||
cp /usr/local/bin/omarchy-upload-install-log /mnt/usr/local/bin/
|
||||
chmod +x /mnt/usr/local/bin/omarchy-upload-install-log
|
||||
|
||||
chown -R 1000:1000 /mnt/home/$OMARCHY_USER/.local/
|
||||
# Ensure all scripts in bin directories are executable
|
||||
find /mnt/home/$OMARCHY_USER/.local/share/omarchy -type f -path "*/bin/*" -exec chmod +x {} \;
|
||||
# Ensure install.sh is executable
|
||||
chmod +x /mnt/home/$OMARCHY_USER/.local/share/omarchy/install.sh 2>/dev/null || true
|
||||
}
|
||||
|
||||
chroot_bash() {
|
||||
HOME=/home/$OMARCHY_USER \
|
||||
arch-chroot -u $OMARCHY_USER /mnt/ \
|
||||
env OMARCHY_CHROOT_INSTALL=1 \
|
||||
OMARCHY_OFFLINE_INSTALL=1 \
|
||||
OMARCHY_USER_NAME="$(<user_full_name.txt)" \
|
||||
OMARCHY_USER_EMAIL="$(<user_email_address.txt)" \
|
||||
USER="$OMARCHY_USER" \
|
||||
HOME="/home/$OMARCHY_USER" \
|
||||
/bin/bash "$@"
|
||||
}
|
||||
|
||||
if [[ $(tty) == "/dev/tty1" ]]; then
|
||||
# Set log file to pull from in trap
|
||||
export LOG_FILE="/var/log/omarchy-install.log"
|
||||
export OMARCHY_PATH="/root/omarchy"
|
||||
export OMARCHY_INSTALL="/root/omarchy/install"
|
||||
export OMARCHY_OFFLINE_INSTALL=1
|
||||
|
||||
source "$OMARCHY_INSTALL/helpers/size.sh"
|
||||
source "$OMARCHY_INSTALL/helpers/ansi-codes.sh"
|
||||
source "$OMARCHY_INSTALL/helpers/logo.sh"
|
||||
source "$OMARCHY_INSTALL/helpers/gum-styling.sh"
|
||||
source "$OMARCHY_INSTALL/helpers/tail-log-output.sh"
|
||||
source "$OMARCHY_INSTALL/preflight/trap-errors.sh"
|
||||
|
||||
set_tokyo_night_colors
|
||||
|
||||
run_configurator
|
||||
|
||||
clear_logo
|
||||
|
||||
gum style --foreground 3 --padding "1 0 0 $PADDING_LEFT" "Installing Omarchy..."
|
||||
|
||||
touch "$LOG_FILE"
|
||||
|
||||
start_log_output
|
||||
install_base_system 2>&1 | sed -u 's/\x1b\[[0-9;]*[a-zA-Z]//g' >>"$LOG_FILE"
|
||||
cleanup
|
||||
|
||||
# Get username from the config file after installation
|
||||
OMARCHY_USER="$(jq -r '.users[0].username' user_credentials.json)"
|
||||
|
||||
# Install gum early so we have it for formatting
|
||||
chroot_bash -lc "sudo pacman -S --noconfirm --needed gum" >/dev/null
|
||||
|
||||
# Run Omarchy installer directly (skip boot.sh since it would try to clone again)
|
||||
chroot_bash -lc "source /home/$OMARCHY_USER/.local/share/omarchy/install.sh || bash"
|
||||
fi
|
||||
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 196 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,3 @@
|
||||
timeout 0
|
||||
default 01-archiso-x86_64-linux.conf
|
||||
beep off
|
||||
@@ -0,0 +1,108 @@
|
||||
# Load partition table and file system modules
|
||||
insmod part_gpt
|
||||
insmod part_msdos
|
||||
insmod fat
|
||||
insmod iso9660
|
||||
insmod ntfs
|
||||
insmod ntfscomp
|
||||
insmod exfat
|
||||
insmod udf
|
||||
|
||||
# Use graphics-mode output
|
||||
if loadfont "${prefix}/fonts/unicode.pf2" ; then
|
||||
insmod all_video
|
||||
set gfxmode="auto"
|
||||
terminal_input console
|
||||
terminal_output console
|
||||
fi
|
||||
|
||||
# Enable serial console
|
||||
insmod serial
|
||||
insmod usbserial_common
|
||||
insmod usbserial_ftdi
|
||||
insmod usbserial_pl2303
|
||||
insmod usbserial_usbdebug
|
||||
if serial --unit=0 --speed=115200; then
|
||||
terminal_input --append serial
|
||||
terminal_output --append serial
|
||||
fi
|
||||
|
||||
# Get a human readable platform identifier
|
||||
if [ "${grub_platform}" == 'efi' ]; then
|
||||
archiso_platform='UEFI'
|
||||
if [ "${grub_cpu}" == 'x86_64' ]; then
|
||||
archiso_platform="x64 ${archiso_platform}"
|
||||
elif [ "${grub_cpu}" == 'i386' ]; then
|
||||
archiso_platform="IA32 ${archiso_platform}"
|
||||
else
|
||||
archiso_platform="${grub_cpu} ${archiso_platform}"
|
||||
fi
|
||||
elif [ "${grub_platform}" == 'pc' ]; then
|
||||
archiso_platform='BIOS'
|
||||
else
|
||||
archiso_platform="${grub_cpu} ${grub_platform}"
|
||||
fi
|
||||
|
||||
# Set default menu entry
|
||||
default=archlinux
|
||||
timeout=0
|
||||
timeout_style=hidden
|
||||
|
||||
|
||||
# Menu entries
|
||||
|
||||
menuentry "Arch Linux install medium (%ARCH%, ${archiso_platform})" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' {
|
||||
set gfxpayload=keep
|
||||
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID%
|
||||
initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
|
||||
}
|
||||
|
||||
menuentry "Arch Linux install medium with speakup screen reader (%ARCH%, ${archiso_platform})" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'archlinux-accessibility' {
|
||||
set gfxpayload=keep
|
||||
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID% accessibility=on
|
||||
initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
|
||||
}
|
||||
|
||||
|
||||
if [ "${grub_platform}" == 'efi' -a "${grub_cpu}" == 'x86_64' -a -f '/boot/memtest86+/memtest.efi' ]; then
|
||||
menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class memtest --class gnu --class tool {
|
||||
set gfxpayload=800x600,1024x768
|
||||
linux /boot/memtest86+/memtest.efi
|
||||
}
|
||||
fi
|
||||
if [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then
|
||||
menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class memtest --class gnu --class tool {
|
||||
set gfxpayload=800x600,1024x768
|
||||
linux /boot/memtest86+/memtest
|
||||
}
|
||||
fi
|
||||
if [ "${grub_platform}" == 'efi' ]; then
|
||||
if [ "${grub_cpu}" == 'x86_64' -a -f '/shellx64.efi' ]; then
|
||||
menuentry 'UEFI Shell' --class efi {
|
||||
chainloader /shellx64.efi
|
||||
}
|
||||
elif [ "${grub_cpu}" == "i386" -a -f '/shellia32.efi' ]; then
|
||||
menuentry 'UEFI Shell' --class efi {
|
||||
chainloader /shellia32.efi
|
||||
}
|
||||
fi
|
||||
|
||||
menuentry 'UEFI Firmware Settings' --id 'uefi-firmware' {
|
||||
fwsetup
|
||||
}
|
||||
fi
|
||||
|
||||
menuentry 'System shutdown' --class shutdown --class poweroff {
|
||||
echo 'System shutting down...'
|
||||
halt
|
||||
}
|
||||
|
||||
menuentry 'System restart' --class reboot --class restart {
|
||||
echo 'System rebooting...'
|
||||
reboot
|
||||
}
|
||||
|
||||
|
||||
# GRUB init tune for accessibility
|
||||
play 600 988 1 1319 4
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
# See the pacman.conf(5) manpage for option and repository directives
|
||||
[options]
|
||||
HoldPkg = pacman glibc
|
||||
Architecture = auto
|
||||
NoProgressBar
|
||||
ParallelDownloads = 5
|
||||
|
||||
# By default, pacman accepts packages signed by keys that its local keyring
|
||||
# trusts (see pacman-key and its man page), as well as unsigned packages.
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
[offline]
|
||||
SigLevel = Optional TrustAll
|
||||
Server = file:///var/cache/omarchy/mirror/offline/
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2034
|
||||
|
||||
iso_name="omarchy"
|
||||
iso_label="ARCH_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)"
|
||||
iso_publisher="Omarchy <https://omarchy.org>"
|
||||
iso_application="Omarchy Installer"
|
||||
iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)"
|
||||
install_dir="arch"
|
||||
buildmodes=('iso')
|
||||
bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito'
|
||||
'uefi-ia32.systemd-boot.esp' 'uefi-x64.systemd-boot.esp'
|
||||
'uefi-ia32.systemd-boot.eltorito' 'uefi-x64.systemd-boot.eltorito')
|
||||
arch="x86_64"
|
||||
pacman_conf="pacman.conf"
|
||||
airootfs_image_type="squashfs"
|
||||
airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-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"
|
||||
["/root/configurator"]="0:0:755"
|
||||
["/var/cache/omarchy/mirror/offline/"]="0:0:775"
|
||||
["/usr/bin/tte"]="0:0:755"
|
||||
["/usr/local/bin/omarchy-upload-log"]="0:0:755"
|
||||
)
|
||||