Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs-dracut on CentOS 6.5 broken #4640

Closed
behlendorf opened this issue May 12, 2016 · 5 comments

Comments

@behlendorf
Copy link
Member

commented May 12, 2016

From @Rudd-O's comment in #2356. These are the remaining CentOS 6.5 issues.

The older dracut uses separate scripts (check, install, installkernel) instead of module-setup.sh.
mount-zfs.sh uses the function getargbool but its not defined in the older dracut so call fails and the zfs_force kernel cmdline arg does not work.
Fix for # 1 — fix: create stub scripts in 90zfs for each along the line of:

$ cat install

!/bin/bash

. /usr/share/dracut/modules.d/90zfs/module-setup.sh
install $1
Fix for # 2: none yet. Hack is to set ZPOOL_FORCE="-f" at top of script.

With that, we will have fully functional Red Hat 6.0 support for booting off of ZFS root.

@Rudd-O

This comment has been minimized.

Copy link
Contributor

commented May 12, 2016

To help people not waste time:


I experimented with creating the stubs, and I am sorry to say, I cannot fix that bug because my autotools knowledge cannot cross this hurdle:

Any script named install, check or depends causes the generated Makefile to throw make into an infinite loop.

Stands to reason, if you think about it. When install becomes a target, then obviously it's no longer the .PHONY target that causes install to happen, so calling make all implicitly calls make install, which goes into a recursive loop.

Here is the diff that causes the issue:

diff --git a/contrib/dracut/90zfs/Makefile.am b/contrib/dracut/90zfs/Makefile.am
index f81d6c3..15f4bad 100644
--- a/contrib/dracut/90zfs/Makefile.am
+++ b/contrib/dracut/90zfs/Makefile.am
@@ -1,5 +1,9 @@
 pkgdracutdir = $(dracutdir)/modules.d/90zfs
 pkgdracut_SCRIPTS = \
+   check \
+   depends \
+   installkernel \
+   install \
    export-zfs.sh \
    module-setup.sh \
    mount-zfs.sh \
@@ -8,6 +12,10 @@ pkgdracut_SCRIPTS = \
    zfs-lib.sh

 EXTRA_DIST = \
+   $(top_srcdir)/contrib/dracut/90zfs/check.in \
+   $(top_srcdir)/contrib/dracut/90zfs/depends.in \
+   $(top_srcdir)/contrib/dracut/90zfs/installkernel.in \
+   $(top_srcdir)/contrib/dracut/90zfs/install.in \
    $(top_srcdir)/contrib/dracut/90zfs/export-zfs.sh.in \
    $(top_srcdir)/contrib/dracut/90zfs/module-setup.sh.in \
    $(top_srcdir)/contrib/dracut/90zfs/mount-zfs.sh.in \
diff --git a/contrib/dracut/90zfs/check.in b/contrib/dracut/90zfs/check.in
index e69de29..0c996a3 100755
--- a/contrib/dracut/90zfs/check.in
+++ b/contrib/dracut/90zfs/check.in
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+NAME="$( basename "${BASH_SOURCE[0]}" )"
+
+. "$DIR/module-setup.sh"
+"$NAME" "$@"
diff --git a/contrib/dracut/90zfs/depends.in b/contrib/dracut/90zfs/depends.in
index e69de29..0c996a3 100755
--- a/contrib/dracut/90zfs/depends.in
+++ b/contrib/dracut/90zfs/depends.in
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+NAME="$( basename "${BASH_SOURCE[0]}" )"
+
+. "$DIR/module-setup.sh"
+"$NAME" "$@"
diff --git a/contrib/dracut/90zfs/install.in b/contrib/dracut/90zfs/install.in
index e69de29..0c996a3 100755
--- a/contrib/dracut/90zfs/install.in
+++ b/contrib/dracut/90zfs/install.in
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+NAME="$( basename "${BASH_SOURCE[0]}" )"
+
+. "$DIR/module-setup.sh"
+"$NAME" "$@"
diff --git a/contrib/dracut/90zfs/installkernel.in b/contrib/dracut/90zfs/installkernel.in
index e69de29..0c996a3 100755
--- a/contrib/dracut/90zfs/installkernel.in
+++ b/contrib/dracut/90zfs/installkernel.in
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+NAME="$( basename "${BASH_SOURCE[0]}" )"
+
+. "$DIR/module-setup.sh"
+"$NAME" "$@"

I will need more help from someone interested in Red Hat 6.0 support, as that's as far as I know how to go.

@behlendorf

This comment has been minimized.

Copy link
Member Author

commented Nov 8, 2016

Closing. Currently Dracut is only being supported for more current versions of Dracut.

@behlendorf behlendorf closed this Nov 8, 2016

@Rudd-O

This comment has been minimized.

Copy link
Contributor

commented Nov 8, 2016

I'm still happy to get this nailed if I get help fighting the Makefile.f-ck . I have little to no knowledget about autoblow.

@behlendorf

This comment has been minimized.

Copy link
Member Author

commented Nov 8, 2016

OK, then let me reopen this and if someone has time we can address the autoconf issues with the patch above.

@behlendorf behlendorf reopened this Nov 8, 2016

@kpande kpande closed this Feb 16, 2019

@kpande

This comment has been minimized.

Copy link
Contributor

commented Feb 16, 2019

this is working on centos 6.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.