File: parse-zfs.sh.in

package info (click to toggle)
zfs-linux 2.3.4~git20250812.3b64a96-1
  • links: PTS, VCS
  • area: contrib
  • in suites: experimental
  • size: 70,688 kB
  • sloc: ansic: 393,668; sh: 68,068; asm: 47,734; python: 8,160; makefile: 5,125; perl: 859; sed: 41
file content (35 lines) | stat: -rwxr-xr-x 965 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
# shellcheck disable=SC2034,SC2154

# shellcheck source=zfs-lib.sh.in
. /lib/dracut-zfs-lib.sh

# Let the command line override our host id.
spl_hostid=$(getarg spl_hostid=)
if [ -n "${spl_hostid}" ] ; then
	info "ZFS: Using hostid from command line: ${spl_hostid}"
	zgenhostid -f "${spl_hostid}"
elif [ -f "/etc/hostid" ] ; then
	info "ZFS: Using hostid from /etc/hostid: $(hostid)"
else
	warn "ZFS: No hostid found on kernel command line or /etc/hostid."
	warn "ZFS: Pools may not import correctly."
fi

if decode_root_args; then
	if [ "$root" = "zfs:AUTO" ]; then
		info "ZFS: Boot dataset autodetected from bootfs=."
	else
		info "ZFS: Boot dataset is ${root}."
	fi

	rootok=1
	# Make sure Dracut is happy that we have a root and will wait for ZFS
	# modules to settle before mounting.
	if [ -n "${wait_for_zfs}" ]; then
		ln -s null /dev/root
		echo '[ -e /dev/zfs ]' > "${hookdir}/initqueue/finished/zfs.sh"
	fi
else
	info "ZFS: no ZFS-on-root."
fi