mirror of
https://github.com/eoli3n/archiso-zfs.git
synced 2025-12-06 07:02:00 +01:00
55 lines
1.2 KiB
Plaintext
55 lines
1.2 KiB
Plaintext
|
|
#!/bin/bash
|
||
|
|
# This script load zfs kernel module for any archiso.
|
||
|
|
# github.com/eoli3n
|
||
|
|
|
||
|
|
set -e
|
||
|
|
|
||
|
|
print () {
|
||
|
|
echo -e "\n\033[1m> $1\033[0m\n"
|
||
|
|
}
|
||
|
|
|
||
|
|
print "Test if archiso is running"
|
||
|
|
|
||
|
|
grep archiso /proc/cmdline
|
||
|
|
|
||
|
|
print "Set mirrorlist to current archiso date"
|
||
|
|
|
||
|
|
iso_date=$(date +%Y/%m/%d -d "$(LANG=C pacman -Qi linux |sed -n 's/^Install Date\s*: //p')")
|
||
|
|
echo "Server=https://archive.archlinux.org/repos/$iso_date/$repo/os/$arch" > /etc/pacman.d/mirrorlist
|
||
|
|
|
||
|
|
print "Add archzfs repo"
|
||
|
|
|
||
|
|
cat >> /etc/pacman.conf <<"EOF"
|
||
|
|
[archzfs]
|
||
|
|
Server = http://archzfs.com/archzfs/x86_64
|
||
|
|
Server = http://mirror.sum7.eu/archlinux/archzfs/archzfs/x86_64
|
||
|
|
Server = https://mirror.biocrafting.net/archlinux/archzfs/archzfs/x86_64
|
||
|
|
EOF
|
||
|
|
|
||
|
|
print "Sign archzfs"
|
||
|
|
|
||
|
|
pacman-key --recv-keys F75D9D76
|
||
|
|
pacman-key --lsign-key F75D9D76
|
||
|
|
|
||
|
|
print "Update lists and upgrade"
|
||
|
|
|
||
|
|
pacman -Syu --no-confirm
|
||
|
|
|
||
|
|
print "Increase cowspace to half of RAM"
|
||
|
|
|
||
|
|
ram=$(free | grep 'Mem' | awk '{print $2}')
|
||
|
|
ram_half=$(echo "$ram / 2" | bc)
|
||
|
|
mount -o remount,size=$ram_half /run/archiso/cowspace
|
||
|
|
|
||
|
|
print "Install current kernel headers"
|
||
|
|
|
||
|
|
pacman -S --no-confirm linux-headers
|
||
|
|
|
||
|
|
print "Install zfs-dkms"
|
||
|
|
|
||
|
|
pacman -S --no-confirm zfs-dkms
|
||
|
|
|
||
|
|
print "Load zfs kernel module"
|
||
|
|
|
||
|
|
modprobe zfs
|