-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstaller.sh
More file actions
executable file
·72 lines (54 loc) · 1.98 KB
/
installer.sh
File metadata and controls
executable file
·72 lines (54 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -e
trap 'echo "\"${last_command}\" command failed with exit code $?."' EXIT
# Example device setup (adjust these before running)
# ROOT=/dev/nvme0n1
# BOOT=/dev/nvme0n1
# SWAP=/dev/nvme0n1
# DEV=/dev/nvme0n1
ROOTMKFS="mkfs.btrfs -f -L archroot"
BOOTMKFS="mkfs.vfat -F32"
# --- Format and prepare root Btrfs filesystem ---
$ROOTMKFS $ROOT
# Mount temporarily to create subvolumes
mount $ROOT /mnt
# Create subvolumes
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@log
btrfs subvolume create /mnt/@cache
btrfs subvolume create /mnt/@snapshots
# Unmount temporary mount
umount /mnt
# --- Mount subvolumes with recommended options ---
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@ $ROOT /mnt
mkdir -p /mnt/{boot,home,var/log,var/cache/pacman/pkg,.snapshots}
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@home $ROOT /mnt/home
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@log $ROOT /mnt/var/log
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@cache $ROOT /mnt/var/cache/pacman/pkg
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@snapshots $ROOT /mnt/.snapshots
# --- Mount EFI partition ---
$BOOTMKFS $BOOT
mount $BOOT /mnt/boot
# --- Swap setup ---
if [ -z "$SWAP" ]; then
echo "No swap"
else
mkswap $SWAP
swapon $SWAP
fi
# --- Mirrorlist & pacman setup ---
HOME=$PWD reflector --country 'Germany,France' --protocol https --latest 10 --sort rate --save /etc/pacman.d/mirrorlist
# --- Install base system ---
pacstrap /mnt - < pkglist.txt
# --- Copy post-install files ---
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
mkdir -p /mnt/postinst
cp aurpackages.txt /mnt/postinst/aurpackages.txt
cp postinstall.sh /mnt/postinst/postinstall.sh
# --- Generate fstab ---
genfstab -U /mnt > /mnt/etc/fstab
# --- Run postinstall inside chroot ---
arch-chroot /mnt /postinst/postinstall.sh $DEV
# Uncomment after testing
# reboot