summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2010-02-11 19:31:31 +0100
committerThomas Bächler <thomas@archlinux.org>2010-02-11 19:31:31 +0100
commit0d755f3b5f96e9cf229c523cebcfb8c2379c1fd2 (patch)
tree31768b40897ce1d9ac3c2b22c1d8fcc89b6ecd23 /install
parent1a91e4fa8e2d9823082843e98021c3345f82f072 (diff)
parentd67250f427937cb4b6f75b27d47d35302bd9890b (diff)
downloadmkinitcpio-0d755f3b5f96e9cf229c523cebcfb8c2379c1fd2.tar.gz
mkinitcpio-0d755f3b5f96e9cf229c523cebcfb8c2379c1fd2.tar.xz
Merge branch 'kill-klibc'
Conflicts: Makefile
Diffstat (limited to 'install')
-rw-r--r--install/autodetect11
-rw-r--r--install/base26
-rw-r--r--install/consolefont31
-rw-r--r--install/firmware22
-rw-r--r--install/keymap31
-rw-r--r--install/net11
-rw-r--r--install/pcmcia6
-rw-r--r--install/raid39
-rw-r--r--install/udev28
9 files changed, 119 insertions, 86 deletions
diff --git a/install/autodetect b/install/autodetect
index 0010da3..6c9193c 100644
--- a/install/autodetect
+++ b/install/autodetect
@@ -20,10 +20,13 @@ install ()
if [ ${UID} -eq 0 -o "$(groups | grep disk)" != "" ]; then
for fs in $(findfs | sort | uniq); do
- for mod in $(find "${MODULEDIR}" -type f -name "${fs}.ko"); do
- if [ -n "${mod}" ]; then
- AUTODETECT="${AUTODETECT} ${mod}"
- fi
+ allfs="${fs} $(modprobe --set-version ${KERNELVERSION} --resolve-alias ${fs})"
+ for mod in ${allfs}; do
+ for modfile in $(find "${MODULEDIR}" -type f -name "${mod}.ko"); do
+ if [ -n "${modfile}" ]; then
+ AUTODETECT="${AUTODETECT} ${modfile}"
+ fi
+ done
done
done
diff --git a/install/base b/install/base
index 0fdc120..ff1be88 100644
--- a/install/base
+++ b/install/base
@@ -5,24 +5,22 @@ install ()
add_dir "/proc"
add_dir "/sys"
add_dir "/dev"
+ add_dir "/bin"
+ add_dir "/sbin"
+ add_dir "/lib"
+ add_dir "/usr"
+ add_dir "/usr/bin"
+ add_dir "/usr/lib"
+ add_dir "/usr/sbin"
add_device "/dev/null" c 1 3
add_device "/dev/zero" c 1 5
add_device "/dev/console" c 5 1
add_device "/dev/mem" c 1 1
- for f in $(find /lib -name klibc-*.so); do
- add_file ${f}
- done
-
- for f in /usr/lib/klibc/bin/*; do
- add_file ${f} /bin/$(basename ${f})
- done
- for f in /usr/lib/klibc/sbin/*; do
- add_file ${f} /sbin/$(basename ${f})
- done
- # add symlink for compatibility
- add_symlink2 /bin/modprobe /sbin/modprobe
+ add_binary /lib/initcpio/busybox /bin/busybox
+ add_binary /sbin/modprobe
+ add_binary /sbin/blkid
add_file "/lib/initcpio/init_functions" "/init_functions"
add_file "/lib/initcpio/init" "/init"
@@ -39,7 +37,7 @@ help ()
{
cat <<HELPEOF
This hook sets up all initial directories and installs base
- klibc utilities and libraries. DO NOT remove this one unless
- you know what you're doing.
+ utilities. DO NOT remove this one unless you know what you're
+ doing.
HELPEOF
}
diff --git a/install/consolefont b/install/consolefont
new file mode 100644
index 0000000..67777b8
--- /dev/null
+++ b/install/consolefont
@@ -0,0 +1,31 @@
+# vim: set ft=sh:
+
+install ()
+{
+ MODULES=""
+ BINARIES=""
+ FILES=""
+ SCRIPT="consolefont"
+ if [ -n "$CONSOLEFONT" ]; then
+ CONSOLEFONT_FILE_GZ="/usr/share/kbd/consolefonts/$CONSOLEFONT.psfu.gz"
+ if [ -e ${CONSOLEFONT_FILE_GZ} ]; then
+ CONSOLEFONT_FILE="$(mktemp ${TMPDIR}/consolefont.psfu.XXXXXX)"
+ zcat ${CONSOLEFONT_FILE_GZ} > ${CONSOLEFONT_FILE}
+ add_file ${CONSOLEFONT_FILE} /consolefont.psfu
+ else
+ echo "consolefont: Font file does not exist or does not end with .psfu.gz"
+ echo "consolefont: Only unicode fonts are supported at the moment."
+ fi
+ fi
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook loads consolefont specified in mkinitcpio.conf
+ during early userspace.
+ You should add CONSOLEFONT="font" (same syntax as in rc.conf) to your
+ mkinitcpio.conf. You may also remove the CONSOLEFONT from rc.conf
+ to prevent the font from being set twice and speed up your boot proccess.
+HELPEOF
+}
diff --git a/install/firmware b/install/firmware
deleted file mode 100644
index d03e274..0000000
--- a/install/firmware
+++ /dev/null
@@ -1,22 +0,0 @@
-# vim: set ft=sh:
-
-install ()
-{
- MODULES=""
- BINARIES=""
- FILES=""
- SCRIPT=""
- if [ -d /lib/firmware ]; then
- add_full_dir /lib/firmware
- else
- err "No firmware files found!"
- fi
-}
-
-help ()
-{
-cat<<HELPEOF
- This hook adds the firmware files that are placed at /lib/firmware/
- to the image.
-HELPEOF
-}
diff --git a/install/keymap b/install/keymap
new file mode 100644
index 0000000..65990dd
--- /dev/null
+++ b/install/keymap
@@ -0,0 +1,31 @@
+# vim: set ft=sh:
+
+install ()
+{
+ MODULES=""
+ BINARIES=""
+ FILES=""
+ SCRIPT="keymap"
+ eval "$(grep -e "^LOCALE=" -e "^KEYMAP=" /etc/rc.conf)"
+ if [ -n "$KEYMAP" ]; then
+ KEYMAP_FILE="$(mktemp ${TMPDIR}/keymap.XXXXXX)"
+ UTF8_FILE="$(mktemp ${TMPDIR}/keymap.XXXXXX)"
+ if [ -n "$(echo ${LOCALE} | grep -i utf)" ]; then
+ echo "UTF8='yes'" > ${UTF8_FILE}
+ /bin/loadkeys -q -u $KEYMAP -b > ${KEYMAP_FILE}
+ else
+ echo "UTF8='no'" > ${UTF8_FILE}
+ /bin/loadkeys -q $KEYMAP -b > ${KEYMAP_FILE}
+ fi
+ add_file ${KEYMAP_FILE} /keymap.bin
+ add_file ${UTF8_FILE} /keymap.utf8
+ fi
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook loads keymap(s) specified in rc.conf
+ during early userspace.
+HELPEOF
+}
diff --git a/install/net b/install/net
index 69359e9..7b31c09 100644
--- a/install/net
+++ b/install/net
@@ -6,7 +6,10 @@ install ()
BINARIES=""
FILES=""
- SCRIPT=""
+ SCRIPT="net"
+
+ add_binary "/lib/initcpio/ipconfig" "/bin/ipconfig"
+ add_binary "/lib/initcpio/nfsmount" "/bin/nfsmount"
}
help ()
@@ -97,10 +100,10 @@ cat<<HELPEOF
acdirmin = 30
acdirmax = 60
flags = hard, nointr, noposix, cto, ac
-
+
root=/dev/nfs
-
- If you don't use nfsroot= parameter you need to set root=/dev/nfs
+
+ If you don't use nfsroot= parameter you need to set root=/dev/nfs
to boot from a nfs root by autoconfiguration.
HELPEOF
}
diff --git a/install/pcmcia b/install/pcmcia
index b17ad27..8b685c5 100644
--- a/install/pcmcia
+++ b/install/pcmcia
@@ -5,13 +5,13 @@ install ()
MODULES=" $(checked_modules '/pcmcia/' | grep -ve 'sound' -e 'net') $(checked_modules '/ide/legacy')"
MODULES=$(echo ${MODULES}) #trim whitespace
if [ -n "${MODULES}" ]; then
- MODULES="${MODULES} sd_mod sr_mod ide-gd_mod ide-cd_mod"
+ MODULES="${MODULES} sd_mod"
fi
BINARIES=""
FILES="/etc/pcmcia/config.opts"
SCRIPT=""
- add_file "/lib/udev/pcmcia-socket-startup.static" "/lib/udev/pcmcia-socket-startup"
- add_file "/lib/udev/pcmcia-check-broken-cis.static" "/lib/udev/pcmcia-check-broken-cis"
+ add_binary "/lib/udev/pcmcia-socket-startup"
+ add_binary "/lib/udev/pcmcia-check-broken-cis"
add_file "/lib/udev/rules.d/60-pcmcia.rules"
}
diff --git a/install/raid b/install/raid
deleted file mode 100644
index 0b227d2..0000000
--- a/install/raid
+++ /dev/null
@@ -1,39 +0,0 @@
-# vim: set ft=sh:
-
-install ()
-{
- MODULES=" $(checked_modules "drivers/md/*" | grep -v "dm-") "
- BINARIES=""
- FILES=""
- SCRIPT="raid"
- add_file "/usr/lib/klibc/bin/mdassemble" "/bin/mdassemble"
-}
-
-help ()
-{
-cat<<HELPEOF
- This hook loads the necessary modules for an raid root device,
- and assemble the raid device when run.
-
- Kernel Parameters:
- Specify all your md arrays with md= parameter:
- ::: Example ::: md=0,/dev/sda3,/dev/sda4 md=1,/dev/hda1,/dev/hdb1
- This will setup 2 md arrays with persistent superblocks
-
- Setup:
- - for old raid arrays without persistent superblocks:
- md=<md device no.>,<raid level>,<chunk size factor>,<fault level>,dev0,dev1
- - for raid arrays with persistent superblocks:
- md=<md device no.>,dev0,dev1,...,devn
-
- Parameters:
- - <md device no.> = the number of the md device:
- 0 means md0, 1 means md1, ...
- - <raid level> = -1 linear mode, 0 striped mode
- other modes are only supported with persistent super block
- - <chunk size factor> = (raid-0 and raid-1 only):
- Set the chunk size as 4k << n.
- - <fault level> = totally ignored
- - <dev0-devn>: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
-HELPEOF
-}
diff --git a/install/udev b/install/udev
new file mode 100644
index 0000000..17a82c9
--- /dev/null
+++ b/install/udev
@@ -0,0 +1,28 @@
+# vim:set ft=sh:
+
+install ()
+{
+ MODULES=""
+ BINARIES=""
+ FILES=" /etc/udev/udev.conf"
+ SCRIPT="udev"
+ add_binary /sbin/udevd
+ add_binary /sbin/udevadm
+ for rules in 50-firmware.rules 50-udev-default.rules 60-persistent-storage.rules 80-drivers.rules; do
+ add_file /lib/udev/rules.d/${rules}
+ done
+ for tool in firmware; do
+ add_file /lib/udev/${tool}
+ done
+ add_file /lib/initcpio/udev/load-modules.sh /lib/udev/load-modules.sh
+}
+
+help ()
+{
+cat <<HELPEOF
+ This hook will use udev to create your root device node
+ and detect the needed modules for your root device. It
+ is also required for firmware loading in initramfs.
+ It is recommended to use this hook.
+HELPEOF
+}