corrections install_base

merge-requests/273/head
Bernhard Landauer 7 years ago
parent 96b91e4f7b
commit 21544d086f

@ -235,89 +235,90 @@ install_base() {
"yaourt + base-devel" "-" off \
$(cat /tmp/.available_kernels | awk '$0=$0" - off"') 2>${PACKAGES} || return 0
cat ${PACKAGES} | sed 's/+ \|\"//g' | tr ' ' '\n' >> /mnt/.base
check_for_error "selected: $(cat ${PACKAGES})"
if [[ $(cat ${PACKAGES}) == "" ]]; then
# Check to see if a kernel is already installed
ls ${MOUNTPOINT}/boot/*.img >/dev/null 2>&1
if [[ $? != 0 ]]; then
if [[ $? == 0 ]]; then
DIALOG " kernel check " --msgbox "\nlinux-$(ls ${MOUNTPOINT}/boot/*.img | cut -d'-' -f2 | grep -v ucode.img) detected \n " 0 0
check_for_error "linux-$(ls ${MOUNTPOINT}/boot/*.img | cut -d'-' -f2) already installed"
else
DIALOG " $_ErrTitle " --msgbox "\n$_ErrNoKernel\n " 0 0
check_for_error "no kernel installed."
return 0
else
DIALOG " kernel check " --msgbox "\nlinux-$(ls ${MOUNTPOINT}/boot/*.img | cut -d'-' -f2) detected \n " 0 0
check_for_error "linux-$(ls ${MOUNTPOINT}/boot/*.img | cut -d'-' -f2) already installed"
fi
else
check_for_error "selected: $(cat ${PACKAGES})"
# Choose wanted kernel modules
DIALOG " $_ChsAddPkgs " --checklist "\n$_UseSpaceBar\n " 0 0 12 \
"KERNEL-headers" "-" off \
"KERNEL-acpi_call" "-" on \
"KERNEL-ndiswrapper" "-" on \
"KERNEL-broadcom-wl" "-" off \
"KERNEL-r8168" "-" off \
"KERNEL-rt3562sta" "-" off \
"KERNEL-tp_smapi" "-" off \
"KERNEL-vhba-module" "-" off \
"KERNEL-virtualbox-guest-modules" "-" off \
"KERNEL-virtualbox-host-modules" "-" off \
"KERNEL-spl" "-" off \
"KERNEL-zfs" "-" off 2>/tmp/.modules
if [[ $(cat /tmp/.modules) != "" ]]; then
echo " " >> /mnt/.base
check_for_error "modules: $(cat /tmp/.modules)"
for kernel in $(cat ${PACKAGES} | grep -vE '(yaourt|base-devel)'); do
cat /tmp/.modules | sed "s/KERNEL/\n$kernel/g" >> /mnt/.base
done
echo " " >> /mnt/.base
fi
clear
echo "" > /tmp/.desktop
filter_packages
check_for_error "packages to install: $(cat /mnt/.base | tr '\n' ' ')"
basestrap ${MOUNTPOINT} $(cat /mnt/.base) 2>$ERR
check_for_error "install basepkgs" $?
# If root is on btrfs volume, amend mkinitcpio.conf
[[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == btrfs ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf && \
check_for_error "root on btrfs volume. amend mkinitcpio."
# If root is on nilfs2 volume, amend mkinitcpio.conf
[[ $(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."
# 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)"
# If the virtual console has been set, then copy config file to installation
if [[ -e /tmp/vconsole.conf ]]; then
if [[ -e /mnt/.openrc ]]; then
cp -f /tmp/keymap ${MOUNTPOINT}/etc/conf.d/keymaps
arch_chroot "rc-update add keymaps boot"
cp -f /tmp/consolefont ${MOUNTPOINT}/etc/conf.d/consolefont
arch_chroot "rc-update add consolefont boot"
else
cp -f /tmp/vconsole.conf ${MOUNTPOINT}/etc/vconsole.conf
check_for_error "copy vconsole.conf" $?
fi
fi
check_for_error "selected: $(cat ${PACKAGES})"
# Choose wanted kernel modules
DIALOG " $_ChsAddPkgs " --checklist "\n$_UseSpaceBar\n " 0 0 12 \
"KERNEL-headers" "-" off \
"KERNEL-acpi_call" "-" on \
"KERNEL-ndiswrapper" "-" on \
"KERNEL-broadcom-wl" "-" off \
"KERNEL-r8168" "-" off \
"KERNEL-rt3562sta" "-" off \
"KERNEL-tp_smapi" "-" off \
"KERNEL-vhba-module" "-" off \
"KERNEL-virtualbox-guest-modules" "-" off \
"KERNEL-virtualbox-host-modules" "-" off \
"KERNEL-spl" "-" off \
"KERNEL-zfs" "-" off 2>/tmp/.modules || return 0
if [[ $(cat /tmp/.modules) != "" ]]; then
echo " " >> /mnt/.base
check_for_error "modules: $(cat /tmp/.modules)"
for kernel in $(cat ${PACKAGES} | grep -vE '(yaourt|base-devel)'); do
cat /tmp/.modules | sed "s/KERNEL/\n$kernel/g" >> /mnt/.base
done
echo " " >> /mnt/.base
fi
clear
echo "" > /tmp/.desktop
filter_packages
check_for_error "packages to install: $(cat /mnt/.base | tr '\n' ' ')"
basestrap ${MOUNTPOINT} $(cat /mnt/.base) 2>$ERR
check_for_error "install basepkgs" $?
# If root is on btrfs volume, amend mkinitcpio.conf
[[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == btrfs ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf && \
check_for_error "root on btrfs volume. amend mkinitcpio."
# If root is on nilfs2 volume, amend mkinitcpio.conf
[[ $(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."
# 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)"
# If the virtual console has been set, then copy config file to installation
if [[ -e /tmp/vconsole.conf ]]; then
if [[ -e /mnt/.openrc ]]; then
cp -f /tmp/keymap ${MOUNTPOINT}/etc/conf.d/keymaps
arch_chroot "rc-update add keymaps boot"
cp -f /tmp/consolefont ${MOUNTPOINT}/etc/conf.d/consolefont
arch_chroot "rc-update add consolefont boot"
else
cp -f /tmp/vconsole.conf ${MOUNTPOINT}/etc/vconsole.conf
check_for_error "copy vconsole.conf" $?
fi
fi
# If specified, copy over the pacman.conf file to the installation
if [[ $COPY_PACCONF -eq 1 ]]; then
cp -f /etc/pacman.conf ${MOUNTPOINT}/etc/pacman.conf
check_for_error "copy pacman.conf" $?
fi
# If specified, copy over the pacman.conf file to the installation
if [[ $COPY_PACCONF -eq 1 ]]; then
cp -f /etc/pacman.conf ${MOUNTPOINT}/etc/pacman.conf
check_for_error "copy pacman.conf" $?
fi
# if branch was chosen, use that also in installed system. If not, use the system setting
[[ -z $(ini branch) ]] && ini branch $(ini system.branch)
sed -i "s/Branch =.*/Branch = $(ini branch)/;s/# //" ${MOUNTPOINT}/etc/pacman-mirrors.conf
# if branch was chosen, use that also in installed system. If not, use the system setting
[[ -z $(ini branch) ]] && ini branch $(ini system.branch)
sed -i "s/Branch =.*/Branch = $(ini branch)/;s/# //" ${MOUNTPOINT}/etc/pacman-mirrors.conf
touch /mnt/.base_installed
check_for_error "base installed succesfully."
install_network_drivers
fi
touch /mnt/.base_installed
check_for_error "base installed succesfully."
install_network_drivers
}
install_bootloader() {

Loading…
Cancel
Save