replace commands parsing ls output with shell glob

Signed-off-by: Maurice Zhou <jasper@apvc.uk>
This commit is contained in:
Maurice Zhou
2021-09-19 09:12:02 +08:00
committed by George Melikov
parent d1e8fad976
commit e34ace390b
6 changed files with 28 additions and 15 deletions

View File

@@ -101,7 +101,7 @@ System Configuration
#. Build ZFS modules:: #. Build ZFS modules::
ls -1 /lib/modules \ for directory in /lib/modules/*; do
| while read kernel_version; do kernel_version=$(basename $directory)
dkms autoinstall -k $kernel_version dkms autoinstall -k $kernel_version
done done

View File

@@ -49,10 +49,10 @@ Install GRUB
touch /etc/zfs/zpool.cache touch /etc/zfs/zpool.cache
chmod a-w /etc/zfs/zpool.cache chmod a-w /etc/zfs/zpool.cache
chattr +i /etc/zfs/zpool.cache chattr +i /etc/zfs/zpool.cache
ls -1 /lib/modules \ for directory in /lib/modules/*; do
| while read kernel_version; do kernel_version=$(basename $directory)
dracut --force --kver $kernel_version dracut --force --kver $kernel_version
done done
#. Disable BLS:: #. Disable BLS::

View File

@@ -49,13 +49,16 @@ see below.
modprobe zfs modprobe zfs
It might be necessary to rebuild module:: It might be necessary to rebuild ZFS module::
ls -1 /lib/modules \ for directory in /lib/modules/*; do
| while read kernel_version; do kernel_version=$(basename $directory)
dkms autoinstall -k $kernel_version dkms autoinstall -k $kernel_version
done done
If for some reason, ZFS kernel module is not successfully built,
you can also run the above command to debug the problem.
#. By default ZFS kernel modules are loaded upon detecting a pool. #. By default ZFS kernel modules are loaded upon detecting a pool.
To always load the modules at boot:: To always load the modules at boot::

View File

@@ -97,7 +97,7 @@ System Configuration
#. Build ZFS modules:: #. Build ZFS modules::
ls -1 /lib/modules \ for directory in /lib/modules/*; do
| while read kernel_version; do kernel_version=$(basename $directory)
dkms autoinstall -k $kernel_version dkms autoinstall -k $kernel_version
done done

View File

@@ -49,10 +49,10 @@ Install GRUB
touch /etc/zfs/zpool.cache touch /etc/zfs/zpool.cache
chmod a-w /etc/zfs/zpool.cache chmod a-w /etc/zfs/zpool.cache
chattr +i /etc/zfs/zpool.cache chattr +i /etc/zfs/zpool.cache
ls -1 /lib/modules \ for directory in /lib/modules/*; do
| while read kernel_version; do kernel_version=$(basename $directory)
dracut --force --kver $kernel_version dracut --force --kver $kernel_version
done done
#. Load ZFS modules and disable BLS:: #. Load ZFS modules and disable BLS::

View File

@@ -109,6 +109,16 @@ time you must create an ``/etc/modules-load.d/zfs.conf`` file::
After upgrading users must uninstall OpenZFS and then reinstall it After upgrading users must uninstall OpenZFS and then reinstall it
from the matching repository as described in this section. from the matching repository as described in this section.
It might be necessary to rebuild ZFS module::
for directory in /lib/modules/*; do
kernel_version=$(basename $directory)
dkms autoinstall -k $kernel_version
done
If for some reason, ZFS kernel module is not successfully built,
you can also run the above command to debug the problem.
Testing Repositories Testing Repositories
-------------------- --------------------