mirror of
https://github.com/eoli3n/archiso-zfs.git
synced 2026-03-10 22:13:49 +01:00
56 lines
1.2 KiB
Bash
Executable file
56 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
# This script load zfs kernel module for any archiso.
|
|
# github.com/eoli3n
|
|
# Thanks to CalimeroTeknik on #archlinux-fr
|
|
|
|
set -e
|
|
|
|
print () {
|
|
echo -e "\n\033[1m> $1\033[0m\n"
|
|
}
|
|
|
|
print "Testing if archiso is running"
|
|
|
|
grep archiso /proc/cmdline
|
|
|
|
print "Setting 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 "Adding 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 "Fetching archzfs signing keys"
|
|
|
|
pacman-key --recv-keys F75D9D76
|
|
pacman-key --lsign-key F75D9D76
|
|
|
|
print "Updating pacman lists and upgrade"
|
|
|
|
pacman -Syyu --noconfirm
|
|
|
|
print "Increasing cowspace to half of RAM"
|
|
|
|
mount -o remount,size=50% /run/archiso/cowspace
|
|
|
|
print "Installing current kernel headers"
|
|
|
|
pacman -S --noconfirm linux-headers
|
|
|
|
print "Installing zfs-dkms"
|
|
|
|
pacman -S --noconfirm zfs-dkms
|
|
|
|
print "Loading zfs kernel module"
|
|
|
|
modprobe zfs
|
|
|
|
print "ZFS module is working"
|