Skip to content

shimarulin/archi

Repository files navigation

Archi

Just another simple and minimal Arch Linux installer

Principles

  • Use the original Arch Linux installation image
  • Use minimal but sufficient setup
  • Use the most automated installation and configuration process

Features

  • UEFI and BIOS compatible GPT disk layout and bootloader (used GRUB2): you can use the disk with the installed system in another computer with UEFI or BIOS without any changes in most use cases
  • Detect user timezone automatically
  • Btrfs subvolumes
  • Add new user with sudo for granting administrator privileges to a user
  • Login for root user is disabled by default
  • Used NetworkManager for manage connections

Installation and usage

You should boot from Arch Linux installation image, download installer binary, set executable permission, and run it:

# Download https://github.com/shimarulin/archi/releases/latest/download/archi
# with Curl
curl -L https://git.io/JGRV3 --output archi
# or Wget
wget https://git.io/JGRV3 -O archi
# Mark the file as executable
chmod +x archi
# Run
./archi

Notes for installed system

If you move the disc after installation to another computer with UEFI, do not forget to generate a new UEFI menu item (/dev/sda - your disk with installed Arch Linux):

efibootmgr -c -d /dev/sda -p 2 -L "Arch Linux" -l "\EFI\BOOT\BOOTX64.EFI"

Development

Git hooks

Run in project root to set Git hooks directory:

git config core.hooksPath .hooks

Development dependencies

To extend Cargo functionality I'm use https://github.com/killercup/cargo-edit. To compile it, you need to install the openssl development package.

For example, libssl-dev on Ubuntu:

sudo apt install libssl-dev && cargo install cargo-edit

or openssl-devel on Fedora.

Install development tools:

cargo install cargo-edit cocogitto cargo-bump

Build

error[E0554]: #![feature] may not be used on the stable release channel

From dtolnay/thiserror#192 (comment):

cargo clean

Optimizing the size of the executable file

Cargo.toml:

# Release optimization
[profile.release]
opt-level = 'z'  # Optimize for size.
lto = true
panic = 'abort'

Shell command:

cargo build --release && strip target/release/archi

Use Docker to build with musl

docker run -v $PWD:/volume -w /volume -t clux/muslrust cargo build

See more on https://github.com/clux/muslrust

How to test on Virtualbox

Setup SSH connection

  1. Add default VirtualBox Network:
    1. File > Tools > Network Manager > Host-only Networks > Create (you will get vboxnet0)
    2. Select vboxnet0 Properties > DHCP Server > Enable Server
  2. Setup VM Network: VM's Settings > Network > Adapter 2 > select Host-only Adapter (vboxnet0)
  3. Run VM and load guest OS:
    1. Setup password: passwd
    2. Start the SSH service in the guest OS is not running, start it (systemctl start sshd)
    3. Show IP on host OS: ip addr show, get IP for vboxnet0 (192.168.43.91, for example)
  4. Connect from host: ssh -o 'IdentitiesOnly=yes' [email protected]

Send file from host to guest via SSH

scp -o 'IdentitiesOnly=yes' ./archi [email protected]:/root/