Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Reset history
  • Loading branch information
picodotdev committed Oct 25, 2021
0 parents commit 1bfdc0a
Show file tree
Hide file tree
Showing 182 changed files with 12,901 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
packer_cache/
site/deploy/
site/resources/_gen/
output-archlinux-alis-virtualbox/
*.vala
*.patch
675 changes: 675 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

242 changes: 242 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
# alis

![Arch Linux](https://img.shields.io/badge/-ArchLinux-black?logo=arch-linux)
![Bash](https://img.shields.io/badge/sh-bash-black)

Arch Linux Install Script (or alis) installs unattended, automated and customized Arch Linux system.

It is a simple bash script that fully automates the installation of a Arch Linux system after booting from the original Arch Linux installation media. It contains the same commands that you would type and execute one by one interactively to complete the installation. The only user intervention needed is to edit a configuration file to choose the installation options and preferences from partitioning, to encryption, bootloader, file system, language and keyboard mapping, desktop environment, kernels, packages to install and graphic drivers. This automation makes the installation easy and fast, fast as less than 4 minutes.

If some time later after an system update for any reason the system does not boot correctly a recovery script is also provided to enter in a recovery mode that allows to downgrade packages or execute any other commands to restore the system. Also a log of the installation can be taken with <a href="https://asciinema.org/">asciinema</a>.

**Warning! This script can delete all partitions of the persistent storage. It is recommended to test it first in a virtual machine like <a href="https://www.virtualbox.org/">VirtualBox</a>.**

Currently these scripts are for me but maybe they are useful for you too.

Follow the [Arch Way](https://wiki.archlinux.org/index.php/Arch_Linux) of doing things and learn what this script does. This will allow you to know what is happening.

Please, don't ask for support for this script in Arch Linux forums, first read the [Arch Linux wiki](https://wiki.archlinux.org), the [Installation Guide](https://wiki.archlinux.org/index.php/Installation_guide) and the [General Recommendations](https://wiki.archlinux.org/index.php/General_recommendations), later compare those commands with the commands of this script.

For new features, improvements and bugs fill an issue in GitHub or make a pull request. You can test it in a virtual machine (strongly recommended) like [VirtualBox](https://www.virtualbox.org/) before run it in real hardware. If you test it in real hardware please send me an email to [email protected] with the machine description and tell me if something goes wrong or all works fine. [Pull request](https://github.com/picodotdev/alis/pulls) and [new feature request](https://github.com/picodotdev/alis/issues) are welcome!

**Arch Linux Install Script (alis) is based on Arch Linux but is NOT approved, sponsored, or affiliated with Arch Linux or its related projects.**

[![Arch Linux](https://picodotdev.github.io/alis/images/logos/archlinux.svg "Arch Linux")](https://www.archlinux.org/)

### Index

* [Principles](https://github.com/picodotdev/alis#principles)
* [Features](https://github.com/picodotdev/alis#features)
* [System installation](https://github.com/picodotdev/alis#system-installation)
* [Packages installation](https://github.com/picodotdev/alis#packages-installation)
* [Recovery](https://github.com/picodotdev/alis#recovery)
* [Video](https://github.com/picodotdev/alis#video)
* [How you can help](https://github.com/picodotdev/alis#how-you-can-help)
* [Test in VirtualBox with Packer](https://github.com/picodotdev/alis#test-in-virtualbox-with-packer)
* [Arch Linux Installation Media](https://github.com/picodotdev/alis#arch-linux-installation-media)
* [Reference](https://github.com/picodotdev/alis#reference)

### Principles

* Use the original Arch Linux installation media
* As much unattended and automated as possible, require as little interactivity as possible
* Allow to customize the installation to cover the most common cases
* Provide support for system recovery
* Provide support for installation log

### Features

* **System**: UEFI, BIOS
* **Storage**: SATA, NVMe and MMC
* **Encryption**: root partition encrypted and no encrypted
* **Partition**: no LVM, LVM, LVM on LUKS, GPT on UEFI, MBR on BIOS
* **File system**: ext4, btrfs (with subvols), xfs, f2fs, reiserfs
* **Kernels**: linux, linux-lts, linux-hardened, linux-zen
* **Desktop environment**: GNOME, KDE, XFCE, Mate, Cinnamon, LXDE, i3-wm, i3-gaps, Deepin
* **Display managers**: GDM, SDDM, Lightdm, lxdm
* **Graphics controller**: intel, nvidia and amd with optionally early KMS start. With intel optionally fastboot, hardware video acceleration and framebuffer compression.
* **Bootloader**: GRUB, rEFInd, systemd-boot
* **Custom shell**: bash, zsh, dash, fish
* **WPA WIFI network** installation
* **Periodic TRIM** for SSD storage
* Intel and AMD **processors microcode**
* Optional **swap file**
* **VirtualBox guest additions**
* **Kernel compression** and **custom parameters**
* **Users creation** and **add to sudoers**
* **systemd units enable or disable**
* **Multilib** support
* **Arch Linux** common and custom **packages installation**
* Flatpak utility installation and **Flatpak packages installation**
* SDKMAN utility installation and **SDKMAN packages installation**
* **AUR utility** installation (paru, yay, aurman) and **AUR packages installation**
* **Packages installation after base system installation** (preferred way of packages installation)
* Script for download installation and **recovery scripts** and configuration files
* **Retry packages download** on connection/mirror error
* **Packer support** for testing in VirtualBox
* **Installation log** with all commands executed and output in a file and/or **asciinema video**
* Wait after installation for an **abortable reboot**
* **Use your own configuration**

### System installation

Download and boot from the latest <a href="https://www.archlinux.org/download/">original Arch Linux installation media</a>. After boot use the following commands to start the installation.

Follow the <a href="https://wiki.archlinux.org/index.php/Arch_Linux">Arch Way</a> of doing things and learn what this script does. This will allow you to know what is happening.

Internet connection is required, with wireless WIFI connection see <a href="https://wiki.archlinux.org/index.php/Wireless_network_configuration#Wi-Fi_Protected_Access">Wireless_network_configuration</a> to bring up WIFI connection before start the installation.

Minimum usage

```
# # Start the system with latest Arch Linux installation media
# loadkeys [keymap] # Load keyboard keymap, eg. loadkeys es, loadkeys us, loadkeys de
# curl -sL https://raw.githubusercontent.com/picodotdev/alis/master/download.sh | bash # Download alis scripts
# vim alis.conf # Edit configuration and change variables values with your preferences (system configuration)
# ./alis.sh # Start installation
```

Advanced usage

```
# # Start the system with latest Arch Linux installation media
# loadkeys [keymap] # Load keyboard keymap, eg. loadkeys es, loadkeys us, loadkeys de
# iwctl --passphrase "[WIFI_KEY]" station [WIFI_INTERFACE] connect "[WIFI_ESSID]" # (Optional) Connect to WIFI network. _ip link show_ to know WIFI_INTERFACE.
# curl -sL https://raw.githubusercontent.com/picodotdev/alis/master/download.sh | bash # Download alis scripts
# # curl -sL https://bit.ly/2F3CATp | bash # Alternative download URL with URL shortener
# ./alis-asciinema.sh # (Optional) Start asciinema video recording
# vim alis.conf # Edit configuration and change variables values with your preferences (system configuration)
# vim alis-packages.conf # (Optional) Edit configuration and change variables values with your preferences (packages to install)
# # (The preferred way to install packages is after system installation, see Packages installation)
# ./alis.sh # Start installation
# ./alis-reboot.sh # (Optional) Reboot the system, only necessary when REBOOT="false"
```

### Packages installation

After the base Arch Linux system is installed, alis can install packages with pacman, Flatpak, SDKMAN and from AUR.

```
# # After system installation start a user session
# curl -sL https://raw.githubusercontent.com/picodotdev/alis/master/download.sh | bash # Download alis scripts
# # curl -sL https://bit.ly/2F3CATp | bash # Alternative download URL with URL shortener
# ./alis-packages-asciinema.sh # (Optional) Start asciinema video recording
# vim alis-packages.conf # Edit configuration and change variables values with your preferences (packages to install)
# ./alis-packages.sh # Start packages installation
```

### Recovery

Boot from the latest <a href="https://www.archlinux.org/download/">original Arch Linux installation media</a>. After boot use the following commands to start the recovery, this will allow you to enter in the arch-chroot environment.

```
# # Start the system with latest Arch Linux installation media
# loadkeys [keymap] # Load keyboard keymap, eg. loadkeys es, loadkeys us, loadkeys de
# iwctl --passphrase "[WIFI_KEY]" station [WIFI_INTERFACE] connect "[WIFI_ESSID]" # (Optional) Connect to WIFI network. _ip link show_ to know WIFI_INTERFACE.
# curl -sL https://raw.githubusercontent.com/picodotdev/alis/master/download.sh | bash # Download alis scripts
# # curl -sL https://bit.ly/2F3CATp | bash # Alternative download URL with URL shortener
# ./alis-recovery-asciinema.sh # (Optional) Start asciinema video recording
# vim alis-recovery.conf # Edit configuration and change variables values with your last installation configuration with alis (mainly device and partition scheme)
# ./alis-recovery.sh # Start recovery
# ./alis-recovery-reboot.sh # Reboot the system
```

### Video

Arch Linux base installation installed in **less than 4 minutes** with a fiber internet connection. Don't trust me? See the video.

[![asciicast](https://asciinema.org/a/444025.png)](https://asciinema.org/a/444025)

### How you can help

* Test in VirtualBox and create an issue if something does not work, attach the main parts of the used configuration file and the error message
* Create issues with new features
* Send pull requests
* Share it in social networks, forums, create a blog post or video about it
* Send me an email, I like to read that the script is being used and is useful :). Which are your computer specs, which is your alis configuration, if is your personal or working computer, if all worked fine or some suggestion to improve the script

### Test in VirtualBox with Packer

VirtualBox and [Packer](https://packer.io/) are required.

* Firmware: efi, bios
* File system: ext4, btrfs, f2fs, xfs
* Partition: luks, lvm
* Bootloader: grub, refind, systemd
* Desktop environment: gnome, kde, xfce, ...

```
$ ./alis-packer.sh -c alis-packer-efi-ext4-systemd.sh
$ ./alis-packer.sh -c alis-packer-efi-ext4-systemd-gnome.sh
$ ./alis-packer.sh -c alis-packer-efi-ext4-luks-lvm-grub.sh
$ ./alis-packer.sh -c alis-packer-efi-btrfs-luks-lvm-systemd.sh
$ ./alis-packer.sh -c alis-packer-efi-f2fs-luks-lvm-systemd.sh
$ ./alis-packer.sh -c alis-packer-efi-ext4-grub-gnome.sh
$ ./alis-packer.sh -c alis-packer-efi-ext4-grub-kde.sh
$ ./alis-packer.sh -c alis-packer-efi-ext4-grub-xfce.sh
```

### Arch Linux Installation Media

https://www.archlinux.org/download/

### Reference

* https://wiki.archlinux.org/index.php/Installation_guide
* https://wiki.archlinux.org/index.php/Main_page
* https://wiki.archlinux.org/index.php/General_recommendations
* https://wiki.archlinux.org/index.php/List_of_applications
* https://wiki.archlinux.org/index.php/Intel_NUC
* https://wiki.archlinux.org/index.php/Network_configuration
* https://wiki.archlinux.org/index.php/Wireless_network_configuration
* https://wiki.archlinux.org/index.php/Wireless_network_configuration#Connect_to_an_access_point
* https://wiki.archlinux.org/index.php/NetworkManager
* https://wiki.archlinux.org/index.php/Solid_State_Drives
* https://wiki.archlinux.org/index.php/Solid_state_drive/NVMe
* https://wiki.archlinux.org/index.php/Partitioning
* https://wiki.archlinux.org/index.php/Fstab
* https://wiki.archlinux.org/index.php/Swap
* https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface
* https://wiki.archlinux.org/index.php/EFI_System_Partition
* https://wiki.archlinux.org/index.php/File_systems
* https://wiki.archlinux.org/index.php/Ext4
* https://wiki.archlinux.org/index.php/Btrfs
* https://wiki.archlinux.org/index.php/XFS
* https://wiki.archlinux.org/index.php/F2FS
* https://wiki.archlinux.org/index.php/Persistent_block_device_naming
* https://wiki.archlinux.org/index.php/LVM
* https://wiki.archlinux.org/index.php/Dm-crypt
* https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption
* https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system
* https://wiki.archlinux.org/index.php/Pacman
* https://wiki.archlinux.org/index.php/Arch_User_Repository
* https://wiki.archlinux.org/index.php/Mirrors
* https://wiki.archlinux.org/index.php/Reflector
* https://wiki.archlinux.org/index.php/VirtualBox
* https://wiki.archlinux.org/index.php/Mkinitcpio
* https://wiki.archlinux.org/index.php/Intel_graphics
* https://wiki.archlinux.org/index.php/AMDGPU
* https://wiki.archlinux.org/index.php/ATI
* https://wiki.archlinux.org/index.php/NVIDIA
* https://wiki.archlinux.org/index.php/Nouveau
* https://wiki.archlinux.org/index.php/Kernels
* https://wiki.archlinux.org/index.php/Kernel_mode_setting
* https://wiki.archlinux.org/index.php/Kernel_parameters
* https://wiki.archlinux.org/index.php/Category:Boot_loaders
* https://wiki.archlinux.org/index.php/GRUB
* https://wiki.archlinux.org/index.php/REFInd
* https://wiki.archlinux.org/index.php/Systemd-boot
* https://wiki.archlinux.org/index.php/Systemd
* https://wiki.archlinux.org/index.php/Microcode
* https://wiki.archlinux.org/index.php/Command-line_shell
* https://wiki.archlinux.org/index.php/Wayland
* https://wiki.archlinux.org/index.php/Xorg
* https://wiki.archlinux.org/index.php/Desktop_environment
* https://wiki.archlinux.org/index.php/GNOME
* https://wiki.archlinux.org/index.php/KDE
* https://wiki.archlinux.org/index.php/Xfce
* https://wiki.archlinux.org/index.php/I3
* https://wiki.archlinux.org/title/Deepin_Desktop_Environment
* http://tldp.org/LDP/Bash-Beginners-Guide/html/
* http://tldp.org/LDP/abs/html/

20 changes: 20 additions & 0 deletions alis-asciinema.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e

# Arch Linux Install Script (alis) installs unattended, automated
# and customized Arch Linux system.
# Copyright (C) 2021 picodotdev

#curl -L -o asciinema-2.0.2.zip https://github.com/asciinema/asciinema/archive/v2.0.2.zip
#bsdtar xvf asciinema-2.0.2.zip
#rm -f alis.asciinema
#(cd asciinema-2.0.2 && python3 -m asciinema rec --stdin -i 5 ~/alis.asciinema)

rm -f alis.asciinema

pacman -Sy
pacman -S --noconfirm asciinema

clear
asciinema rec --stdin -i 5 ~/alis.asciinema

19 changes: 19 additions & 0 deletions alis-packages-asciinema.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e

# Arch Linux Install Script (alis) installs unattended, automated
# and customized Arch Linux system.
# Copyright (C) 2021 picodotdev

#curl -L -o asciinema-2.0.2.zip https://github.com/asciinema/asciinema/archive/v2.0.2.zip
#bsdtar xvf asciinema-2.0.2.zip
#rm -f alis.asciinema
#(cd asciinema-2.0.2 && python3 -m asciinema rec --stdin -i 5 ~/alis.asciinema)

rm -f alis-packages.asciinema

#pacman -S --noconfirm asciinema

clear
asciinema rec --stdin -i 5 ~/alis-packages.asciinema

23 changes: 23 additions & 0 deletions alis-packages-exit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e

# Arch Linux Install Script (alis) installs unattended, automated
# and customized Arch Linux system.
# Copyright (C) 2021 picodotdev

LOG_FILE="alis-packages.log"
ASCIINEMA_FILE="alis-packages.asciinema"

function copy_logs() {
if [ -f "$LOG_FILE" ]; then
sudo mkdir -p /var/log/alis
sudo cp "$LOG_FILE" "/var/log/alis/$LOG_FILE"
fi
if [ -f "$ASCIINEMA_FILE" ]; then
sudo mkdir -p /var/log/alis
sudo cp "$ASCIINEMA_FILE" "/var/log/alis/$ASCIINEMA_FILE"
fi
}

copy_logs

Loading

0 comments on commit 1bfdc0a

Please sign in to comment.