|
|
|
@ -12,8 +12,8 @@
|
|
|
|
|
|
|
|
|
|
setup_graphics_card() {
|
|
|
|
|
# Main menu. Correct option for graphics card should be automatically highlighted.
|
|
|
|
|
DIALOG " $_InstGrDrv " --radiolist "$_InstDEBody\n\n$_UseSpaceBar" 0 0 12 \
|
|
|
|
|
$(mhwd -l | awk 'FNR>4 {print $1}' | awk 'NF' |awk '$0=$0" - off"') 2> /tmp/.driver || return 0
|
|
|
|
|
DIALOG " $_InstGrDrv " --radiolist "\n$_UseSpaceBar" 0 0 12 \
|
|
|
|
|
$(mhwd -l | awk '/video-/{print $1}' |awk '$0=$0" - off"') 2> /tmp/.driver || return 0
|
|
|
|
|
|
|
|
|
|
if [[ $(cat /tmp/.driver) != "" ]]; then
|
|
|
|
|
clear
|
|
|
|
@ -37,6 +37,21 @@ setup_graphics_card() {
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setup_network_drivers() {
|
|
|
|
|
# Main menu. Correct option for graphics card should be automatically highlighted.
|
|
|
|
|
DIALOG " $_InstGrDrv " --radiolist "\n$_UseSpaceBar" 0 0 12 \
|
|
|
|
|
$(mhwd -l | awk '/network-/{print $1}' |awk '$0=$0" - off"') 2> /tmp/.network_driver || return 0
|
|
|
|
|
|
|
|
|
|
if [[ $(cat /tmp/.driver) != "" ]]; then
|
|
|
|
|
clear
|
|
|
|
|
arch_chroot "mhwd -f -i pci $(cat /tmp/.network_driver)" 2>$ERR
|
|
|
|
|
check_for_error "install $(cat /tmp/.network_driver)" $?
|
|
|
|
|
else
|
|
|
|
|
DIALOG " $_ErrTitle " --msgbox "\n\nNo network driver selected\n" 0 0
|
|
|
|
|
check_for_error "No network-driver selected."
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
install_intel() {
|
|
|
|
|
sed -i 's/MODULES=""/MODULES="i915"/' ${MOUNTPOINT}/etc/mkinitcpio.conf
|
|
|
|
|
|
|
|
|
@ -115,96 +130,12 @@ install_manjaro_de_wm() {
|
|
|
|
|
target_desktop=$(echo $PROFILES/*/$(cat /tmp/.desktop)/Packages-Desktop)
|
|
|
|
|
|
|
|
|
|
# Parse package list based on user input and remove parts that don't belong to pacman
|
|
|
|
|
cat $PROFILES/shared/Packages-Root "$target_desktop" > /tmp/.edition
|
|
|
|
|
if [[ -e /mnt/.openrc ]]; then
|
|
|
|
|
evaluate_openrc
|
|
|
|
|
# Remove any packages tagged with >systemd and remove >openrc tags
|
|
|
|
|
sed -i '/>systemd/d' /tmp/.edition
|
|
|
|
|
sed -i 's/>openrc //g' /tmp/.edition
|
|
|
|
|
else
|
|
|
|
|
# Remove any packages tagged with >openrc and remove >systemd tags
|
|
|
|
|
sed -i '/>openrc/d' /tmp/.edition
|
|
|
|
|
sed -i 's/>systemd //g' /tmp/.edition
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ "$(uname -m)" == "x86_64" ]]; then
|
|
|
|
|
# Remove any packages tagged with >i686 and remove >x86_64 tags
|
|
|
|
|
sed -i '/>i686/d' /tmp/.edition
|
|
|
|
|
sed -i '/>nonfree_i686/d' /tmp/.edition
|
|
|
|
|
sed -i 's/>x86_64 //g' /tmp/.edition
|
|
|
|
|
else
|
|
|
|
|
# Remove any packages tagged with >x86_64 and remove >i686 tags
|
|
|
|
|
sed -i '/>x86_64/d' /tmp/.edition
|
|
|
|
|
sed -i '/>nonfree_x86_64/d' /tmp/.edition
|
|
|
|
|
sed -i 's/>i686 //g' /tmp/.edition
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# If multilib repo is enabled, install multilib packages
|
|
|
|
|
if grep -q "^[multilib]" ${MOUNTPOINT}/etc/pacman.conf ; then
|
|
|
|
|
# Remove >multilib tags
|
|
|
|
|
sed -i 's/>multilib //g' /tmp/.edition
|
|
|
|
|
sed -i 's/>nonfree_multilib //g' /tmp/.edition
|
|
|
|
|
else
|
|
|
|
|
# Remove lines with >multilib tag
|
|
|
|
|
sed -i '/>multilib/d' /tmp/.edition
|
|
|
|
|
sed -i '/>nonfree_multilib/d' /tmp/.edition
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if grep -q ">extra" /tmp/.edition;then
|
|
|
|
|
# User to select base|extra profile
|
|
|
|
|
DIALOG " $_ExtraTitle " --no-cancel --menu "\n$_ExtraBody" 0 0 2 \
|
|
|
|
|
"1" "full" \
|
|
|
|
|
"2" "minimal" 2>/tmp/.version
|
|
|
|
|
|
|
|
|
|
if [[ $(cat /tmp/.version) -eq 2 ]]; then
|
|
|
|
|
check_for_error "selected 'minimal' profile"
|
|
|
|
|
touch /tmp/.minimal
|
|
|
|
|
else
|
|
|
|
|
check_for_error "selected 'full' profile"
|
|
|
|
|
[[ -e /tmp/.minimal ]] && rm /tmp/.minimal
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ -e /tmp/.minimal ]]; then
|
|
|
|
|
# Remove >extra tags
|
|
|
|
|
sed -i 's/>basic //g' /tmp/.edition
|
|
|
|
|
sed -i '/>extra/d' /tmp/.edition
|
|
|
|
|
else
|
|
|
|
|
# Remove >basic tags
|
|
|
|
|
sed -i 's/>extra //g' /tmp/.edition
|
|
|
|
|
sed -i '/>basic/d' /tmp/.edition
|
|
|
|
|
fi
|
|
|
|
|
# remove >manjaro flags and >sonar flags+pkgs until we support it properly
|
|
|
|
|
sed -i '/>sonar/d' /tmp/.edition
|
|
|
|
|
sed -i 's/>manjaro //g' /tmp/.edition
|
|
|
|
|
# Remove commented lines
|
|
|
|
|
# remove everything except the first word of every lines
|
|
|
|
|
sed -i 's/\s.*$//' /tmp/.edition
|
|
|
|
|
# Remove lines with #
|
|
|
|
|
sed -i '/#/d' /tmp/.edition
|
|
|
|
|
# remove KERNEL variable
|
|
|
|
|
sed -i '/KERNEL/d' /tmp/.edition
|
|
|
|
|
# Remove empty lines
|
|
|
|
|
sed -i '/^\s*$/d' /tmp/.edition
|
|
|
|
|
|
|
|
|
|
# Remove base-devel and base packages. Base is already installed and base-devel should be decided by the user
|
|
|
|
|
# pacman -Sgq base-devel base openrc-base > /tmp/.notincluded
|
|
|
|
|
# grep -v -f /tmp/.notincluded /tmp/.edition | grep -v "base-devel" > /tmp/.tmp
|
|
|
|
|
# mv /tmp/.tmp /tmp/.edition
|
|
|
|
|
# Remove packages that have been dropped from repos
|
|
|
|
|
pacman -Ssq > /tmp/.available_packages
|
|
|
|
|
grep -f /tmp/.available_packages /tmp/.edition > /tmp/.tmp
|
|
|
|
|
mv /tmp/.tmp /tmp/.edition
|
|
|
|
|
# remove zsh
|
|
|
|
|
sed -i '/^zsh$/d' /tmp/.edition
|
|
|
|
|
|
|
|
|
|
check_for_error "packages to install: $(grep -v -f /mnt/.base /tmp/.edition | sort | uniq | tr '\n' ' ')"
|
|
|
|
|
|
|
|
|
|
filter_packages
|
|
|
|
|
clear
|
|
|
|
|
# remove already installed base pkgs and
|
|
|
|
|
# basestrap the parsed package list to the new root
|
|
|
|
|
basestrap -i ${MOUNTPOINT} $(grep -v -f /mnt/.base /tmp/.edition | sort | uniq) 2>$ERR
|
|
|
|
|
check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?"
|
|
|
|
|
basestrap ${MOUNTPOINT} $(cat /mnt/.base | sort | uniq) 2>$ERR
|
|
|
|
|
check_for_error "install pkgs: $(cat /mnt/.base | sort | uniq)" "$?"
|
|
|
|
|
|
|
|
|
|
# copy the profile overlay to the new root
|
|
|
|
|
echo "Copying overlay files to the new root"
|
|
|
|
@ -224,61 +155,7 @@ install_manjaro_de_wm() {
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
# Enable services in the chosen profile
|
|
|
|
|
echo "Enabling services"
|
|
|
|
|
if [[ -e /mnt/.openrc ]]; then
|
|
|
|
|
eval $(grep -e "enable_openrc=" $profile | sed 's/# //g')
|
|
|
|
|
echo "${enable_openrc[@]}" | xargs -n1 > /tmp/.services
|
|
|
|
|
echo /mnt/etc/init.d/* | xargs -n1 | cut -d/ -f5 > /tmp/.available_services
|
|
|
|
|
grep -f /tmp/.available_services /tmp/.services > /tmp/.fix && mv /tmp/.fix /tmp/.services
|
|
|
|
|
for service in $(cat /tmp/.services) ; do
|
|
|
|
|
arch_chroot "rc-update add $service default" 2>$ERR
|
|
|
|
|
check_for_error "enable $service" $?
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# enable display manager for openrc
|
|
|
|
|
if [[ "$(cat /tmp/.display-manager)" == sddm ]]; then
|
|
|
|
|
sed -i "s/$(grep "DISPLAYMANAGER=" /mnt/etc/conf.d/xdm)/DISPLAYMANAGER=\"sddm\"/g" /mnt/etc/conf.d/xdm
|
|
|
|
|
arch_chroot "rc-update add xdm default" 2>$ERR
|
|
|
|
|
check_for_error "add xdm default: sddm" "$?"
|
|
|
|
|
set_sddm_ck
|
|
|
|
|
elif [[ "$(cat /tmp/.display-manager)" == lightdm ]]; then
|
|
|
|
|
set_lightdm_greeter
|
|
|
|
|
sed -i "s/$(grep "DISPLAYMANAGER=" /mnt/etc/conf.d/xdm)/DISPLAYMANAGER=\"lightdm\"/g" /mnt/etc/conf.d/xdm
|
|
|
|
|
arch_chroot "rc-update add xdm default" 2>$ERR
|
|
|
|
|
check_for_error "add xdm default: lightdm" "$?"
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
check_for_error "no DM installed."
|
|
|
|
|
echo "no display manager was installed."
|
|
|
|
|
sleep 2
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
eval $(grep -e "enable_systemd=" $profile | sed 's/# //g')
|
|
|
|
|
echo "${enable_systemd[@]}" | xargs -n1 > /tmp/.services
|
|
|
|
|
echo /mnt/usr/lib/systemd/system/* | xargs -n1 | cut -d/ -f7 | sed 's/.service//g' > /tmp/.available_services
|
|
|
|
|
grep -f /tmp/.available_services /tmp/.services > /tmp/.fix && mv /tmp/.fix /tmp/.services
|
|
|
|
|
arch_chroot "systemctl enable $(cat /tmp/.services)" 2>$ERR
|
|
|
|
|
check_for_error "enable $(cat /tmp/.services)" $?
|
|
|
|
|
arch_chroot "systemctl disable pacman-init" 2>$ERR
|
|
|
|
|
check_for_error "disable pacman-init" $?
|
|
|
|
|
|
|
|
|
|
# enable display manager for systemd
|
|
|
|
|
if [[ "$(cat /tmp/.display-manager)" == lightdm ]]; then
|
|
|
|
|
set_lightdm_greeter
|
|
|
|
|
arch_chroot "systemctl enable lightdm" 2>$ERR
|
|
|
|
|
check_for_error "enable lightdm" "$?"
|
|
|
|
|
elif [[ "$(cat /tmp/.display-manager)" == sddm ]]; then
|
|
|
|
|
arch_chroot "systemctl enable sddm" 2>$ERR
|
|
|
|
|
check_for_error "enable sddm" "$?"
|
|
|
|
|
elif [[ "$(cat /tmp/.display-manager)" == gdm ]]; then
|
|
|
|
|
arch_chroot "systemctl enable gdm" 2>$ERR
|
|
|
|
|
check_for_error "enable gdm" "$?"
|
|
|
|
|
else
|
|
|
|
|
check_for_error "no DM installed."
|
|
|
|
|
echo "no display manager was installed"
|
|
|
|
|
sleep 2
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
enable_services
|
|
|
|
|
|
|
|
|
|
# Stop for a moment so user can see if there were errors
|
|
|
|
|
echo ""
|
|
|
|
@ -291,33 +168,7 @@ install_manjaro_de_wm() {
|
|
|
|
|
|
|
|
|
|
# Offer to install various "common" packages.
|
|
|
|
|
|
|
|
|
|
DIALOG " $_InstComTitle " --checklist "\n$_InstComBody\n\n$_UseSpaceBar" 0 50 20 \
|
|
|
|
|
"manjaro-settings-manager" "-" off \
|
|
|
|
|
"pamac" "-" off \
|
|
|
|
|
"octopi" "-" off \
|
|
|
|
|
"pacli" "-" off \
|
|
|
|
|
"pacui" "-" off \
|
|
|
|
|
"fish" "-" off \
|
|
|
|
|
"fisherman" "-" off \
|
|
|
|
|
"zsh" "-" on \
|
|
|
|
|
"zsh-completions" "-" on \
|
|
|
|
|
"manjaro-zsh-config" "-" on \
|
|
|
|
|
"grml-zsh-config" "-" off \
|
|
|
|
|
"mhwd-chroot" "-" off \
|
|
|
|
|
"bmenu" "-" on \
|
|
|
|
|
"clonezilla" "-" off \
|
|
|
|
|
"snapper" "-" off \
|
|
|
|
|
"snap-pac" "-" off \
|
|
|
|
|
"manjaro-tools-iso" "-" off \
|
|
|
|
|
"manjaro-tools-base" "-" off \
|
|
|
|
|
"manjaro-tools-pkg" "-" off 2>${PACKAGES}
|
|
|
|
|
|
|
|
|
|
# If at least one package, install.
|
|
|
|
|
if [[ $(cat ${PACKAGES}) != "" ]]; then
|
|
|
|
|
clear
|
|
|
|
|
basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
|
|
|
|
|
check_for_error "basestrap -i ${MOUNTPOINT} $(cat ${PACKAGES})" "$?"
|
|
|
|
|
fi
|
|
|
|
|
install_extra
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|