All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Split out the various things into their own modules.
@ 2009-02-13 12:37 Victor Lowther
       [not found] ` <62cc4ebce1de329352ba0a5434e20f38edcdad6f.1234528086.git.victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Victor Lowther @ 2009-02-13 12:37 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

This rips most of the dracut script out into seperate modules that the 
main dracut script then sources.

These patches apply on top of my previous patch series, and are available at
http://git.fnordovax.org/dracut in the generator-modularity branch

This should make it easier for distros to customize things according to
their preferences.
---
 dracut                   |   55 ++++-----------------------------------------
 dracut-functions         |   27 ++++++----------------
 modules/00dash           |    6 +++++
 modules/90crypt          |    2 +
 modules/90kernel-modules |    8 ++++++
 modules/90lvm            |    2 +
 modules/95debug          |    2 +
 modules/95terminfo       |    3 ++
 modules/95udev-rules     |    8 ++++++
 modules/99base           |   13 +++++++++++
 10 files changed, 56 insertions(+), 70 deletions(-)

diff --git a/dracut b/dracut
index c8550c7..fa3aafa 100755
--- a/dracut
+++ b/dracut
@@ -8,11 +8,13 @@
 # Copyright 2008, Red Hat, Inc.  Jeremy Katz <katzj-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
 # GPLv2 header here
 
+
 [ -f /etc/dracut.conf ] && . /etc/dracut.conf
 
 while (($# > 0)); do
     case $1 in
 	-f|--force) force=yes;;
+	-m|--modules) dracutmodules="$2"; shift;;
 	-h|--help) echo "Usage: $0 [-f] <initramfs> <kernel-version>"
 	    exit 1 ;;
 	-v|--verbose) set -x;;
@@ -22,6 +24,7 @@ while (($# > 0)); do
     esac
     shift
 done
+[[ $dracutmodules ]] || dracutmodules="all" 
 
 [[ $2 ]] && kernel=$2 || kernel=$(uname -r)
 [[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initrd-$kernel.img"
@@ -41,61 +44,13 @@ 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
+
 # Create some directory structure first
 for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot dev/pts; do 
     mkdir -p "$initdir/$d"; 
 done
 
-# executables that we have to have
-exe="bash mount mknod mkdir modprobe udevd udevadm nash pidof sleep chroot echo sed"
-lvmexe="lvm"
-cryptexe="cryptsetup"
-# and some things that are nice for debugging
-debugexe="ls ln ps grep more dmesg cat"
-# udev things we care about
-udevexe="/lib/udev/vol_id /lib/udev/console_init"
-
-# install base executables
-for binary in $exe $debugexe $udevexe $lvmexe $cryptexe ; do
-  inst $binary
-done
-
-# Prefer dash as /bin/sh if it is available.
-if [[ -f /bin/dash ]]; then
-    inst /bin/dash
-    ln -sf /bin/dash "${initdir}/bin/sh"
-fi
-
-# install our scripts and hooks
-inst "$initfile" "/init"
-inst "$switchroot" "/sbin/switch_root"
-for hookdir in $hookdirs; do
-    for hook in "$dsrc/$hookdir"/*; do
-	[[ -f $hook ]] && inst "$hook" "/$hookdir/${hook##*/}"
-    done
-done
-
-# FIXME: hard-coded module list of doom.
-[[ $modules ]] || modules="=ata =block =drm dm-crypt aes sha256 cbc"
-
-instmods $modules
-
-# Grab modules for all filesystem types we currently have mounted
-while read d mp t rest; do
-    instmods "$t"
-done </proc/mounts
-
-# FIXME: would be nice if we didn't have to know which rules to grab....
-# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
-# of the rules we want so that we just copy those in would be best
-mkdir -p "$initdir/lib/udev/rules.d"
-for rule in /lib/udev/rules.d/10-console* /lib/udev/rules.d/40-redhat* /lib/udev/rules.d/50* /lib/udev/rules.d/60-persistent-storage.rules /lib/udev/rules.d/61*edd* /lib/udev/rules.d/64* /lib/udev/rules.d/80* /lib/udev/rules.d/95* $rulesdir/*.rules ; do
-  cp "$rule" "$initdir/lib/udev/rules.d"
-done
-
-# terminfo bits make things work better if you fall into interactive mode
-for f in $(find /lib/terminfo -type f) ; do cp  --parents $f "$initdir" ; done
-
 # source any third-party package provided modules
 for f in "$dsrc/modules"/*; do
     [[ -x $f ]] && . "$f"
diff --git a/dracut-functions b/dracut-functions
index a0a1906..b410034 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -32,6 +32,7 @@ inst_simple() {
     local src=$1 target="${initdir}${2:-$1}"
     [[ -f $target ]] && return 0
     mkdir -p "${target%/*}"
+    echo "Installing $src" >&2
     cp -fL "$src" "$target"
 }
 
@@ -132,6 +133,12 @@ inst() {
     return 1
 }
 
+dracut_install() {
+    while (($# > 0)); do
+	inst "$1" && shift
+    done
+}
+
 modcat="/lib/modules/$kernel/modules"
 instmods() {
     local mod mpargs modpath modname cmd
@@ -163,24 +170,4 @@ instmods() {
     done
 } 
 
-findkeymap () {
-    local MAP=$1
-    [[ ! -f $MAP ]] && \
-	MAP=$(find /lib/kbd/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
-    [[ " $KEYMAPS " = *" $MAP "* ]] && return
-    KEYMAPS="$KEYMAPS $MAP"
-    case $MAP in
-        *.gz) cmd=zgrep;;
-        *.bz2) cmd=bzgrep;;
-        *) cmd=grep ;;
-    esac
-
-    for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
-        for FN in $(find /lib/kbd/keymaps -type f -name $INCL\*); do
-            findkeymap $FN
-        done
-    done
-}
-
-
 # vim:ts=8:sw=4:sts=4:et
diff --git a/modules/00dash b/modules/00dash
new file mode 100755
index 0000000..8af1e7c
--- /dev/null
+++ b/modules/00dash
@@ -0,0 +1,6 @@
+#!/bin/bash
+# Prefer dash as /bin/sh if it is available.
+if [[ -f /bin/dash ]]; then
+    inst /bin/dash
+    ln -sf /bin/dash "${initdir}/bin/sh"
+fi
\ No newline at end of file
diff --git a/modules/10redhat-i18n b/modules/10redhat-i18n
old mode 100644
new mode 100755
diff --git a/modules/90crypt b/modules/90crypt
new file mode 100755
index 0000000..e4f1876
--- /dev/null
+++ b/modules/90crypt
@@ -0,0 +1,2 @@
+#!/bin/bash
+inst cryptsetup
\ No newline at end of file
diff --git a/modules/90kernel-modules b/modules/90kernel-modules
new file mode 100755
index 0000000..8265b60
--- /dev/null
+++ b/modules/90kernel-modules
@@ -0,0 +1,8 @@
+#!/bin/bash
+# FIXME: hard-coded module list of doom.
+instmods ${modules:-=ata =block =drm dm-crypt aes sha256 cbc}
+
+# Grab modules for all filesystem types we currently have mounted
+while read d mp t rest; do
+    instmods "$t"
+done </proc/mounts
diff --git a/modules/90lvm b/modules/90lvm
new file mode 100755
index 0000000..d75062a
--- /dev/null
+++ b/modules/90lvm
@@ -0,0 +1,2 @@
+#!/bin/bash
+inst lvm
\ No newline at end of file
diff --git a/modules/95debug b/modules/95debug
new file mode 100755
index 0000000..4579212
--- /dev/null
+++ b/modules/95debug
@@ -0,0 +1,2 @@
+#!/bin/bash
+dracut_install ln ps grep more dmesg cat
\ No newline at end of file
diff --git a/modules/95terminfo b/modules/95terminfo
new file mode 100755
index 0000000..7f14aa1
--- /dev/null
+++ b/modules/95terminfo
@@ -0,0 +1,3 @@
+#!/bin/bash
+# terminfo bits make things work better if you fall into interactive mode
+dracut_install $(find /lib/terminfo -type f)
\ No newline at end of file
diff --git a/modules/95udev-rules b/modules/95udev-rules
new file mode 100755
index 0000000..50a69f8
--- /dev/null
+++ b/modules/95udev-rules
@@ -0,0 +1,8 @@
+#!/bin/bash
+# FIXME: would be nice if we didn't have to know which rules to grab....
+# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
+# of the rules we want so that we just copy those in would be best
+mkdir -p "$initdir/lib/udev/rules.d"
+for rule in /lib/udev/rules.d/10-console* /lib/udev/rules.d/40-redhat* /lib/udev/rules.d/50* /lib/udev/rules.d/60-persistent-storage.rules /lib/udev/rules.d/61*edd* /lib/udev/rules.d/64* /lib/udev/rules.d/80* /lib/udev/rules.d/95* $rulesdir/*.rules ; do
+  inst "$rule" "/lib/udev/rules.d/${rule##*/}"
+done
diff --git a/modules/99base b/modules/99base
new file mode 100755
index 0000000..c47f62b
--- /dev/null
+++ b/modules/99base
@@ -0,0 +1,13 @@
+#!/bin/bash
+dracut_install mount mknod mkdir modprobe udevd udevadm pidof sleep \
+	       chroot echo sed sh ls /lib/udev/vol_id /lib/udev/console_init
+
+# install our scripts and hooks
+inst "$initfile" "/init"
+inst "$switchroot" "/sbin/switch_root"
+for hookdir in $hookdirs; do
+    for hook in "$dsrc/$hookdir"/*; do
+	[[ -f $hook ]] && inst "$hook" "/$hookdir/${hook##*/}"
+    done
+done
+
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] Shift some functionality around, make modules maskable.
       [not found] ` <62cc4ebce1de329352ba0a5434e20f38edcdad6f.1234528086.git.victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2009-02-13 12:37   ` Victor Lowther
  2009-02-13 12:37   ` [PATCH 3/4] Modify hook loading to make it slightly easier to script Victor Lowther
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Victor Lowther @ 2009-02-13 12:37 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

