diff options
-rw-r--r-- | hooks/keymap | 21 | ||||
-rw-r--r-- | install/firmware | 24 | ||||
-rw-r--r-- | install/keymap | 43 | ||||
-rw-r--r-- | install/udev | 1 |
4 files changed, 89 insertions, 0 deletions
diff --git a/hooks/keymap b/hooks/keymap new file mode 100644 index 0000000..d00df9b --- /dev/null +++ b/hooks/keymap @@ -0,0 +1,21 @@ +# vim: set ft=sh: +run_hook () +{ + msg -n ":: Loading keymap..." + . /keymap + if [ "$KEYMAP" != "" ]; then + /bin/loadkeys -q $KEYMAP + fi + # If locale is *.utf set console to Unicode mode + if [ "$UTF8" = "yes" ]; then + /bin/kbd_mode -u + /bin/dumpkeys | /bin/loadkeys --unicode + echo -ne "\e%G" >> /dev/console + fi + if [ "$CONSOLEMAP" != "" ]; then + /bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/console + else + /bin/setfont $CONSOLEFONT -C /dev/console + fi + msg "done." +} diff --git a/install/firmware b/install/firmware new file mode 100644 index 0000000..ca78b80 --- /dev/null +++ b/install/firmware @@ -0,0 +1,24 @@ +# vim: set ft=sh: + +install () +{ + MODULES="" + BINARIES="" + FILES="" + SCRIPT="" + if [ -e /lib/firmware ]; then + for i in /lib/firmware/*; do + add_file $i + done + 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..03c5a98 --- /dev/null +++ b/install/keymap @@ -0,0 +1,43 @@ +# vim: set ft=sh: + +install () +{ + MODULES="" + BINARIES="" + FILES="" + SCRIPT="keymap" + KEYMAP_FILE="$(mktemp /tmp/keymap.XXXXXX)" + add_file /bin/loadkeys /bin/loadkeys + add_file /usr/bin/dumpkeys.static /bin/dumpkeys + add_file /usr/bin/kbd_mode.static /bin/kdb_mode + add_file /usr/bin/setfont.static /bin/setfont + grep "KEYMAP=" /etc/rc.conf >> ${KEYMAP_FILE} + grep "CONSOLEFONT=" /etc/rc.conf >> ${KEYMAP_FILE} + grep "CONSOLEMAP=" /etc/rc.conf >> ${KEYMAP_FILE} + if [ "`echo $LOCALE | /bin/grep -i utf`" ]; then + echo UTF8="yes" >> ${KEYMAP_FILE} + fi + . ${KEYMAP_FILE} + add_file ${KEYMAP_FILE} /keymap + [ "$CONSOLEFONT" != "" ] && add_file /usr/share/kbd/consolefonts/$(grep "CONSOLEFONT=" /etc/rc.conf | awk -FCONSOLEFONT= '{print $2}')* + [ "$CONSOLEMAP" != "" ] && add_file /usr/share/kbd/unimaps/$(grep "CONSOLEMAP=" /etc/rc.conf | awk -FCONSOLEMAP= '{print $2}')* + if [ "$KEYMAP" != "" ]; then + for i in $(find /usr/share/kbd/ -name "$(grep "KEYMAP=" /etc/rc.conf | awk -FKEYMAP= '{print $2}' | awk -F- '{print $1}')*.map.gz") + do add_file $i + done + for i in $(echo /usr/share/kbd/keymaps/include/*); do + add_file $i + done + for i in $(echo /usr/share/kbd/keymaps/*/include/*); do + add_file $i + done + fi +} + +help () +{ +cat<<HELPEOF + This hook loads the specified keymap and consolefont from rc.conf, + during early userspace. +HELPEOF +} diff --git a/install/udev b/install/udev index bfe4a1b..a6a75ea 100644 --- a/install/udev +++ b/install/udev @@ -12,6 +12,7 @@ install () add_file /lib/initcpio/udev/udev.rules /etc/udev/rules.d/udev.rules add_file /lib/initcpio/udev/start_udev /etc/start_udev add_file /lib/initcpio/udev/modalias_ieee1394 /lib/udev/modalias_ieee1394 + add_file /lib/initcpio/udev/firmware_helper /lib/udev/firmware_helper } help () |