Commit ea9eecca authored by Bernhard Landauer's avatar Bernhard Landauer

add lvm/luks hooks as needed

parent e0e276f3
......@@ -290,6 +290,13 @@ install_base() {
[[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == nilfs2 ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf && \
check_for_error "root on nilfs2 volume. amend mkinitcpio."
# add luks and lvm hooks as needed
([[ $LVM -eq 1 ]] && [[ $LUKS -eq 0 ]]) && { sed -i 's/block filesystems/block lvm2 filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR; check_for_error "add lvm2 hook" $?; }
([[ $LVM -eq 0 ]] && [[ $LUKS -eq 1 ]]) && { sed -i 's/block filesystems/block encrypt filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR; check_for_error "add luks hook" $?; }
[[ $((LVM + LUKS)) -eq 2 ]] && { sed -i 's/block filesystems/block encrypt lvm2 filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR; check_for_error "add lvm/luks hooks" $?; }
[[ $((LVM + LUKS)) -gt 0 ]] && { arch_chroot "mkinitcpio -P" 2>$ERR; check_for_error "re-run mkinitcpio" $?; }
# Use mhwd to install selected kernels with right kernel modules
# This is as of yet untested
# arch_chroot "mhwd-kernel -i $(cat ${PACKAGES} | xargs -n1 | grep -f /tmp/.available_kernels | xargs)"
......@@ -522,17 +529,6 @@ generate_fstab() {
fi
}
run_mkinitcpio() {
clear
# If LVM and/or LUKS used, add the relevant hook(s)
([[ $LVM -eq 1 ]] && [[ $LUKS -eq 0 ]]) && { sed -i 's/block filesystems/block lvm2 filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR || check_for_error "lVM2 hooks" $?; }
([[ $LVM -eq 1 ]] && [[ $LUKS -eq 1 ]]) && { sed -i 's/block filesystems/block encrypt lvm2 filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR || check_for_error "lVM/LUKS hooks" $?; }
([[ $LVM -eq 0 ]] && [[ $LUKS -eq 1 ]]) && { sed -i 's/block filesystems/block encrypt filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR || check_for_error "LUKS hooks" $?; }
arch_chroot "mkinitcpio -P" 2>$ERR
check_for_error "$FUNCNAME" "$?"
}
# locale array generation code adapted from the Manjaro 0.8 installer
set_locale() {
LOCALES=""
......
edit_mkinitcpio(){
nano "${MOUNTPOINT}/etc/mkinitcpio.conf"
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n${_RunMkinit}?\n " 0 0 && run_mkinitcpio
}
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n${_RunMkinit}?\n " 0 0 && { arch_chroot "mkinitcpio -P" 2>$ERR; check_for_error "run mkinitcpio" $?; }
edit_grub(){
nano "${MOUNTPOINT}/etc/default/grub"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment