Hooks and modules have a .sh extension
Gitweb: http://git.kernel.org/?p=linux/kernel/git/davej/dracut.git;a=commit;h=3f9c86ab865dfb8b33eb746729133c685c916b68 Commit: 3f9c86ab865dfb8b33eb746729133c685c916b68 Parent: 1c25acaac4f0a4a7360d61ccc76174f44aee6d60 Author: Victor Lowther <[email protected]> AuthorDate: Fri Feb 20 09:24:18 2009 -0800 Committer: Dave Jones <[email protected]> CommitDate: Mon Feb 23 13:22:01 2009 -0500
Hooks and modules have a .sh extension
This makes it trivial to filter out temporary files, editor backups, package management leftovers, etc. Thanks, Kay for the idea.
---
Makefile | 4 ++--
README | 1 +
dracut | 6 +++---
hooks/{cryptroot => cryptroot.sh} | 0
hooks/{resume => resume.sh} | 0
.../{selinux-loadpolicy => selinux-loadpolicy.sh} | 0
init | 2 +-
modules/{00dash => 00dash.sh} | 0
modules/{10redhat-i18n => 10redhat-i18n.sh} | 0
modules/{90crypt => 90crypt.sh} | 2 +-
modules/{90kernel-modules => 90kernel-modules.sh} | 0
modules/{90lvm => 90lvm.sh} | 0
modules/{95debug => 95debug.sh} | 0
modules/{95terminfo => 95terminfo.sh} | 0
modules/{95udev-rules => 95udev-rules.sh} | 0
modules/{99base => 99base.sh} | 4 ++--
16 files changed, 10 insertions(+), 9 deletions(-)Makefile +2 -2
@@ -12,8 +12,8 @@ install: install -m 0755 dracut-functions $(DESTDIR)/usr/libexec/dracut/functions mkdir $(DESTDIR)/usr/libexec/dracut/rules.d for rule in rules.d/*.rules ; do install -m 0644 $$rule $(DESTDIR)/usr/libexec/dracut ; done - for hook in hooks/* ; do install -m 0755 $$hook $(DESTDIR)/usr/libexec/dracut ; done - for module in modules/*; do install -m 0755 $$module $(DESTDIR)/usr/libexec/dracut ; done + for hook in hooks/*.sh ; do install -m 0755 $$hook $(DESTDIR)/usr/libexec/dracut ; done + for module in modules/*.sh; do install -m 0755 $$module $(DESTDIR)/usr/libexec/dracut ; done clean: rm -f *~
README +1 -0
@@ -37,6 +37,7 @@ Some general rules for writing modules: * Generator modules should have a two digit numeric prefix -- they run in ascending sort order. Anything in the 90-99 range is stuff that dracut relies on, so try not to break those hooks. + * Generator modules and hooks must have a .sh extension. Also, there is an attempt to keep things as distribution-agnostic as possible. Every distribution has their own tool here and it's not
dracut +3 -3
@@ -44,7 +44,7 @@ hookdirs="pre-udev pre-mount pre-pivot" initdir=$(mktemp -d -t initramfs.XXXXXX) trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die. -export initdir hookdirs rulesdir dsrc dracutmodules kmodules +export initdir hookdirs rulesdir dsrc dracutmodules modules # Create some directory structure first for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot dev/pts; do
@@ -52,8 +52,8 @@ for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot dev/pts; do done # source all our modules -for f in "$dsrc/modules"/*[^~]; do - mod=${f##*/}; mod=${mod#[0-9][0-9]} +for f in "$dsrc/modules"/*.sh; do + mod=${f##*/}; mod=${mod#[0-9][0-9]}; mod=${mod%.sh} if [[ $dracutmodules = all ]] || strstr "$dracutmodules" "$mod"; then [[ -x $f ]] && . "$f" fi
hooks/cryptroot.sh renamed from hooks/cryptroot +0 -0
hooks/resume.sh renamed from hooks/resume +0 -0
hooks/selinux-loadpolicy.sh renamed from hooks/selinux-loadpolicy +0 -0
init +1 -1
@@ -24,7 +24,7 @@ getarg() { source_all() { local f [ "$1" ] && [ -d "/$1" ] || return - for f in "/$1"/*; do [ -f "$f" ] && . "$f"; done + for f in "/$1"/*.sh; do [ -f "$f" ] && . "$f"; done } echo "Starting initrd..."
modules/00dash.sh renamed from modules/00dash +0 -0
modules/10redhat-i18n.sh renamed from modules/10redhat-i18n +0 -0
modules/90crypt.sh renamed from modules/90crypt +1 -1
@@ -1,4 +1,4 @@ #!/bin/bash inst cryptsetup inst_rules "$dsrc/rules.d/63-luks.rules" -inst_hook pre-mount 50 "$dsrc/hooks/cryptroot" +inst_hook pre-mount 50 "$dsrc/hooks/cryptroot.sh"
modules/90kernel-modules.sh renamed from modules/90kernel-modules +0 -0
modules/90lvm.sh renamed from modules/90lvm +0 -0
modules/95debug.sh renamed from modules/95debug +0 -0
modules/95terminfo.sh renamed from modules/95terminfo +0 -0
modules/95udev-rules.sh renamed from modules/95udev-rules +0 -0
modules/99base.sh renamed from modules/99base +2 -2
@@ -3,6 +3,6 @@ dracut_install mount mknod mkdir modprobe pidof sleep chroot echo sed sh ls # install our scripts and hooks inst "$initfile" "/init" inst "$switchroot" "/sbin/switch_root" -inst_hook pre-pivot 50 "$dsrc/hooks/selinux-loadpolicy" -inst_hook pre-mount 99 "$dsrc/hooks/resume" +inst_hook pre-pivot 50 "$dsrc/hooks/selinux-loadpolicy.sh" +inst_hook pre-mount 99 "$dsrc/hooks/resume.sh"
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html