diff --git a/README.md b/README.md index 887cff8..321ada2 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,30 @@ In cases where a variable is both exported prior to script execution and specifi Known options are as follows. +### Kernel downgrade + +By default we install newest `linux` and `linux-headers` packages into a `chroot`. Once we're in that `chroot` we then install newest [AUR zfs-dkms package](https://aur.archlinux.org/packages/zfs-dkms). You may want to override `linux` and `linux-headers` versions we're installing to ensure you end up with a compatible mix between them and `zfs-dkms`. + +For example: +``` +export ARCHZBM_KERNEL_VER=6.5.9.arch2 +``` + +In our `chroot` this will trigger execution of: +``` +downgrade --ala-only 'linux=6.5.9.arch2' 'linux-headers=6.5.9.arch2' --ignore always +``` + +Where `downgrade` is the [AUR downgrade package](https://aur.archlinux.org/packages/downgrade). This will downgrade `linux` and `linux-headers` and will add a setting to your `/etc/pacman.conf`: +``` +[options] +IgnorePkg = linux linux-headers +``` + +Setting `ARCHZBM_KERNEL_VER` to an empty string `''` or keeping it undefined are both valid and will retain newest versions instead of downgrading. + +Also read [Kernel selection](#kernel-selection) for details. + ### Compression By default we create a zpool with ZFS property `compression=on`. If the `lz4_compress` pool feature is active this will by default enable `compression=lz4`. See `man 7 zfsprops` for example in ZFS 2.1.9 for details. See `zpool get feature@lz4_compress ` to check this feature's status on your ``. @@ -296,6 +320,24 @@ When it comes to the point that your SSH client sends an are-your-still-there me This effectively configures your SSH client to remain connected even through somewhat lossy hops to the Dropbear daemon; and to cleanly disconnect 3 seconds and some change after you've executed whatever you needed to do in ZFSBootMenu. +# Kernel selection + +This script compiles ZFS via Arch Linux' [Dynamic Kernel Module Support](https://wiki.archlinux.org/title/Dynamic_Kernel_Module_Support) (DKMS). Not all kernels allow for successful compilation, in some instances a particularly recent kernel version may change APIs to such a degree that ZFS compilation simply fails. + +We strongly suggest to that you: + +- Firstly, refer to a resource such as the [Arch Linux Archive package version list](https://archive.archlinux.org/packages/l/linux/) to find out what newest kernel version this script will install. +- Secondly, research if newest [AUR zfs-dkms package](https://aur.archlinux.org/packages/zfs-dkms) is compatible with that kernel. Two reasonable points of contact are AUR and its comments section for `zfs-dkms` where users quickly report issues; and the [github.com/openzfs/zfs issues list](https://github.com/openzfs/zfs/issues). + +An example for this is that `linux-6.6.1.arch1-1-x86_64` released on Wednesday, November 8, 2023 at a time when newest `zfs-dkms` package version [was 2.2.0](https://aur.archlinux.org/cgit/aur.git/commit/?h=zfs-dkms&id=da1b6372c57b16f2781a7fda2b95971bb392c5ee) which did not compile against `linux` 6.6.x. + +You'd then set for example: +``` +export ARCHZBM_KERNEL_VER=6.5.9.arch2 +``` + +Where any 6.5.x version is known to work well with `zfs-dkms`. See also [Kernel downgrade](#kernel-downgrade) for details on how to configure this. + # Flavor choices We make the following opinionated flavor choices. Feel free to change them to your liking. diff --git a/setup.sh b/setup.sh index bcf383b..37ee339 100644 --- a/setup.sh +++ b/setup.sh @@ -68,6 +68,10 @@ function setup_env_vars () { echo '----------------------------------------' echo + read -u3 -p 'Please type kernel version to use, leave empty for latest, confirm with : ' -s ARCHZBM_KERNEL_VER + echo + echo + echo 'Do you want compressed datasets?' select arg_compressed in "Compressed" "Uncompressed"; do case "${arg_compressed}" in @@ -301,7 +305,7 @@ function setup_env_vars () { fi fi - for env_var in 'ARCHZBM_ZFSPROPS_NO_COMPRESSION' 'ARCHZBM_ZFSPROPS_NO_ENCRYPTION' 'ARCHZBM_ZPOOL_PASSWORD' 'ARCHZBM_ROOT_PASSWORD' 'ARCHZBM_NET_AUTOCONF' 'ARCHZBM_NET_DEVICE' 'ARCHZBM_NET_CLIENT_IP' 'ARCHZBM_NET_NETMASK' 'ARCHZBM_NET_GATEWAY_IP' 'ARCHZBM_SSH_PORT' 'ARCHZBM_SSH_KEEPALIVE_INTVL' 'ARCHZBM_SSH_AUTH_KEYS' 'ARCHZBM_OS_CLIENT_IP' 'ARCHZBM_OS_GATEWAY_IP' 'ARCHZBM_OS_DNS_IP' 'ARCHZBM_OS_NTP_IP'; do + for env_var in 'ARCHZBM_KERNEL_VER' 'ARCHZBM_ZFSPROPS_NO_COMPRESSION' 'ARCHZBM_ZFSPROPS_NO_ENCRYPTION' 'ARCHZBM_ZPOOL_PASSWORD' 'ARCHZBM_ROOT_PASSWORD' 'ARCHZBM_NET_AUTOCONF' 'ARCHZBM_NET_DEVICE' 'ARCHZBM_NET_CLIENT_IP' 'ARCHZBM_NET_NETMASK' 'ARCHZBM_NET_GATEWAY_IP' 'ARCHZBM_SSH_PORT' 'ARCHZBM_SSH_KEEPALIVE_INTVL' 'ARCHZBM_SSH_AUTH_KEYS' 'ARCHZBM_OS_CLIENT_IP' 'ARCHZBM_OS_GATEWAY_IP' 'ARCHZBM_OS_SSH_AUTH_KEYS' 'ARCHZBM_OS_DNS_IP' 'ARCHZBM_OS_NTP_IP'; do if [[ "${!env_var}" ]]; then printf -- '%s='"'"'%s'"'"'\n' \ "${env_var}" "${!env_var}" \