summaryrefslogtreecommitdiff
path: root/src/core/libs
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-07-26 20:37:19 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2009-07-26 20:37:19 +0200
commit8c3dcfcf7eb06a9768d2c9eb13adf7031b506272 (patch)
treeea7c2747e16b88c86ca0a9b012325f8683932dad /src/core/libs
parent3068d1897445701a7023606a8c708095803301b6 (diff)
automatically add keymap & usbinput to HOOKS if that seems useful
Diffstat (limited to 'src/core/libs')
-rw-r--r--src/core/libs/lib-ui-interactive.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index b975035..47c5e50 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -48,7 +48,19 @@ interactive_configure_system()
then
hooks=`echo "$ANSWER_DEVICES" | cut -d ' ' -f2 | egrep 'lvm-lv|dm_crypt' | sed -e 's/lvm-lv/lvm2/' -e 's/dm_crypt/encrypt/' | tac`
hooks=`echo $hooks`
- [ -n "$hooks" ] && sed -i "s/filesystems/$hooks filesystems/" ${var_TARGET_DIR}/etc/mkinitcpio.conf
+ [ -n "$hooks" ] && sed -i "/^HOOKS/ s/filesystems/$hooks filesystems/" ${var_TARGET_DIR}/etc/mkinitcpio.conf
+ fi
+ # if keymap/usbinput are not in mkinitcpio.conf, but encrypt is, we should probably add it
+ if line=`grep ^HOOKS ${var_TARGET_DIR}/etc/mkinitcpio.conf | grep encrypt`
+ then
+ if ! echo "$line" | grep -q keymap
+ then
+ sed -i '/^HOOKS/ s/encrypt/keymap encrypt/' ${var_TARGET_DIR}/etc/mkinitcpio.conf
+ fi
+ if ! echo "$line" | grep -q usbinput
+ then
+ sed -i '/^HOOKS/ s/keymap/usbinput keymap/' ${var_TARGET_DIR}/etc/mkinitcpio.conf
+ fi
fi
# main menu loop