summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJeff Bailey <jbailey@ubuntu.com>2005-06-30 00:05:01 +0000
committerJeff Bailey <jbailey@ubuntu.com>2005-06-30 00:05:01 +0000
commit2c72958bfc090b046e21e9eaad9134235095ad30 (patch)
tree572afb10c1ad810995fbaf51584bde090dd9288d /docs
parent8e6c20991ba676ce4c5b46094806c0317afd525a (diff)
downloadinitramfs-tools-2c72958bfc090b046e21e9eaad9134235095ad30.tar.gz
initramfs-tools-2c72958bfc090b046e21e9eaad9134235095ad30.zip
* Use detailed logging now for debian/changelog. We have at least
three people hacking now, and details would probably be useful. * debian/TODO: Update * debian/dirs: Sort and add usr/share/initramfs-tools/hooks * debian/initramfs-tools.examples: Add docs/example_hook and docs/example_hook_cpiogz * debian/initramfs-tools.install: Pretty Print. * debian/rules: Ensure that mkinitramfs is executable * docs/example_script: New file * init: Add concept of 'quiet', be verbose if not specified * mkinitramfs: Do not load script functions until needed Clear up comments / documentation Use DESTDIR instead of TMPDIR Add ability to link in extra hunks into the cpio file Cosmetic cleanups * scripts/functions: Add lsb stype log_FOO_msg functions * scripts/local: Add logging * scripts/nfs: Add logging
Diffstat (limited to 'docs')
-rw-r--r--docs/example_script73
1 files changed, 71 insertions, 2 deletions
diff --git a/docs/example_script b/docs/example_script
index 111b0d8..221c888 100644
--- a/docs/example_script
+++ b/docs/example_script
@@ -1,7 +1,52 @@
#!/bin/sh
-# List the soft prerequisites here. So if there's something you know
-# should be run first iff it exists.
+#
+# This script is run inside of the initramfs environment during the
+# system boot process. It is installed there by 'mkinitramfs'. The
+# package that owns it may opt to install it in either an appropriate
+# location under "/usr/share/initramfs-tools/scripts/", or a similar
+# location under "/etc/mkinitramfs/scripts/", depending upon whether
+# it should be considered to be a user modifiable conffile or not.
+#
+# TODO: How do we deal with the case where the package that installed
+# this has been removed but not purged, if we always arbitrarily
+# copy all of these scripts into the initramfs?
+#
+# * The available toolset is limited inside this environment...
+#
+# TODO: document that toolset in the man page.
+#
+# * /dev, /proc, and /sys are already mounted. / is a ?? ro/rw
+# filesystem... etc. more documentation.
+#
+# * It is expected that /proc and /sys will be umounted before
+# changing over to the real root file system, so you must not keep
+# any files open on them beyond these scripts.
+#
+# * You may like to strip these documentation comments from this
+# example if you take it for a template, to save a little space in
+# the initramfs, since nobody will ever read it from inside of
+# there anyhow.
+#
+
+#
+# The environment contains at least the following variables:
+#
+# TODO: Decide what environment variables are meaningful and defined
+# in this context, then document them as part of the interface.
+#
+# Because this script will be run as a full separate process, rather
+# than sourced inside the context of the driver script, if it needs to
+# pass information to another script that may run after it, it must do
+# so by writing data to a file location known to both scripts. Simply
+# setting an environment variable will not work.
+#
+
+#
+# List the soft prerequisites here. This is a space separated list of
+# names, of scripts that are in the same directory as this one, that
+# must be run before this one can be.
+#
PREREQ=""
prereqs()
@@ -18,4 +63,28 @@ prereqs)
esac
# Do the work here.
+
echo "Got here!"
+
+# Handle an error:
+
+if [ -n "$an_error_occured" ];
+then
+ #
+ # TODO: Do we need 'warn()', 'error()', and/or 'fatal()' for this?
+ # I think we ultimately do, and that they need to be in their own
+ # well-documented location so that an overlay can override them.
+ # Think 'usplash' progress updates.
+ #
+ echo "An error occured in $0: $an_error_occured" >&2
+ exit 1
+ #
+ # TODO: Decide if different error codes are meaningful, what they
+ # mean, and what the semantics of them are wrt 'init' pass
+ # or panic. Consider naming the error values with mnemonic
+ # symbols rather than magic numbers.
+ #
+fi
+
+exit 0
+