diff options
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/kernelextras | 44 | ||||
-rwxr-xr-x | hooks/keymap | 55 | ||||
-rwxr-xr-x | hooks/legacylvm | 28 | ||||
-rwxr-xr-x | hooks/thermal | 43 | ||||
-rwxr-xr-x | hooks/udevhelper | 36 |
5 files changed, 206 insertions, 0 deletions
diff --git a/hooks/kernelextras b/hooks/kernelextras new file mode 100755 index 0000000..714e9a9 --- /dev/null +++ b/hooks/kernelextras @@ -0,0 +1,44 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hooks for loading extra kernel bits into the initramfs + +. /usr/share/initramfs-tools/hook-functions + +fbcon=n + +for x in ${MODULESDIR}/initrd/*; do + x=${x##*/} + x=${x%.*} + case ${x} in + '*') + break + ;; + *fb) + fbcon=y + ;; + esac + + force_load ${x} +done + +# And add vga16fb for usplash to use as well +manual_add_modules vga16fb + +if [ ${fbcon} = "y" ]; then + force_load fbcon +fi diff --git a/hooks/keymap b/hooks/keymap new file mode 100755 index 0000000..a2b1b08 --- /dev/null +++ b/hooks/keymap @@ -0,0 +1,55 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hook to load keymaps into the initramfs if requested by KEYMAP="y" +if [ "$KEYMAP" != "y" ] && [ "$KEYMAP" != "Y" ]; then + exit 0 +fi + +# Step 1 - Basic tools +if [ ! -x /bin/loadkeys ] || [ ! -r /etc/console/boottime.kmap.gz ]; then + exit 0 +fi + +. /usr/share/initramfs-tools/hook-functions +copy_exec /bin/loadkeys /bin +cp /etc/console/boottime.kmap.gz ${DESTDIR}/etc/ + +# Step 2 - Check for UTF8 console +if [ ! -x /usr/bin/kbd_mode ]; then + exit 0 +fi + +if [ -r /etc/environment ]; then + env="/etc/environment" +elif [ -r /etc/default/locale ]; then + env="/etc/default/locale" +else + exit 0 +fi + +for var in LANG LC_ALL LC_CTYPE; do + value=$(egrep "^[^#]*${var}=" $env | tail -n1 | cut -d= -f2) + eval $var=$value +done + +charmap=$(LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap) +if [ "$charmap" = "UTF-8" ]; then + copy_exec /usr/bin/kbd_mode /bin +fi +exit 0 + diff --git a/hooks/legacylvm b/hooks/legacylvm new file mode 100755 index 0000000..9121f90 --- /dev/null +++ b/hooks/legacylvm @@ -0,0 +1,28 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# FIXME: Remove this hook after Lenny releases +. /usr/share/initramfs-tools/hook-functions + +if [ -x /sbin/vgchange ] && [ -d /lib/lvm-200 ] \ + && [ ! -f /usr/share/initramfs-tools/hooks/lvm2 ]; then + copy_exec /lib/lvm-200/vgchange /sbin + for x in dm_mod dm_snapshot dm_mirror; do + manual_add_modules ${x} + done +fi +exit 0 diff --git a/hooks/thermal b/hooks/thermal new file mode 100755 index 0000000..ece7243 --- /dev/null +++ b/hooks/thermal @@ -0,0 +1,43 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hooks for loading thermal bits into the initramfs + +. /usr/share/initramfs-tools/hook-functions + +case "$DPKG_ARCH" in +# copy the right modules +powerpc|ppc64) + manual_add_modules therm_pm72 + manual_add_modules windfarm_core + manual_add_modules windfarm_cpufreq_clamp + manual_add_modules windfarm_lm75_sensor + manual_add_modules windfarm_max6690_sensor + manual_add_modules windfarm_pid + manual_add_modules windfarm_pm112 + manual_add_modules windfarm_pm81 + manual_add_modules windfarm_pm91 + manual_add_modules windfarm_smu_controls + manual_add_modules windfarm_smu_sat + manual_add_modules windfarm_smu_sensors + manual_add_modules i2c-powermac + ;; +i386|amd64|ia64) + manual_add_modules fan + manual_add_modules thermal + ;; +esac diff --git a/hooks/udevhelper b/hooks/udevhelper new file mode 100755 index 0000000..f86e4af --- /dev/null +++ b/hooks/udevhelper @@ -0,0 +1,36 @@ +#!/bin/sh +# FIXME: kill after lenny release +# needed for UUID root and partial etch upgrades +# +PREREQ="udev" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +# should never happen +if [ ! -e $DESTDIR/lib/udev/ ]; then + exit 0 +fi + +# fixed udev hook +if [ -e $DESTDIR/lib/udev/ ] && [ -e $DESTDIR/lib/udev/hotplug.functions ]; then + exit 0 +fi + +cp /lib/udev/hotplug.functions $DESTDIR/lib/udev/ +for program in /lib/udev/*_id; do + copy_exec $program /lib/udev/ +done +exit 0 |