Merge branch 'master' of github.com:eoli3n/archiso-zfs

This commit is contained in:
eoli3n 2021-06-12 13:26:14 +02:00
commit bef3bca893
2 changed files with 20 additions and 8 deletions

View file

@ -24,6 +24,13 @@ Boot on any archiso system, and run:
curl -s https://eoli3n.github.io/archzfs/init | bash curl -s https://eoli3n.github.io/archzfs/init | bash
``` ```
### Debug
To run the script in verbose mode, use:
```
curl -s https://eoli3n.github.io/archzfs/init | sed 's- &>/dev/null--' | bash &> debug.log
```
### Related ### Related
- [Archzfs issue : Dynamically build/load ZFS module on default archiso #337](https://github.com/archzfs/archzfs/issues/337) - [Archzfs issue : Dynamically build/load ZFS module on default archiso #337](https://github.com/archzfs/archzfs/issues/337)

21
init
View file

@ -15,7 +15,7 @@ get_running_kernel_version () {
# Returns running kernel version # Returns running kernel version
# Get running kernel version # Get running kernel version
kernel_version=$(LANG=C pacman -Qi linux | sed -n 's/^Version\s*: //p') kernel_version=$(uname -r)
print "Current kernel version is $kernel_version" print "Current kernel version is $kernel_version"
} }
@ -28,12 +28,15 @@ get_iso_build_date () {
} }
init_archzfs () { init_archzfs () {
if pacman -Sl archzfs >/dev/null 2>&1; then
print "archzfs repo was already added"
return
fi
print "Adding archzfs repo" print "Adding archzfs repo"
pacman -Sy archlinux-keyring --noconfirm &>/dev/null pacman -Sy archlinux-keyring --noconfirm &>/dev/null
pacman-key --populate archlinux &>/dev/null pacman-key --populate archlinux &>/dev/null
pacman-key --recv-keys F75D9D76 --keyserver hkp://pool.sks-keyservers.net:80 &>/dev/null pacman-key --recv-keys F75D9D76 --keyserver keyserver.ubuntu.com &>/dev/null
pacman-key --lsign-key F75D9D76 &>/dev/null pacman-key --lsign-key F75D9D76 &>/dev/null
cat >> /etc/pacman.conf <<"EOF" cat >> /etc/pacman.conf <<"EOF"
[archzfs] [archzfs]
@ -41,7 +44,7 @@ Server = http://archzfs.com/archzfs/x86_64
Server = http://mirror.sum7.eu/archlinux/archzfs/archzfs/x86_64 Server = http://mirror.sum7.eu/archlinux/archzfs/archzfs/x86_64
Server = https://mirror.biocrafting.net/archlinux/archzfs/archzfs/x86_64 Server = https://mirror.biocrafting.net/archlinux/archzfs/archzfs/x86_64
EOF EOF
pacman -Sy > /dev/null pacman -Sy &>/dev/null
} }
init_archlinux_archive () { init_archlinux_archive () {
@ -107,7 +110,9 @@ download_package () {
local filename="${1##*/}" local filename="${1##*/}"
# Download package in tmp # Download package in tmp
wget "$1" --quiet -P /tmp cd /tmp
curl -sO "$1"
cd -
# Set out file # Set out file
package_file="/tmp/$filename" package_file="/tmp/$filename"
@ -119,7 +124,7 @@ download_package () {
print "Testing if archiso is running" print "Testing if archiso is running"
grep archiso /proc/cmdline > /dev/null grep archiso /proc/cmdline >/dev/null
print "Increasing cowspace to half of RAM" print "Increasing cowspace to half of RAM"
@ -160,8 +165,8 @@ then
print "Installing zfs-utils and zfs-linux" print "Installing zfs-utils and zfs-linux"
# Install packages # Install packages
pacman -U "$zfs_utils_url" --noconfirm &> /dev/null pacman -U "$zfs_utils_url" --noconfirm &>/dev/null
pacman -U "$zfs_linux_package" --noconfirm > /dev/null && zfs=1 pacman -U "$zfs_linux_package" --noconfirm &>/dev/null && zfs=1
fi fi
fi fi