summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-04-26 00:51:44 +0200
committerAaron Griffin <aaron@archlinux.org>2006-04-26 00:51:44 +0200
commit0a28a95f49eaeb33487c21995c71b5ca74df131e (patch)
treeb61e928dfed751ae443bafeea7c76adff73257e3
parentd323115c7b1a02244a52e298d83be8a390dbcc28 (diff)
downloadmkinitcpio-0a28a95f49eaeb33487c21995c71b5ca74df131e.tar.gz
mkinitcpio-0a28a95f49eaeb33487c21995c71b5ca74df131e.tar.xz
Add: filesystem autodetection
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@19 880c04e9-e011-0410-abf7-b926e227c9cd
-rw-r--r--install/filesystems-auto17
-rw-r--r--mkinitcpio12
-rw-r--r--mkinitcpio.conf2
3 files changed, 24 insertions, 7 deletions
diff --git a/install/filesystems-auto b/install/filesystems-auto
new file mode 100644
index 0000000..bf7976c
--- /dev/null
+++ b/install/filesystems-auto
@@ -0,0 +1,17 @@
+# vim: set ft=sh:
+
+install ()
+{
+ MODULES=" $(cat /proc/filesystems | grep -v nodev) "
+ BINARIES=""
+ FILES=""
+ SCRIPT="filesystems"
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook is responsible for loading filesystems for the root device.
+ Detection will be done at runtime.
+HELPEOF
+}
diff --git a/mkinitcpio b/mkinitcpio
index 0ddf4a4..115e1b1 100644
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -16,6 +16,7 @@
# Settings
BASEDIR=""
+FILELIST=".tmpfilelist"
KERNELVERSION="$(uname -r)"
FUNCTIONS="functions" #/lib/initramfs/functions
CONFIG="mkinitcpio.conf"
@@ -33,23 +34,23 @@ usage ()
echo "${APPNAME}: usage"
echo " -c CONFIG Use CONFIG file. default: /etc/mkinitcpio.conf"
echo " -k KERNELVERSION Use KERNELVERSION. default: $(uname -r)"
- echo " -s Save filelist. default: no"
+ echo " -s NAME Save filelist. default: no"
echo " -b BASEDIR Use BASEDIR. default: /"
echo " -g IMAGE Generate a cpio image as IMAGE. default: no"
- echo " -a Append to an existing filelist. default: no"
+ echo " -a NAME Append to an existing filelist. default: no"
echo " -q Quiet output. Default: no"
echo " -h This message."
exit 1
}
-while getopts 'c:k:sb:g:aqh' arg; do
+while getopts 'c:k:s:b:g:a:qh' arg; do
case "$arg" in
c) CONFIG="$OPTARG" ;;
k) KERNELVERSION="$OPTARG" ;;
- s) SAVELIST="y" ;;
+ s) SAVELIST="y"; FILELIST="$OPTARG" ;;
b) BASEDIR="$OPTARG" ;;
g) GENIMG="$OPTARG" ;;
- a) APPEND="y" ;;
+ a) APPEND="y" FILELIST="$OPTARG" ;;
q) QUIET="y" ;;
h|?) usage ;;
*) echo "invalid argument '$arg'"; usage ;;
@@ -63,7 +64,6 @@ if [ "${BASEDIR:${#BASEDIR}}" == "/" ]; then
fi
MODULEDIR="${BASEDIR}/lib/modules/${KERNELVERSION}"
-FILELIST=${1:-"initcpio.filelist"}
if [ "x${BASEDIR}" != "x" ]; then
if [ "${BASEDIR:0:1}" != "/" ]; then
diff --git a/mkinitcpio.conf b/mkinitcpio.conf
index 392467d..07e738b 100644
--- a/mkinitcpio.conf
+++ b/mkinitcpio.conf
@@ -2,4 +2,4 @@ MODULES="8139too snd_intel8x0"
BINARIES="grep"
FILES=""
-HOOKS="base ide filesystems"
+HOOKS="base ide filesystems-auto"