-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add zdev rules to the initrd for all installations.
Always hook the udev rules that read the `/etc/zfs/zdev.conf` file into the initrd, even if the system is not using the zfs-initramfs package. This change ensures that `/dev/disk/zpool` device aliases are ready in time for `mount` calls early in the init stack. Amended-by: Darik Horn <dajhorn@vanadac.com> Closes: dajhorn/pkg-zfs#39 Closes: openzfs/zfs#811
- Loading branch information
Showing
3 changed files
with
73 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh | ||
# | ||
# Add udev rules for ZoL to the initrd. | ||
# | ||
|
||
PREREQ="udev" | ||
PREREQ_UDEV_RULES="60-zpool.rules 60-zvol.rules" | ||
COPY_EXEC_LIST="/lib/udev/zvol_id /lib/udev/zpool_id" | ||
|
||
# Generic result code. | ||
RC=0 | ||
|
||
case $1 in | ||
prereqs) | ||
echo "$PREREQ" | ||
exit 0 | ||
;; | ||
esac | ||
|
||
for ii in $COPY_EXEC_LIST | ||
do | ||
if [ ! -x "$ii" ] | ||
then | ||
echo "Error: $ii is not executable." | ||
RC=2 | ||
fi | ||
done | ||
|
||
if [ "$RC" -ne 0 ] | ||
then | ||
exit "$RC" | ||
fi | ||
|
||
. /usr/share/initramfs-tools/hook-functions | ||
|
||
mkdir -p "$DESTDIR/etc/" | ||
mkdir -p "$DESTDIR/lib/udev/rules.d/" | ||
|
||
for ii in $PREREQ_UDEV_RULES | ||
do | ||
if [ -e "/etc/udev/rules.d/$ii" ] | ||
then | ||
cp -p "/etc/udev/rules.d/$ii" "$DESTDIR/lib/udev/rules.d/" | ||
elif [ -e "/lib/udev/rules.d/$ii" ] | ||
then | ||
cp -p "/lib/udev/rules.d/$ii" "$DESTDIR/lib/udev/rules.d/" | ||
else | ||
echo "Error: Missing udev rule: $ii" | ||
echo " This file must be in the /etc/udev/rules.d or /lib/udev/rules.d directory." | ||
exit 1 | ||
fi | ||
done | ||
|
||
for ii in $COPY_EXEC_LIST | ||
do | ||
copy_exec "$ii" | ||
done | ||
|
||
if [ -e "/etc/zfs/" ] | ||
then | ||
cp -a "/etc/zfs/" "$DESTDIR/etc/" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
activate update-initramfs |