Most of our functionality is now in scripts that we source rather than in the
main dracut script.
---
 dracut               |    9 ++++++---
 dracut-functions     |   20 ++++++++++++++++----
 modules/90crypt      |    3 ++-
 modules/90lvm        |    3 ++-
 modules/95udev-rules |    8 +++++---
 modules/99base       |    3 +--
 6 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/dracut b/dracut
index fa3aafa..1378268 100755
--- a/dracut
+++ b/dracut
@@ -51,9 +51,12 @@ for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot dev/pts; do
     mkdir -p "$initdir/$d"; 
 done
 
-# source any third-party package provided modules
-for f in "$dsrc/modules"/*; do
-    [[ -x $f ]] && . "$f"
+# source all our modules
+for f in "$dsrc/modules"/*[^~]; do
+    mod=${f##*/}; mod=${mod#[0-9][0-9]}
+    if [[ $dracutmodules = all ]] || strstr "$dracutmodules" "$mod"; then 
+	[[ -x $f ]] && . "$f"
+    fi
 done
 
 ## final stuff that has to happen
diff --git a/dracut-functions b/dracut-functions
index b410034..1923b26 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -25,6 +25,8 @@
 IF_RTLD=""
 IF_dynamic=""
 
+strstr() { [[ ! ${1#*$2*} = $1 ]]; }
+
 # $1 = file to copy to ramdisk
 # $2 (optional) Name for the file on the ramdisk
 # Location of the image dir is assumed to be $initdir
@@ -69,14 +71,16 @@ inst_binary() {
     [[ -f $initdir$target ]] && return 0
     # I love bash!
     while read line; do
-	[[ $line =~ '([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*|not found)' ]] || continue
-	FILE=${BASH_REMATCH[1]}
-        [[ $FILE = 'not found' ]] && {
+	[[ $line = 'not a dynamic executable' ]] && return 1
+	[[ $line =~ 'not found' ]] &&{
 	    echo "Missing a shared library required by $bin." >&2
 	    echo "Run \"ldd $bin\" to find out what it is." >&2
 	    echo "dracut cannot create an initrd." >&2
 	    exit 1
-	}
+	} 
+	[[ $line =~ '([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' ]] || continue
+	FILE=${BASH_REMATCH[1]}
+	[[ -f ${initdir}$FILE ]] && continue
 	# see if we are loading an optimized version of a shared lib.
 	[[ $FILE =~ '^(/lib[^/]*).*' ]] && {
             TLIBDIR=${BASH_REMATCH[1]}
@@ -115,6 +119,14 @@ inst_symlink() {
     inst "$realsrc" && ln -s "$realsrc" "$target"
 }
 
+# udev rules always get installed in the same place, so
+# create a function to install them to make life simpler.
+inst_rules() { 
+    for rule in "$@"; do 
+	inst_simple "$rule" "/lib/udev/rules.d/${rule##*/}"
+    done
+}
+
 # general purpose installation function
 # Same args as above.
 inst() {
diff --git a/modules/90crypt b/modules/90crypt
index e4f1876..e8f9269 100755
--- a/modules/90crypt
+++ b/modules/90crypt
@@ -1,2 +1,3 @@
 #!/bin/bash
-inst cryptsetup
\ No newline at end of file
+inst cryptsetup
+inst_rules "$dsrc/rules.d/63-luks.rules"
\ No newline at end of file
diff --git a/modules/90lvm b/modules/90lvm
index d75062a..315fbb8 100755
--- a/modules/90lvm
+++ b/modules/90lvm
@@ -1,2 +1,3 @@
 #!/bin/bash
-inst lvm
\ No newline at end of file
+inst lvm
+inst_rules "$dsrc/rules.d/64-lvm.rules"
\ No newline at end of file
diff --git a/modules/95udev-rules b/modules/95udev-rules
index 50a69f8..9801e7e 100755
--- a/modules/95udev-rules
+++ b/modules/95udev-rules
@@ -3,6 +3,8 @@
 # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
 # of the rules we want so that we just copy those in would be best
 mkdir -p "$initdir/lib/udev/rules.d"
-for rule in /lib/udev/rules.d/10-console* /lib/udev/rules.d/40-redhat* /lib/udev/rules.d/50* /lib/udev/rules.d/60-persistent-storage.rules /lib/udev/rules.d/61*edd* /lib/udev/rules.d/64* /lib/udev/rules.d/80* /lib/udev/rules.d/95* $rulesdir/*.rules ; do
-  inst "$rule" "/lib/udev/rules.d/${rule##*/}"
-done
+dracut_install udevd udevadm /lib/udev/*_id /lib/udev/console_*
+inst_rules /lib/udev/rules.d/10-console* /lib/udev/rules.d/40-redhat* \
+    /lib/udev/rules.d/50* /lib/udev/rules.d/60-persistent-storage.rules \
+    /lib/udev/rules.d/61*edd* /lib/udev/rules.d/64* /lib/udev/rules.d/80* \
+    /lib/udev/rules.d/95*
\ No newline at end of file
diff --git a/modules/99base b/modules/99base
index c47f62b..e1c699b 100755
--- a/modules/99base
+++ b/modules/99base
@@ -1,6 +1,5 @@
 #!/bin/bash
-dracut_install mount mknod mkdir modprobe udevd udevadm pidof sleep \
-	       chroot echo sed sh ls /lib/udev/vol_id /lib/udev/console_init
+dracut_install mount mknod mkdir modprobe pidof sleep chroot echo sed sh ls
 
 # install our scripts and hooks
 inst "$initfile" "/init"
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] Modify hook loading to make it slightly easier to script.
       [not found] ` <62cc4ebce1de329352ba0a5434e20f38edcdad6f.1234528086.git.victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2009-02-13 12:37   ` [PATCH 2/4] Shift some functionality around, make modules maskable Victor Lowther
@ 2009-02-13 12:37   ` Victor Lowther
  2009-02-13 12:37   ` [PATCH 4/4] Some documentation updates Victor Lowther
  2009-02-13 13:08   ` [PATCH 1/4] Split out the various things into their own modules Kay Sievers
  3 siblings, 0 replies; 7+ messages in thread
From: Victor Lowther @ 2009-02-13 12:37 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

Modules are now responsible for loading their hooks into the initrd.

This should be all the structure we need to make it easy for things
to integrate with dracut -- now to document and test it all.
---
 Makefile                                           |    8 ++++----
 dracut-functions                                   |   16 ++++++++++++++++
 pre-mount/50cryptroot => hooks/cryptroot           |    0
 pre-mount/99resume => hooks/resume                 |    0
 .../selinux-loadpolicy                             |    0
 modules/90crypt                                    |    3 ++-
 modules/99base                                     |    7 ++-----
 7 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 365cdf1..5d48a5f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,16 +4,16 @@ all:
 install:
 	mkdir -p $(DESTDIR)/usr/libexec/dracut
 	mkdir -p $(DESTDIR)/sbin
-	mkdir -p $(DESTDIR)/usr/libexec/dracut/pre-mount
-	mkdir -p $(DESTDIR)/usr/libexec/dracut/pre-udev
-	mkdir -p $(DESTDIR)/usr/libexec/dracut/pre-pivot
+	mkdir -p $(DESTDIR)/usr/libexec/dracut/hooks
+	mkdir -p $(DESTDIR)/usr/libexec/dracut/modules
 	install -m 0755 dracut $(DESTDIR)/sbin/dracut
 	install -m 0755 init $(DESTDIR)/usr/libexec/dracut/init
 	install -m 0755 switch_root $(DESTDIR)/usr/libexec/dracut/switch_root
 	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 hooks in pre-*/* ; do install -m 0755 $$hook $(DESTDIR/usr/libexec/dracut ; done
+	for hooks 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
 clean:
 	rm -f *~
 
diff --git a/dracut-functions b/dracut-functions
index 1923b26..852ce36 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -145,6 +145,22 @@ inst() {
     return 1
 }
 
+# install function specialized for hooks
+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook
+# All hooks should be POSIX/SuS compliant, they will be sourced by init.
+inst_hook() {
+    [[ -f $3 ]] || {
+	echo "Cannot install a hook ($3) that does not exist." >&2
+	echo "Aborting initrd creation." >&2
+	exit 1
+    }
+    strstr "$hookdirs" "$1" || {
+	echo "No such hook type $1. Aborting initrd creation." >&2
+	exit 1
+    }
+    inst_simple "$3" "/${1}/${2}${3##*/}"
+}
+
 dracut_install() {
     while (($# > 0)); do
 	inst "$1" && shift
diff --git a/pre-mount/50cryptroot b/hooks/cryptroot
similarity index 100%
rename from pre-mount/50cryptroot
rename to hooks/cryptroot
diff --git a/pre-mount/99resume b/hooks/resume
similarity index 100%
rename from pre-mount/99resume
rename to hooks/resume
diff --git a/pre-pivot/50selinux-loadpolicy b/hooks/selinux-loadpolicy
similarity index 100%
rename from pre-pivot/50selinux-loadpolicy
rename to hooks/selinux-loadpolicy
diff --git a/modules/90crypt b/modules/90crypt
index e8f9269..66d7e70 100755
--- a/modules/90crypt
+++ b/modules/90crypt
@@ -1,3 +1,4 @@
 #!/bin/bash
 inst cryptsetup
-inst_rules "$dsrc/rules.d/63-luks.rules"
\ No newline at end of file
+inst_rules "$dsrc/rules.d/63-luks.rules"
+inst_hook pre-mount 50 "$dsrc/hooks/cryptroot"
\ No newline at end of file
diff --git a/modules/99base b/modules/99base
index e1c699b..c746abc 100755
--- a/modules/99base
+++ b/modules/99base
@@ -4,9 +4,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"
-for hookdir in $hookdirs; do
-    for hook in "$dsrc/$hookdir"/*; do
-	[[ -f $hook ]] && inst "$hook" "/$hookdir/${hook##*/}"
-    done
-done
+inst_hook pre-pivot 50 "$dsrc/hooks/selinux-loadpolicy"
+inst_hook pre-mount 99 "$dsrc/hooks/resume"
 
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] Some documentation updates
       [not found] ` <62cc4ebce1de329352ba0a5434e20f38edcdad6f.1234528086.git.victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2009-02-13 12:37   ` [PATCH 2/4] Shift some functionality around, make modules maskable Victor Lowther
  2009-02-13 12:37   ` [PATCH 3/4] Modify hook loading to make it slightly easier to script Victor Lowther
@ 2009-02-13 12:37   ` Victor Lowther
  2009-02-13 13:08   ` [PATCH 1/4] Split out the various things into their own modules Kay Sievers
  3 siblings, 0 replies; 7+ messages in thread
From: Victor Lowther @ 2009-02-13 12:37 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

---
 HACKING |    1 -
 README  |   19 +++++++++++++++++++
 TODO    |   11 ++++-------
 3 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/HACKING b/HACKING
index 1e8111b..e9efe09 100644
--- a/HACKING
+++ b/HACKING
@@ -18,5 +18,4 @@ and set
 
 Requirements:
 * udev
-* plymouth > 0.6.0-2 (for encrypted root; otherwise, it should noop out)
 * nash (for switchroot until we get in util-linux)
diff --git a/README b/README
index 7749fdb..abc282a 100644
--- a/README
+++ b/README
@@ -19,6 +19,25 @@ we'll grow some hooks for running arbitrary commands in the flow of
 the script, but it's worth trying to resist the urge as much as we can
 as hooks are guaranteed to be the path to slow-down.
 
+Most of the initrd generation functionality in dracut is provided by a bunch
+of generator modules that are sourced by the main dracut script to install
+specific functionality into the initrd.  They live in the modules subdirectory,
+and use functionality provided by dracut-functions to do their work.
+Some general rules for writing modules:
+ * Use one of the inst family of functions to actually install files
+   on to the initrd.  They handle mangling the pathnames and (for binaries,
+   scripts, and kernel modules) installing dependencies as appropriate so
+   you do not have to.
+ * Scripts that end up on the initrd should be POSIX compliant. dracut
+   will try to use /bin/dash as /bin/sh for the initrd if it is available,
+   so you should install it on your system -- dash aims for strict POSIX
+   compliance to the extent possible.
+ * Hooks MUST be POSIX compliant -- they are sourced by the init script,
+   and having a bashism break your user's ability to boot really sucks.
+ * 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.
+
 Also, there is an attempt to keep things as distribution-agnostic as
 possible.  Every distribution has their own tool here and it's not
 something which is really interesting to have separate across them.
diff --git a/TODO b/TODO
index a59c869..e04be3a 100644
--- a/TODO
+++ b/TODO
@@ -16,15 +16,8 @@ the rules that we care about in the initramfs.  These could be
 symlinks/hardlinks to the main rules in some cases or special-cased
 ones
 * LVM activation by udev is a bit of a large hammer right now
-* dm-crypt (luks) depends on plymouth
-* plymouth is hard-coded... this may be reasonable as modesetting goes
-into the upstream kernel as a way to get off of fb-splash stuff, but I
-can see this being a point of contention for other distros
-  * plymouth --show-splash should be done as a udev rule so that we
-  can switch modes first
 * root= parsing should be done with udev creating /dev/root symlink
 for us appropriately
-* Support thaw (resume from hibernate)
 * Proving some support with a simple network based root would be good
   * Do we just call dhclient, etc or try to get NetworkManager going?
 * Would be nice not to have to kill and restart udev across switchroot 
@@ -40,3 +33,7 @@ GENERATOR TODO
 --------------
 * Default module specificatoin could use some work
 * udev rule copying, as mentioned above, is a bit too hard-coded
+* pkg-config integration, to make it easy for other packages to use us.
+* Autotool-izing the package is probably overkill, but making the Makefile
+  vaguely autotools-compatible and adding a configure script would probably
+  be a good thing.
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] Split out the various things into their own modules.
       [not found] ` <62cc4ebce1de329352ba0a5434e20f38edcdad6f.1234528086.git.victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2009-02-13 12:37   ` [PATCH 4/4] Some documentation updates Victor Lowther
@ 2009-02-13 13:08   ` Kay Sievers
       [not found]     ` <ac3eb2510902130508o3ea41614y12d9887ec605a912-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  3 siblings, 1 reply; 7+ messages in thread
From: Kay Sievers @ 2009-02-13 13:08 UTC (permalink / raw)
  To: Victor Lowther; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On Fri, Feb 13, 2009 at 13:37, Victor Lowther <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> This rips most of the dracut script out into seperate modules that the
> main dracut script then sources.

>  modules/00dash           |    6 +++++
>  modules/90crypt          |    2 +
>  modules/90kernel-modules |    8 ++++++
>  modules/90lvm            |    2 +
>  modules/95debug          |    2 +
>  modules/95terminfo       |    3 ++
>  modules/95udev-rules     |    8 ++++++
>  modules/99base           |   13 +++++++++++

Please add and require a file extension to all modules and all similar
to-be-looked-up files. Packages are expected to drop fiules here, and
it's a useless pain to filter-out editor files and package manager
left-over files.

The 80's are over, and this is a new project, so please let us not
repeat the crap many other projects are doing here. :)

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] Split out the various things into their own modules.
       [not found]     ` <ac3eb2510902130508o3ea41614y12d9887ec605a912-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-02-14 19:48       ` Victor Lowther
       [not found]         ` <1234640916.2658.2.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Victor Lowther @ 2009-02-14 19:48 UTC (permalink / raw)
  To: Kay Sievers; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On Fri, 2009-02-13 at 14:08 +0100, Kay Sievers wrote:
> On Fri, Feb 13, 2009 at 13:37, Victor Lowther <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > This rips most of the dracut script out into seperate modules that the
> > main dracut script then sources.
> 
> >  modules/00dash           |    6 +++++
> >  modules/90crypt          |    2 +
> >  modules/90kernel-modules |    8 ++++++
> >  modules/90lvm            |    2 +
> >  modules/95debug          |    2 +
> >  modules/95terminfo       |    3 ++
> >  modules/95udev-rules     |    8 ++++++
> >  modules/99base           |   13 +++++++++++
> 
> Please add and require a file extension to all modules and all similar
> to-be-looked-up files. Packages are expected to drop fiules here, and
> it's a useless pain to filter-out editor files and package manager
> left-over files.

what, like a .sh extension?

> The 80's are over, and this is a new project, so please let us not
> repeat the crap many other projects are doing here. :)

sorry, ms-dos and Windows gave me an irrational dislike of file
extensions.

> Thanks,
> Kay
-- 
Victor Lowther
RHCE# 805008539634727
LPIC-2# LPI000140019

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] Split out the various things into their own modules.
       [not found]         ` <1234640916.2658.2.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
@ 2009-02-15 14:38           ` Kay Sievers
  0 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2009-02-15 14:38 UTC (permalink / raw)
  To: Victor Lowther; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On Sat, Feb 14, 2009 at 20:48, Victor Lowther <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Fri, 2009-02-13 at 14:08 +0100, Kay Sievers wrote:
>> On Fri, Feb 13, 2009 at 13:37, Victor Lowther <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > This rips most of the dracut script out into seperate modules that the
>> > main dracut script then sources.
>>
>> >  modules/00dash           |    6 +++++
>> >  modules/90crypt          |    2 +
>> >  modules/90kernel-modules |    8 ++++++
>> >  modules/90lvm            |    2 +
>> >  modules/95debug          |    2 +
>> >  modules/95terminfo       |    3 ++
>> >  modules/95udev-rules     |    8 ++++++
>> >  modules/99base           |   13 +++++++++++
>>
>> Please add and require a file extension to all modules and all similar
>> to-be-looked-up files. Packages are expected to drop fiules here, and
>> it's a useless pain to filter-out editor files and package manager
>> left-over files.
>
> what, like a .sh extension?

Anything would work, I don't really mind: .dracut, .module, .mod, .inc. .sh, ...

>> The 80's are over, and this is a new project, so please let us not
>> repeat the crap many other projects are doing here. :)
>
> sorry, ms-dos and Windows gave me an irrational dislike of file
> extensions.

It's not about "identifying" content, like on MSDOS. It's about the
useless exercise to filter out unknown file patterns of
left-over/temporary files from editors and package managers. These
filters can never be complete, and stuff goes terribly wrong
sometimes, if these files are read as "normal" files. A simple file
extension will solve this problem without any guesswork, that's all.

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-15 14:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-13 12:37 [PATCH 1/4] Split out the various things into their own modules Victor Lowther
     [not found] ` <62cc4ebce1de329352ba0a5434e20f38edcdad6f.1234528086.git.victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-13 12:37   ` [PATCH 2/4] Shift some functionality around, make modules maskable Victor Lowther
2009-02-13 12:37   ` [PATCH 3/4] Modify hook loading to make it slightly easier to script Victor Lowther
2009-02-13 12:37   ` [PATCH 4/4] Some documentation updates Victor Lowther
2009-02-13 13:08   ` [PATCH 1/4] Split out the various things into their own modules Kay Sievers
     [not found]     ` <ac3eb2510902130508o3ea41614y12d9887ec605a912-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-14 19:48       ` Victor Lowther
     [not found]         ` <1234640916.2658.2.camel-76q0VzFBGGr21HsLBtNmTckMGDeJXHgy@public.gmane.org>
2009-02-15 14:38           ` Kay Sievers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.