Cleanup contrib/initramfs automake

The initramfs hook scripts depend on Makefile.  This way, if the
substitution code is changed, they should update.  This brings it in
line with etc/init.d (which was modified to match the example in the
automake docs).

The initramfs hook script cleaning now matches etc/init.d.

There was a mix of SUBDIRS recursion and custom install rules for files
in subdirectories.  This was duplicated for the "hooks" and "scripts"
subdirectories.  Now everything uses SUBDIRS.

I fixed the substitution of DEFAULT_INITCONF_DIR for hooks/zfs.

Reviewed-By: Andrey Prokopenko <job@terem.fr>
Reviewed-By: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-By: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
Closes #10027
This commit is contained in:
Richard Laager 2020-05-02 18:46:46 -05:00 committed by Brian Behlendorf
parent 657fd33bcf
commit 4cfd339ce4
6 changed files with 16 additions and 27 deletions

View File

@ -92,6 +92,8 @@ AC_CONFIG_FILES([
contrib/dracut/90zfs/Makefile contrib/dracut/90zfs/Makefile
contrib/dracut/Makefile contrib/dracut/Makefile
contrib/initramfs/Makefile contrib/initramfs/Makefile
contrib/initramfs/conf.d/Makefile
contrib/initramfs/conf-hooks.d/Makefile
contrib/initramfs/hooks/Makefile contrib/initramfs/hooks/Makefile
contrib/initramfs/scripts/Makefile contrib/initramfs/scripts/Makefile
contrib/initramfs/scripts/local-top/Makefile contrib/initramfs/scripts/local-top/Makefile

View File

@ -1,23 +1,6 @@
initrddir = /usr/share/initramfs-tools initrddir = /usr/share/initramfs-tools
initrd_SCRIPTS = \ SUBDIRS = conf.d conf-hooks.d hooks scripts
conf.d/zfs conf-hooks.d/zfs hooks/zfs scripts/zfs scripts/local-top/zfs
SUBDIRS = hooks scripts
EXTRA_DIST = \ EXTRA_DIST = \
$(top_srcdir)/contrib/initramfs/conf.d/zfs \
$(top_srcdir)/contrib/initramfs/conf-hooks.d/zfs \
$(top_srcdir)/contrib/initramfs/README.initramfs.markdown $(top_srcdir)/contrib/initramfs/README.initramfs.markdown
install-initrdSCRIPTS: $(EXTRA_DIST)
for d in conf.d conf-hooks.d scripts/local-top; do \
$(MKDIR_P) $(DESTDIR)$(initrddir)/$$d; \
cp $(top_srcdir)/contrib/initramfs/$$d/zfs \
$(DESTDIR)$(initrddir)/$$d/; \
done
for d in hooks scripts; do \
$(MKDIR_P) $(DESTDIR)$(initrddir)/$$d; \
cp $(top_builddir)/contrib/initramfs/$$d/zfs \
$(DESTDIR)$(initrddir)/$$d/; \
done

View File

@ -0,0 +1,4 @@
confhooksddir = /usr/share/initramfs-tools/conf-hooks.d
dist_confhooksd_DATA = \
zfs

View File

@ -0,0 +1,4 @@
confddir = /usr/share/initramfs-tools/conf.d
dist_confd_DATA = \
zfs

View File

@ -6,18 +6,13 @@ hooks_SCRIPTS = \
EXTRA_DIST = \ EXTRA_DIST = \
$(top_srcdir)/contrib/initramfs/hooks/zfs.in $(top_srcdir)/contrib/initramfs/hooks/zfs.in
$(hooks_SCRIPTS):%:%.in $(hooks_SCRIPTS):%:%.in Makefile
-$(SED) -e 's,@sbindir\@,$(sbindir),g' \ -$(SED) -e 's,@sbindir\@,$(sbindir),g' \
-e 's,@sysconfdir\@,$(sysconfdir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \
-e 's,@udevdir\@,$(udevdir),g' \ -e 's,@udevdir\@,$(udevdir),g' \
-e 's,@udevruledir\@,$(udevruledir),g' \ -e 's,@udevruledir\@,$(udevruledir),g' \
-e 's,@mounthelperdir\@,$(mounthelperdir),g' \ -e 's,@mounthelperdir\@,$(mounthelperdir),g' \
-e 's,@DEFAULT_INITCONF_DIR\@,$(DEFAULT_INITCONF_DIR),g' \
$< >'$@' $< >'$@'
# Double-colon rules are allowed; there are multiple independent definitions. CLEANFILES = $(hooks_SCRIPTS)
clean-local::
-$(RM) $(hooks_SCRIPTS)
# Double-colon rules are allowed; there are multiple independent definitions.
distclean-local::
-$(RM) $(hooks_SCRIPTS)

View File

@ -1,3 +1,4 @@
localtopdir = /usr/share/initramfs-tools/scripts/local-top localtopdir = /usr/share/initramfs-tools/scripts/local-top
EXTRA_DIST = zfs dist_localtop_SCRIPTS = \
zfs