Skip to content

Commit 268fb97

Browse files
committed
added option to either install archzfs-dkms or archzfs-linux[-lts]
1 parent bc7513d commit 268fb97

File tree

3 files changed

+48
-5
lines changed

3 files changed

+48
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
5151
* [ZFS Install](scripts/zfs/install)
5252
* Added support for `install.dist.conf`
5353
* Started [help](doc/help) section
54+
* Added selection of `archzfs-dkms` or `archzfs-linux[-lts]` should be installed
5455

5556
### Changed
5657

scripts/zfs/install/01-configure.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,35 @@ function _main ()
436436
fi
437437
#eo: configuration section
438438

439+
#bo: dkms or no dkms
440+
if [[ -z ${zfskernelmode+x} ]];
441+
then
442+
echo "Which zfs do you want to install?"
443+
if [[ ${kernel} == "linux" ]];
444+
then
445+
ask "0) archzfs-dkms (default) 1) archzfs-linux"
446+
447+
case ${REPLY:-0} in
448+
1) zfskernelmode="archzfs-linux"
449+
;;
450+
*) zfskernelmod="archzfs-dkms"
451+
;;
452+
esac
453+
else
454+
ask "0) archzfs-dkms (default) 1) archzfs-linux-lts"
455+
456+
case ${REPLY:-0} in
457+
1) zfskernelmode="archzfs-linux-lts"
458+
;;
459+
*) zfskernelmod="archzfs-dkms"
460+
;;
461+
esac
462+
fi
463+
464+
echo "zfskernelmode=\"${zfskernelmode}\"" >> ${install_conf}
465+
fi
466+
#eo: dkms or no dkms
467+
439468
# Finish
440469
echo -e "\e[32mAll OK"
441470
}

scripts/zfs/install/02-install.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ EOF
178178
echo ":: eo timedate configuration"
179179

180180
echo ":: bo chroot configuration"
181-
arch-chroot /mnt /bin/bash -xe <<EOF
181+
cat > /mnt/setup.sh <<EOF
182182
183183
### Reinit keyring
184184
# As keyring is initialized at boot, and copied to the install dir with pacstrap, and ntp is running
@@ -210,7 +210,7 @@ Server = https://mirror.in.themindsmaze.com/archzfs/archzfs/x86_64
210210
Server = https://zxcvfdsa.com/archzfs/archzfs/x86_64
211211
EOSF
212212
fi
213-
pacman -Syu --noconfirm zfs-dkms zfs-utils
213+
pacman -Syu --noconfirm ${zfskernelmode}
214214
215215
# Set date
216216
ln -sf /usr/share/zoneinfo/${timezone} /etc/localtime
@@ -242,8 +242,15 @@ EOSF
242242
chown -R ${user}:${user} /home/${user}
243243
244244
EOF
245+
arch-chroot /mnt /bin/bash /setup.sh
246+
247+
if [[ ${?} -eq 0 ]];
248+
then
249+
rm /mnt/setup.sh
250+
fi
245251
echo ":: eo chroot configuration"
246252

253+
echo ":: bo user configuration"
247254
# Set root passwd
248255
print ":: Set root password"
249256
arch-chroot /mnt /bin/passwd
@@ -259,6 +266,7 @@ root ALL=(ALL) ALL
259266
${user} ALL=(ALL) ALL
260267
Defaults rootpw
261268
EOF
269+
echo ":: eo user configuration"
262270

263271
# Configure network
264272
if [[ ${configure_network} -eq 1 ]];
@@ -339,19 +347,22 @@ EOF
339347
fi
340348

341349
# Activate zfs
342-
print ":: Configure ZFS"
350+
echo ":: bo zfs inconfiguration"
351+
echo " Enable zfs service"
343352
systemctl enable zfs-import-cache --root=/mnt
344353
systemctl enable zfs-mount --root=/mnt
345354
systemctl enable zfs-import.target --root=/mnt
346355
systemctl enable zfs.target --root=/mnt
347356

348357
# Configure zfs-mount-generator
349-
print ":: Configure zfs-mount-generator"
358+
print " Configure zfs-mount-generator"
350359
mkdir -p /mnt/etc/zfs/zfs-list.cache
351360
touch /mnt/etc/zfs/zfs-list.cache/${zpoolname}
352361
zfs list -H -o name,mountpoint,canmount,atime,relatime,devices,exec,readonly,setuid,nbmand | sed 's/\/mnt//' > /mnt/etc/zfs/zfs-list.cache/${zpoolname}
353362
systemctl enable zfs-zed.service --root=/mnt
363+
echo ":: eo zfs inconfiguration"
354364

365+
echo ":: bo zfsbootmenu"
355366
# Configure zfsbootmenu
356367
mkdir -p /mnt/efi/EFI/ZBM
357368

@@ -396,6 +407,7 @@ EOF
396407
# Generate zfsbootmenu
397408
generate-zbm
398409
EOF
410+
echo ":: eo zfsbootmenu"
399411

400412
# Set DISK
401413
if [[ -f /tmp/disk ]]
@@ -412,7 +424,8 @@ EOF
412424
fi
413425

414426
# Create UEFI entries
415-
print ":: Create efi boot entries"
427+
echo ":: bo uefi boot entries"
428+
416429
if ! efibootmgr | grep ZFSBootMenu
417430
then
418431
efibootmgr --disk "${DISK}" \

0 commit comments

Comments
 (0)