OSDN Git Service

Tearfree config creation and nvidia driver an installer flag
authornatemaia <natemaia10@gmail.com>
Mon, 28 Oct 2019 01:06:20 +0000 (18:06 -0700)
committernatemaia <natemaia10@gmail.com>
Mon, 28 Oct 2019 01:06:20 +0000 (18:06 -0700)
archlabs-installer

index 1904d82..3d66e48 100755 (executable)
@@ -8,7 +8,7 @@
 # check for syntax errors
 # set -n
 
-VER=2.0.95
+VER=2.0.96
 
 # default values {
 
@@ -24,6 +24,7 @@ ERR=/tmp/errlog                    # stderr log used internally by errshow()
 DBG=/tmp/debuglog                  # debug log file when passed -d
 RUN=/run/archiso/bootmnt/arch/boot # path for live system /boot
 VM="$(dmesg | grep -i hypervisor)" # system running in a virtual machine
+TEARFREE=""                        # whether to install xorg configs and nvidia drivers
 EXMNTS=""                          # extra partitions that were mounted, used to verify mountpoint and show user
 FORMATTED=""                       # partitions that have been formatted, allows skipping the format step
 USER_CMD=""                        # optional command(s) entered by the user to run in the chroot
@@ -1163,7 +1164,7 @@ install_main()
        [[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" "$MNT/etc/fstab"
        install_packages
        # tear free configs, MUST be done after package install for nvidia
-       install_tearfree_conf "$MNT/etc/X11/xorg.conf.d"
+       [[ $TEARFREE ]] && install_tearfree_conf "$MNT/etc/X11/xorg.conf.d"
        install_mkinitcpio
        install_boot
        chrun "hwclock --systohc --utc" || chrun "hwclock --systohc --utc --directisa"
@@ -2297,7 +2298,7 @@ live()
        pacman -Scc --noconfirm
        rm -rf /var/cache/pacman/pkg/*
        cp -rfT /etc/skel /root
-       install_tearfree_conf "/etc/X11/xorg.conf.d"
+       [[ $TEARFREE ]] && install_tearfree_conf "/etc/X11/xorg.conf.d"
        case "$ses" in
                plasma|gnome|cinnamon) sed -i '/super/d; /nitrogen/d; /compton/d' /root/.xprofile ;;
                dwm) sed -i '/super/d; /compton/d' /root/.xprofile ;;
@@ -2315,9 +2316,12 @@ usage()
        usage: $1 [-hdl] [session]
 
        options:
-               -h, --help     print this message and exit
-               -l, --live     install and setup a live session
-               -d, --debug    enable xtrace and log output to $DBG
+               -h, --help      print this message and exit
+               -l, --live      install and setup a live session
+               -d, --debug     enable xtrace and log output to $DBG
+               -t, --tearfree  install and setup drivers for nvidia or tearfree xorg configs for other vendors
+                                               if you experience boot issues with this option you can remove
+                                                   /etc/X11/xorg.conf.d/20-*.conf
 
        sessions:
                i3-gaps  - A fork of i3wm with more features including gaps
@@ -2553,10 +2557,11 @@ fi
 # trap ^C to perform cleanup
 trap 'printf "\n^C\n" && die 1' INT
 
-while getopts ":hl:d" OPT; do
+while getopts ":htl:d" OPT; do
        case "$OPT" in
                d) debug ;;
                h) usage "$0" ;;
+               t) TEARFREE=true ;;
                l)
                        if [[ "${!WM_SESSIONS[@]}" =~ $OPTARG ]]; then
                                live "$OPTARG"