~jacksonchen666/arch-linux-ultra-install-speedrun

b13367b074dd7008f1ac0ff51e13ab2acbf76abc — Jackson Chen 2 years ago 6aa40ed
Upload everything of the thing
A airootfs/etc/mkinitcpio.conf => airootfs/etc/mkinitcpio.conf +70 -0
@@ 0,0 1,70 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev archiso block filesystems)

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
COMPRESSION="zstd"

# COMPRESSION_OPTIONS
# Additional options for the compressor
COMPRESSION_OPTIONS=('-16')

A airootfs/etc/mkinitcpio.d/linux.preset => airootfs/etc/mkinitcpio.d/linux.preset +11 -0
@@ 0,0 1,11 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

# mkinitcpio preset file for the 'linux' package on archiso

PRESETS=('archiso')

ALL_kver='/boot/vmlinuz-linux'
ALL_config='/etc/mkinitcpio.conf'

archiso_image="/boot/initramfs-linux.img"

A airootfs/etc/motd => airootfs/etc/motd +5 -0
@@ 0,0 1,5 @@
Speedrun ISO made by JacksonChen666 on https:///JacksonChen666.com
don't try to steal my video lol (yes you can steal the ISO)

This ISO is not designed for general use after install.
Below should be the startup time, if it's the installed system.

A airootfs/etc/pacman.conf => airootfs/etc/pacman.conf +107 -0
@@ 0,0 1,107 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# SPDX-License-Identifier: GPL-3.0-or-later

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
CacheDir    = /root/.packages
#LogFile     = /var/log/pacman.log
#GPGDir      = /etc/pacman.d/gnupg/
#HookDir     = /etc/pacman.d/hooks/
HoldPkg     = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
Color
TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
ILoveCandy

# 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
#RemoteFileSigLevel = Required

# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.

#
# REPOSITORIES
#   - can be defined here or included from another file
#   - pacman will search repositories in the order defined here
#   - local/custom mirrors can be added here or in separate files
#   - repositories listed first will take precedence when packages
#     have identical names, regardless of version number
#   - URLs will have $repo replaced by the name of the current repo
#   - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
#       [repo-name]
#       Server = ServerName
#       Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#

# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.

#[testing]
#Include = /etc/pacman.d/mirrorlist

[offline]
SigLevel = Never
Server = file:///root/.packages

#[core]
#Include = /etc/pacman.d/mirrorlist

#[extra]
#Include = /etc/pacman.d/mirrorlist

#[community-testing]
#Include = /etc/pacman.d/mirrorlist

#[community]
#Include = /etc/pacman.d/mirrorlist

# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.

#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist

#[multilib]
#Include = /etc/pacman.d/mirrorlist

# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

A airootfs/etc/shadow => airootfs/etc/shadow +1 -0
@@ 0,0 1,1 @@
root::14871::::::

A airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf => airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf +6 -0
@@ 0,0 1,6 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux

A airootfs/root/automated_install.sh => airootfs/root/automated_install.sh +41 -0
@@ 0,0 1,41 @@
#/bin/bash
# Stop at any error
set -e
# Check for EFI support
ls /sys/firmware/efi/efivars > /dev/null
# Initial setup
timedatectl set-ntp true &
# Disks
# below is arg parser at https://stackoverflow.com/a/13359121
devDisk=/dev/sda # or in /proc/cmdline
for i in `cat /proc/cmdline`; do
    case $i in
        devDisk=*)
        devDisk="${i#*=}"
        ;;
        *)
                # unknown option
        ;;
    esac
