From a4e74218bb310a99ca08226fdd1cc6808b770774 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Sat, 11 Mar 2017 19:18:25 +0100 Subject: [PATCH] new graphics driver submenu; https://github.com/Chrysostomus/manjaro-architect/issues/104 - still needs testing --- lib/util-desktop.sh | 1 + lib/util-menu.sh | 74 ++++++++++++++++++--------------------------- lib/util.sh | 3 ++ 3 files changed, 33 insertions(+), 45 deletions(-) diff --git a/lib/util-desktop.sh b/lib/util-desktop.sh index 676a7bc..3cb7626 100644 --- a/lib/util-desktop.sh +++ b/lib/util-desktop.sh @@ -19,6 +19,7 @@ setup_graphics_card() { clear arch_chroot "mhwd -f -i pci $(cat /tmp/.driver)" 2>$ERR check_for_error "install $(cat /tmp/.driver)" $? + touch /mnt/.video_installed GRAPHIC_CARD=$(lspci | grep -i "vga" | sed 's/.*://' | sed 's/(.*//' | sed 's/^[ \t]*//') diff --git a/lib/util-menu.sh b/lib/util-menu.sh index b0c08c8..137286c 100644 --- a/lib/util-menu.sh +++ b/lib/util-menu.sh @@ -171,57 +171,19 @@ config_base_menu() { done } -install_graphics_menu() { - local PARENT="$FUNCNAME" - declare -i loopmenu=1 - while ((loopmenu)); do - submenu 4 - DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_InstGrMenuBody" 0 0 4 \ - "1" "$_InstGrMenuDD" \ - "2" "$_PrepKBLayout" \ - "3" "$_InstDEStable|>" \ - "4" "$_Back" 2>${ANSWER} - HIGHLIGHT_SUB=$(cat ${ANSWER}) - - case $(cat ${ANSWER}) in - "1") setup_graphics_card - ;; - "2") set_xkbmap - ;; - "3") install_manjaro_de_wm_pkg - ;; - *) loopmenu=0 - return 0 - ;; - esac - done -} - install_drivers_menu() { - HIGHLIGHT_SUB=1 declare -i loopmenu=1 while ((loopmenu)); do - DIALOG " $_InstDrvTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_InstDrvBody" 0 0 5 \ - "1" "$_InstFree" \ - "2" "$_InstProp" \ - "3" "$_InstGrMenuDD|>" \ - "4" "$_InstNWDrv|>" \ - "5" "$_Back" 2>${ANSWER} + submenu 3 + DIALOG " $_InstDrvTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_InstDrvBody" 0 0 3 \ + "1" "$_InstGrMenuTitle|>" \ + "2" "$_InstNWDrv" \ + "3" "$_Back" 2>${ANSWER} - HIGHLIGHT_SUB=4 case $(cat ${ANSWER}) in - "1") clear - arch_chroot "mhwd -a pci free 0300" 2>$ERR - check_for_error "$_InstFree" $? + "1") install_graphics_menu ;; - "2") clear - arch_chroot "mhwd -a pci nonfree 0300" 2>$ERR - check_for_error "$_InstProp" $? - ;; - "3") setup_graphics_card - ;; - "4") setup_network_drivers - HIGHLIGHT_SUB=5 + "2") setup_network_drivers ;; *) HIGHLIGHT_SUB=5 loopmenu=0 @@ -231,6 +193,28 @@ install_drivers_menu() { done } +install_graphics_menu() { + DIALOG " $_InstGrMenuTitle " --menu "$_InstGrMenuBody" 0 0 3 \ + "1" "$_InstFree" \ + "2" "$_InstProp" \ + "3" "$_InstGrMenuDD" 2>${ANSWER} || return 0 + + case $(cat ${ANSWER}) in + "1") clear + arch_chroot "mhwd -a pci free 0300" 2>$ERR + check_for_error "$_InstFree" $? + touch /mnt/.video_installed + ;; + "2") clear + arch_chroot "mhwd -a pci nonfree 0300" 2>$ERR + check_for_error "$_InstProp" $? + touch /mnt/.video_installed + ;; + "3") setup_graphics_card + ;; + esac +} + edit_configs() { declare -i loopmenu=1 while ((loopmenu)); do diff --git a/lib/util.sh b/lib/util.sh index aa07575..edb638b 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -454,6 +454,9 @@ final_check() { # Check if fstab is generated $(grep -qv '^#' /mnt/etc/fstab 2>/dev/null) || echo "- Fstab has not been generated" >> ${CHECKLIST} + # Check if video-driver has been installed + [[ ! -e /mnt/.video_installed ]] && echo "- No graphics driver has been installed" >> ${CHECKLIST} + # Check if locales have been generated [[ $(manjaro-chroot /mnt 'locale -a' | wc -l) -ge '3' ]] || echo "- Locales have not been generated" >> ${CHECKLIST}