Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in
#!/usr/bin/env bash | #!/usr/bin/env bash | ||||
check() { | check() { | ||||
# We depend on udev-rules being loaded | # We depend on udev-rules being loaded | ||||
[ "${1}" = "-d" ] && return 0 | [ "${1}" = "-d" ] && return 0 | ||||
# Verify the zfs tool chain | # Verify the zfs tool chain | ||||
for tool in "@bindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do | for tool in "@sbindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do | ||||
test -x "$tool" || return 1 | test -x "$tool" || return 1 | ||||
done | done | ||||
# Verify grep exists | # Verify grep exists | ||||
which grep >/dev/null 2>&1 || return 1 | which grep >/dev/null 2>&1 || return 1 | ||||
return 0 | return 0 | ||||
} | } | ||||
Show All 16 Lines | |||||
} | } | ||||
install() { | install() { | ||||
inst_rules @udevruledir@/90-zfs.rules | inst_rules @udevruledir@/90-zfs.rules | ||||
inst_rules @udevruledir@/69-vdev.rules | inst_rules @udevruledir@/69-vdev.rules | ||||
inst_rules @udevruledir@/60-zvol.rules | inst_rules @udevruledir@/60-zvol.rules | ||||
dracut_install hostid | dracut_install hostid | ||||
dracut_install grep | dracut_install grep | ||||
dracut_install @bindir@/zgenhostid | dracut_install @sbindir@/zgenhostid | ||||
dracut_install @sbindir@/zfs | dracut_install @sbindir@/zfs | ||||
dracut_install @sbindir@/zpool | dracut_install @sbindir@/zpool | ||||
# Workaround for https://github.com/openzfs/zfs/issues/4749 by | # Workaround for https://github.com/openzfs/zfs/issues/4749 by | ||||
# ensuring libgcc_s.so(.1) is included | # ensuring libgcc_s.so(.1) is included | ||||
if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then | if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then | ||||
# Dracut will have already tracked and included it | # Dracut will have already tracked and included it | ||||
:; | :; | ||||
elif command -v gcc-config 2>&1 1>/dev/null; then | elif command -v gcc-config 2>&1 1>/dev/null; then | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |