Compare commits

..

9 Commits

Author SHA1 Message Date
15d67f2e3f Merge pull request '26-install-zfs-only-when-needed' (#27) from 26-install-zfs-only-when-needed into main
Reviewed-on: #27
2025-01-17 20:11:11 +00:00
6fb13a097c Merge remote-tracking branch 'origin/26-install-zfs-only-when-needed' into 26-install-zfs-only-when-needed 2025-01-17 21:09:40 +01:00
64c66cbd0f 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.
2025-01-17 21:09:19 +01:00
1036ce9c5b 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.
2025-01-17 21:08:44 +01:00
3ae8b53616 build(meta): Don't commit .idea JetBrains dir (#26) 2025-01-17 21:05:53 +01:00
2adac7b94b Add a 2G loop device for emergency swap 2025-01-02 01:00:06 +01:00
9525976fe2 For now no pacman upgrade in ISO 2024-12-28 18:27:29 +01:00
624d278971 For now no pacman upgrade in ISO 2024-12-28 18:21:04 +01:00
08f33c33c7 refactor(os): Retry pacman download on fail 2024-12-28 16:33:13 +01:00
2 changed files with 51 additions and 23 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
archzbm_settings.env
.idea

View File

@@ -429,19 +429,34 @@ function update_pacman_db () {
systemctl start reflector
# In an ISO and for the minimal number of packages we need we do not
# care about partial upgrades
pacman -Syyuu --noconfirm
#
# Are we better off not attempting an upgrade inside the ISO?
# Let's try and find out.
# while ! pacman -Syyuu --needed --noconfirm --downloadonly; do
# sleep 5
# done
# pacman -Syyuu --needed --noconfirm
pacman -Syy
}
function install_pkgs () {
#1.5
printf -- '%s\n' 'Installing packages ...'
while ! pacman -S --needed --noconfirm --downloadonly "${@}"; do
sleep 5
done
pacman -S --needed --noconfirm "${@}"
}
function install_zfs () {
#1.6
declare reset_colors='\033[0m'
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}"
}
@@ -763,7 +778,7 @@ function install_archlinux () {
#1.12
pacman_dl_parallel
pacman_dont_check_space
pacstrap /mnt \
while ! pacstrap /mnt \
base \
base-devel \
linux \
@@ -783,7 +798,9 @@ function install_archlinux () {
bluez-utils \
man-db \
xdg-utils \
xdg-user-dirs
xdg-user-dirs; do
sleep 5
done
}
function gen_fstab () {
@@ -1288,6 +1305,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
@@ -1295,6 +1316,9 @@ function install_os_in_chroot () {
rm -rf '/etc/pacman.d/gnupg'
pacman-key --init
pacman-key --populate archlinux
while ! pacman -S archlinux-keyring --noconfirm --downloadonly; do
sleep 5
done
pacman -S archlinux-keyring --noconfirm
locale-gen
@@ -1331,6 +1355,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 () {