File: parse-zfs.sh.in

package info (click to toggle)
zfs-linux 2.1.11-1%2Bdeb12u1
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm
  • size: 77,344 kB
  • sloc: ansic: 376,447; sh: 59,625; python: 7,872; asm: 6,476; makefile: 5,812; perl: 770; sed: 41; awk: 5
file content (35 lines) | stat: -rwxr-xr-x 965 bytes parent folder | download | duplicates (4)
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