aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/initramfs/scripts
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-11-07 23:53:57 +0100
committerBrian Behlendorf <[email protected]>2017-11-07 14:53:57 -0800
commitcb3b0419baeecd15cc6891cdccfe0d5d815edd36 (patch)
treef8d6a7b803b87b755e1b489419163495138d3ee6 /contrib/initramfs/scripts
parenta3df7fa79d7db857f67a38ced033764bd684ca71 (diff)
contrib/initramfs: switch to automake
Use automake to build initramfs scripts and hooks. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #6761
Diffstat (limited to 'contrib/initramfs/scripts')
-rw-r--r--contrib/initramfs/scripts/.gitignore1
-rw-r--r--contrib/initramfs/scripts/Makefile.am20
-rw-r--r--contrib/initramfs/scripts/local-top/Makefile.am3
-rw-r--r--contrib/initramfs/scripts/zfs.in (renamed from contrib/initramfs/scripts/zfs)8
4 files changed, 28 insertions, 4 deletions
diff --git a/contrib/initramfs/scripts/.gitignore b/contrib/initramfs/scripts/.gitignore
new file mode 100644
index 000000000..73304bc2c
--- /dev/null
+++ b/contrib/initramfs/scripts/.gitignore
@@ -0,0 +1 @@
+zfs
diff --git a/contrib/initramfs/scripts/Makefile.am b/contrib/initramfs/scripts/Makefile.am
new file mode 100644
index 000000000..7b65429fd
--- /dev/null
+++ b/contrib/initramfs/scripts/Makefile.am
@@ -0,0 +1,20 @@
+scriptsdir = $(datarootdir)/initramfs-tools/scripts
+
+scripts_SCRIPTS = \
+ zfs
+
+SUBDIRS = local-top
+
+EXTRA_DIST = \
+ $(top_srcdir)/contrib/initramfs/scripts/zfs.in
+
+$(scripts_SCRIPTS):%:%.in
+ -$(SED) -e 's,@sbindir\@,$(sbindir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ $< >'$@'
+
+clean-local::
+ -$(RM) $(scripts_SCRIPTS)
+
+distclean-local::
+ -$(RM) $(scripts_SCRIPTS)
diff --git a/contrib/initramfs/scripts/local-top/Makefile.am b/contrib/initramfs/scripts/local-top/Makefile.am
new file mode 100644
index 000000000..88aa2d4ff
--- /dev/null
+++ b/contrib/initramfs/scripts/local-top/Makefile.am
@@ -0,0 +1,3 @@
+localtopdir = $(datarootdir)/initramfs-tools/scripts/local-top
+
+EXTRA_DIST = zfs
diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs.in
index 500ae3fc8..3d3aa537d 100644
--- a/contrib/initramfs/scripts/zfs
+++ b/contrib/initramfs/scripts/zfs.in
@@ -11,9 +11,9 @@
# Paths to what we need - in the initrd, these paths are hardcoded,
# so override the defines in zfs-functions.
-ZFS="/sbin/zfs"
-ZPOOL="/sbin/zpool"
-ZPOOL_CACHE="/etc/zfs/zpool.cache"
+ZFS="@sbindir@/zfs"
+ZPOOL="@sbindir@/zpool"
+ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
export ZFS ZPOOL ZPOOL_CACHE
# This runs any scripts that should run before we start importing
@@ -610,7 +610,7 @@ setup_snapshot_booting()
# Separate the full snapshot ('$snap') into it's filesystem and
# snapshot names. Would have been nice with a split() function..
rootfs="${snap%%@*}"
- snapname="${snap##*@}"
+ snapname="${snap##*@}"
ZFS_BOOTFS="${rootfs}_${snapname}"
if ! grep -qiE '(^|[^\\](\\\\)* )(rollback)=(on|yes|1)( |$)' /proc/cmdline