summaryrefslogtreecommitdiff
path: root/src/core/libs
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-07 13:48:22 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-07 13:48:22 +0100
commit2ee11ef334983fc68352364025ba5a97d795b95e (patch)
tree707761915488d25a4cc750f71ad761becbcf0753 /src/core/libs
parent306261a860d932335d5154bbefd8a99a1912e0e3 (diff)
also add lvm2 hook in target mkinitcpio.conf for non-root logical volumes
Diffstat (limited to 'src/core/libs')
-rw-r--r--src/core/libs/lib-ui-interactive.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 2cbf2a4..5be0bb0 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -34,15 +34,23 @@ prefill_configs () {
-e "s/^HARDWARECLOCK=.*/HARDWARECLOCK=\"$HARDWARECLOCK\"/g" \
${var_TARGET_DIR}/etc/rc.conf
- # prepare HOOKS in mkinitcpio.conf for lvm/dm_crypt users
+ # Give initcpio the encrypt hook when / depends on an encrypted volume
+ # (other encrypted volumes, not related to / don't need the encrypt hook, afaik)
+ # If / also depends on lvm, this way the lvm2 hook will also be included in the right place
if get_anchestors_mount ';/;'
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 "/^HOOKS/ s/filesystems/$hooks filesystems/" ${var_TARGET_DIR}/etc/mkinitcpio.conf
fi
+ # The lvm2 hook however is needed for any lvm LV, no matter the involved mountpoints, so include it if we still need to
+ if grep -q lvm-lv $TMP_BLOCKDEVICES && ! grep -q '^HOOKS.*lvm2' ${var_TARGET_DIR}/etc/mkinitcpio.conf
+ then
+ sed -i "/^HOOKS/ s/filesystems/lvm2 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`
+ if line=`grep '^HOOKS.*encrypt' ${var_TARGET_DIR}/etc/mkinitcpio.conf`
then
if ! echo "$line" | grep -q keymap
then