aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/dracut/02zfsexpandknowledge
diff options
context:
space:
mode:
authorManuel Amador (Rudd-O) <[email protected]>2016-04-24 11:35:44 +0000
committerBrian Behlendorf <[email protected]>2016-05-12 14:31:15 -0700
commitd402c18dd60124525b253b27c5018f54a030928d (patch)
tree1057315f14baad460620b4340a9f312d57432463 /contrib/dracut/02zfsexpandknowledge
parent8adb798aa50849cc3f6e099fcae7c29db1b83e39 (diff)
A collection of dracut fixes
- In older systems without sysroot.mount, import before dracut-mount, and re-enable old dracut mount hook - rootflags MUST be present even if the administrator neglected to specify it explicitly - Check that mount.zfs exists in sbindir - Remove awk and head as (now unused) requirements, add grep, and install the right mount.zfs - Eliminate one use of grep in Dracut - Use a more accurate grepping statement to identify zfsutil in rootflags - Ensure that pooldev is nonempty - Properly handle /dev/sd* devices and more - Use new -P to get list of zpool devices - Bail out of the generator when zfs:AUTO is on the root command line - Ignore errors from systemctl trying to load sysroot.mount, we only care about the output - Determine which one is the correct initqueuedir at run time. - Add a compatibility getargbool for our detection / setup script. - Update dracut .gitignore files Signed-off-by: <Matthew Thode [email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4558 Closes #4562
Diffstat (limited to 'contrib/dracut/02zfsexpandknowledge')
-rw-r--r--contrib/dracut/02zfsexpandknowledge/.gitignore1
-rwxr-xr-xcontrib/dracut/02zfsexpandknowledge/module-setup.sh.in19
2 files changed, 12 insertions, 8 deletions
diff --git a/contrib/dracut/02zfsexpandknowledge/.gitignore b/contrib/dracut/02zfsexpandknowledge/.gitignore
new file mode 100644
index 000000000..7fb6b964f
--- /dev/null
+++ b/contrib/dracut/02zfsexpandknowledge/.gitignore
@@ -0,0 +1 @@
+module-setup.sh
diff --git a/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in b/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
index 830ee42f6..e694ae0d0 100755
--- a/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
+++ b/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
@@ -15,21 +15,24 @@ get_pool_devices() {
local poolconfigoutput
local pooldev
local prefix
+ local resolved
poolconfigtemp=`mktemp`
- @sbindir@/zpool list -v -H "$1" > "$poolconfigtemp" 2>&1
+ @sbindir@/zpool list -v -H -P "$1" > "$poolconfigtemp" 2>&1
if [ "$?" != "0" ] ; then
poolconfigoutput=$(cat "$poolconfigtemp")
dinfo "zfsexpandknowledge: pool $1 cannot be listed: $poolconfigoutput"
else
while read pooldev ; do
- for prefix in /dev/disk/* /dev/mapper ; do
- if [ -e "$prefix"/"$pooldev" ] ; then
- dinfo "zfsexpandknowledge: pool $1 has device $prefix/$pooldev"
- echo `readlink -f "$prefix"/"$pooldev"`
- break
+ if [ -n "$pooldev" -a -e "$pooldev" ] ; then
+ if [ -h "$pooldev" ] ; then
+ resolved=`readlink -f "$pooldev"`
+ else
+ resolved="$pooldev"
+ fi
+ dinfo "zfsexpandknowledge: pool $1 has device $pooldev (which resolves to $resolved)"
+ echo "$resolved"
fi
- done
- done < <(cat "$poolconfigtemp" | awk -F '\t' 'NR>1 { print $2 }')
+ done < <(cat "$poolconfigtemp" | awk -F '\t' '/\t\/dev/ { print $2 }')
fi
rm -f "$poolconfigtemp"
}