done
echo -e """
label: gpt
size=512M type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B name=boot
type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 name=root
""" | sfdisk $devDisk -q
mkfs.fat ${devDisk}1 > /dev/null
mkfs.ext4 ${devDisk}2 -E nodiscard,lazy_itable_init=1,lazy_journal_init=1 -F -q
mount -o defaults,lazytime,nobarrier,commit=300 ${devDisk}2 /mnt > /dev/null
mkdir /mnt/boot
mount ${devDisk}1 /mnt/boot > /dev/null
# Configuration stuff
cp -ra ~/.new_system/* /mnt/
genfstab -U /mnt >> /mnt/etc/fstab
# Install stuff
pacstrap /mnt base linux > /dev/null
echo "bootctl install" | arch-chroot /mnt
# Finalize
sync;sync;sync
umount -R /mnt
# Reboot
reboot

A efiboot/loader/entries/archiso-x86_64-linux.conf => efiboot/loader/entries/archiso-x86_64-linux.conf +7 -0
@@ 0,0 1,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

title   Arch Linux (x86_64, UEFI)
linux   /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
initrd  /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% quiet loglevel=2 devDisk=/dev/sda

A efiboot/loader/loader.conf => efiboot/loader/loader.conf +5 -0
@@ 0,0 1,5 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

timeout 0
default archiso-x86_64-linux.conf

A packages.x86_64 => packages.x86_64 +9 -0
@@ 0,0 1,9 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
arch-install-scripts
base
dosfstools
linux
mkinitcpio
mkinitcpio-archiso
syslinux

A pacman.conf => pacman.conf +103 -0
@@ 0,0 1,103 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# SPDX-License-Identifier: GPL-3.0-or-later

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log
#GPGDir      = /etc/pacman.d/gnupg/
#HookDir     = /etc/pacman.d/hooks/
HoldPkg     = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
Color
TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
ILoveCandy

# 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
#RemoteFileSigLevel = Required

# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.

#
# REPOSITORIES
#   - can be defined here or included from another file
#   - pacman will search repositories in the order defined here
#   - local/custom mirrors can be added here or in separate files
#   - repositories listed first will take precedence when packages
#     have identical names, regardless of version number
#   - URLs will have $repo replaced by the name of the current repo
#   - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
#       [repo-name]
#       Server = ServerName
#       Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#

# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.

#[testing]
#Include = /etc/pacman.d/mirrorlist

[core]
Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

#[community-testing]
#Include = /etc/pacman.d/mirrorlist

[community]
Include = /etc/pacman.d/mirrorlist

# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.

#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist

#[multilib]
#Include = /etc/pacman.d/mirrorlist

# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

A profiledef.sh => profiledef.sh +30 -0
@@ 0,0 1,30 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034

compress=true

iso_name="archlinux-ultra-speedrun"
iso_version="1.0.0"
iso_label="ARCH_$iso_version"
iso_publisher="JacksonChen666 <https://JacksonChen666.com>"
iso_application="Arch Linux Speedrun"
install_dir="arch"
bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' 'uefi-x64.systemd-boot.esp' 'uefi-x64.systemd-boot.eltorito')
arch="x86_64"
pacman_conf="pacman.conf"
airootfs_image_type="squashfs"
if $compress; then
	#airootfs_image_tool_options=('-comp' 'gzip' '-Xcompression-level' '9') # gzip
	#airootfs_image_tool_options=('-comp' 'lzma') # lzma
	#airootfs_image_tool_options=('-comp' 'lzo' '-Xcompression-level' '9') # lzo
	#airootfs_image_tool_options=('-comp' 'lz4' '-Xhc') # lz4
	#airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M') # xz - Default by ArchISOs
	airootfs_image_tool_options=('-comp' 'zstd' '-Xcompression-level' '1') # zstd compression
else
	airootfs_image_tool_options=('-noI' '-noId' '-noD' '-noF' '-noX')
fi
file_permissions=(
  ["/etc/shadow"]="0:0:400"
  ["/root"]="0:0:750"
  ["/root/automated_install.sh"]="0:0:755"
)

A syslinux/syslinux-linux.cfg => syslinux/syslinux-linux.cfg +8 -0
@@ 0,0 1,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

LABEL arch64
MENU LABEL Arch Linux (x86_64, BIOS)
LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux
INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
APPEND this_wont_work_lol archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% quiet loglevel=2 devDisk=/dev/sda

A syslinux/syslinux.cfg => syslinux/syslinux.cfg +11 -0
@@ 0,0 1,11 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

UI menu.c32
MENU TITLE Arch Linux
MENU CLEAR

DEFAULT arch64
TIMEOUT 0

INCLUDE syslinux-linux.cfg