From b13367b074dd7008f1ac0ff51e13ab2acbf76abc Mon Sep 17 00:00:00 2001 From: Jackson Chen Date: Tue, 1 Jun 2021 20:43:39 +0200 Subject: [PATCH] Upload everything of the thing --- airootfs/etc/mkinitcpio.conf | 70 ++++++++++++ airootfs/etc/mkinitcpio.d/linux.preset | 11 ++ airootfs/etc/motd | 5 + airootfs/etc/pacman.conf | 107 ++++++++++++++++++ airootfs/etc/shadow | 1 + .../getty@tty1.service.d/autologin.conf | 6 + airootfs/root/automated_install.sh | 41 +++++++ .../loader/entries/archiso-x86_64-linux.conf | 7 ++ efiboot/loader/loader.conf | 5 + packages.x86_64 | 9 ++ pacman.conf | 103 +++++++++++++++++ profiledef.sh | 30 +++++ syslinux/syslinux-linux.cfg | 8 ++ syslinux/syslinux.cfg | 11 ++ 14 files changed, 414 insertions(+) create mode 100644 airootfs/etc/mkinitcpio.conf create mode 100644 airootfs/etc/mkinitcpio.d/linux.preset create mode 100644 airootfs/etc/motd create mode 100644 airootfs/etc/pacman.conf create mode 100644 airootfs/etc/shadow create mode 100644 airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf create mode 100644 airootfs/root/automated_install.sh create mode 100644 efiboot/loader/entries/archiso-x86_64-linux.conf create mode 100644 efiboot/loader/loader.conf create mode 100644 packages.x86_64 create mode 100644 pacman.conf create mode 100644 profiledef.sh create mode 100644 syslinux/syslinux-linux.cfg create mode 100644 syslinux/syslinux.cfg diff --git a/airootfs/etc/mkinitcpio.conf b/airootfs/etc/mkinitcpio.conf new file mode 100644 index 0000000..552b830 --- /dev/null +++ b/airootfs/etc/mkinitcpio.conf @@ -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 ' 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') diff --git a/airootfs/etc/mkinitcpio.d/linux.preset b/airootfs/etc/mkinitcpio.d/linux.preset new file mode 100644 index 0000000..d35f137 --- /dev/null +++ b/airootfs/etc/mkinitcpio.d/linux.preset @@ -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" diff --git a/airootfs/etc/motd b/airootfs/etc/motd new file mode 100644 index 0000000..7cee041 --- /dev/null +++ b/airootfs/etc/motd @@ -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. diff --git a/airootfs/etc/pacman.conf b/airootfs/etc/pacman.conf new file mode 100644 index 0000000..aa0c5e6 --- /dev/null +++ b/airootfs/etc/pacman.conf @@ -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 diff --git a/airootfs/etc/shadow b/airootfs/etc/shadow new file mode 100644 index 0000000..7edfd69 --- /dev/null +++ b/airootfs/etc/shadow @@ -0,0 +1 @@ +root::14871:::::: diff --git a/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf b/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf new file mode 100644 index 0000000..370735f --- /dev/null +++ b/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf @@ -0,0 +1,6 @@ +# +# SPDX-License-Identifier: GPL-3.0-or-later + +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux diff --git a/airootfs/root/automated_install.sh b/airootfs/root/automated_install.sh new file mode 100644 index 0000000..3b23601 --- /dev/null +++ b/airootfs/root/automated_install.sh @@ -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 diff --git a/efiboot/loader/entries/archiso-x86_64-linux.conf b/efiboot/loader/entries/archiso-x86_64-linux.conf new file mode 100644 index 0000000..4845069 --- /dev/null +++ b/efiboot/loader/entries/archiso-x86_64-linux.conf @@ -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 diff --git a/efiboot/loader/loader.conf b/efiboot/loader/loader.conf new file mode 100644 index 0000000..b2a31c2 --- /dev/null +++ b/efiboot/loader/loader.conf @@ -0,0 +1,5 @@ +# +# SPDX-License-Identifier: GPL-3.0-or-later + +timeout 0 +default archiso-x86_64-linux.conf diff --git a/packages.x86_64 b/packages.x86_64 new file mode 100644 index 0000000..8fd9390 --- /dev/null +++ b/packages.x86_64 @@ -0,0 +1,9 @@ +# +# SPDX-License-Identifier: GPL-3.0-or-later +arch-install-scripts +base +dosfstools +linux +mkinitcpio +mkinitcpio-archiso +syslinux diff --git a/pacman.conf b/pacman.conf new file mode 100644 index 0000000..1ab6534 --- /dev/null +++ b/pacman.conf @@ -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 diff --git a/profiledef.sh b/profiledef.sh new file mode 100644 index 0000000..e350304 --- /dev/null +++ b/profiledef.sh @@ -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 " +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" +) diff --git a/syslinux/syslinux-linux.cfg b/syslinux/syslinux-linux.cfg new file mode 100644 index 0000000..c2c2481 --- /dev/null +++ b/syslinux/syslinux-linux.cfg @@ -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 diff --git a/syslinux/syslinux.cfg b/syslinux/syslinux.cfg new file mode 100644 index 0000000..c89d464 --- /dev/null +++ b/syslinux/syslinux.cfg @@ -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 -- 2.45.2