From 2adac7b94bd78e97e17a2ecc80e0771a9244db8e Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Thu, 2 Jan 2025 01:00:06 +0100 Subject: [PATCH 1/4] Add a 2G loop device for emergency swap --- setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.sh b/setup.sh index 0fb63e9..955ce5e 100644 --- a/setup.sh +++ b/setup.sh @@ -1300,6 +1300,10 @@ function get_disks_with_one_efipart () { function install_os_in_chroot () { #2.2 + dd if='/dev/zero' of='/swapfile' bs='1M' count='2048' + losetup '/dev/loop9' '/swapfile' + mkswap '/dev/loop9' + swapon '/dev/loop9' ### Reinit keyring # As keyring is initialized at boot, and copied to the install dir with pacstrap, and ntp is running # Time changed after keyring initialization, it leads to malfunction @@ -1346,6 +1350,9 @@ function install_os_in_chroot () { add_syslinux_pacman_hook fi add_zbm_pacman_hook + swapoff '/dev/loop9' + losetup -d '/dev/loop9' + rm '/swapfile' } function set_root_pw () { -- 2.47.2 From 3ae8b53616133b10a46c6932577764375dc2fa2d Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Fri, 17 Jan 2025 21:05:53 +0100 Subject: [PATCH 2/4] build(meta): Don't commit .idea JetBrains dir (#26) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index af65835..943db99 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ archzbm_settings.env +.idea -- 2.47.2 From 1036ce9c5b2bd3c57deaebf191e5cda8a7c6302d Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Fri, 17 Jan 2025 21:08:44 +0100 Subject: [PATCH 3/4] fix(zfs): Install ZFS only when needed (#26) In situations where this script runs on alternative Arch Linux live CD ISOs such as github.com/stevleibelt/arch-linux-live-cd-iso-with -zfs we may not have to insall ZFS kernel modules. Test if the 'zfs' module is loaded and skip installation if yes. --- setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 955ce5e..7cd7172 100644 --- a/setup.sh +++ b/setup.sh @@ -451,7 +451,12 @@ function install_pkgs () { function install_zfs () { #1.6 declare reset_colors='\033[0m' - curl -s 'https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init' | bash + if modinfo 'zfs' &>/dev/null; then + >&3 printf -- '%s\n' \ + 'ZFS kernel module is loaded, no need to install ...' + else + curl -s 'https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init' | bash + fi printf -- "${reset_colors}" } -- 2.47.2 From 64c66cbd0f03dca1a20a1d17c047f36145cd235e Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Fri, 17 Jan 2025 21:08:44 +0100 Subject: [PATCH 4/4] fix(zfs): Install ZFS only when needed (#26) In situations where this script runs on alternative Arch Linux live CD ISOs such as github.com/stevleibelt/arch-linux-live-cd-iso-with -zfs we may not have to insall ZFS kernel modules. Test if the 'zfs' module is loaded and skip installation if yes. --- setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 955ce5e..7cd7172 100644 --- a/setup.sh +++ b/setup.sh @@ -451,7 +451,12 @@ function install_pkgs () { function install_zfs () { #1.6 declare reset_colors='\033[0m' - curl -s 'https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init' | bash + if modinfo 'zfs' &>/dev/null; then + >&3 printf -- '%s\n' \ + 'ZFS kernel module is loaded, no need to install ...' + else + curl -s 'https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init' | bash + fi printf -- "${reset_colors}" } -- 2.47.2