From d6cab7d8820ff9bce57b79f4144be2a06f96d6a8 Mon Sep 17 00:00:00 2001 From: beliys Date: Mon, 14 Jun 2021 12:21:28 +0300 Subject: [PATCH] change default 60-ioscheduler.rules with modern recommendations (fix https://gitlab.manjaro.org/applications/manjaro-architect/-/issues/293) --- lib/util-advanced.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/util-advanced.sh b/lib/util-advanced.sh index 6ee31d6..8ac93d9 100644 --- a/lib/util-advanced.sh +++ b/lib/util-advanced.sh @@ -72,7 +72,7 @@ rm_pgs(){ chroot_interactive() { -DIALOG " $_EnterChroot " --infobox "$_ChrootReturn" 0 0 +DIALOG " $_EnterChroot " --infobox "$_ChrootReturn" 0 0 echo "" echo "" arch_chroot bash @@ -131,7 +131,7 @@ install_vanilla_de_wm() { *) loopmenu=0 return 0 ;; - esac + esac done } @@ -235,7 +235,7 @@ install_de_wm() { # If at least one package, install. if [[ $(cat ${PACKAGES}) != "" ]]; then clear - + if $hostcache; then basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR else @@ -302,7 +302,7 @@ enable_dm() { check_for_error "add default xdm" "$?" DM=$(cat ${PACKAGES}) DM_ENABLED=1 - else + else # enable display manager for systemd arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR check_for_error "enable $(cat ${PACKAGES})" "$?" @@ -315,7 +315,7 @@ install_network_menu() { declare -i loopmenu=1 while ((loopmenu)); do local PARENT="$FUNCNAME" - + submenu 5 DIALOG " $_InstNMMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_InstNMMenuBody\n " 0 0 5 \ "1" "$_SeeWirelessDev" \ @@ -437,7 +437,7 @@ enable_nm() { if [[ -e /mnt/.openrc ]]; then arch_chroot "rc-update add $(cat ${PACKAGES}) default" 2>$ERR check_for_error "add default $(cat ${PACKAGES})." $? - else + else arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR check_for_error "enable $(cat ${PACKAGES})." $? fi @@ -663,7 +663,7 @@ TTYPath=/dev/tty12" >> /mnt/etc/systemd/jounald.conf sed -i '/MaxLevelConsole/ s/#//' /mnt/etc/systemd/journald.conf } -enable_hibernation() { +enable_hibernation() { if DIALOG " Hibernation setup " --yesno "\nAre you sure you want to enable hibernation automatically? \n " 0 0; then if ! [[ -e /mnt/etc/fstab ]]; then generate_fstab @@ -688,12 +688,12 @@ enable_autologin() { autologin_user=$(echo /mnt/home/* | cut -d/ -f4 | fzf --reverse --prompt="user> " --header="Choose the user to automatically log in") fi #enable autologin - case "$(echo $dm)" in + case "$(echo $dm)" in gdm) sed -i "s/^AutomaticLogin=*/AutomaticLogin=$autologin_user/g" /mnt/etc/gdm/custom.conf sed -i 's/^AutomaticLoginEnable=*/AutomaticLoginEnable=true/g' /mnt/etc/gdm/custom.conf sed -i 's/^TimedLoginEnable=*/TimedLoginEnable=true/g' /mnt/etc/gdm/custom.conf sed -i 's/^TimedLogin=*/TimedLoginEnable=$autologin_user/g' /mnt/etc/gdm/custom.conf - sed -i 's/^TimedLoginDelay=*/TimedLoginDelay=0/g' /mnt/etc/gdm/custom.conf + sed -i 's/^TimedLoginDelay=*/TimedLoginDelay=0/g' /mnt/etc/gdm/custom.conf ;; lightdm) sed -i "s/^#autologin-user=/autologin-user=$autologin_user/" /mnt/etc/lightdm/lightdm.conf sed -i 's/^#autologin-user-timeout=0/autologin-user-timeout=0/' /mnt/etc/lightdm/lightdm.conf @@ -716,12 +716,12 @@ fi set_schedulers() { [[ -e /mnt/etc/udev/rules.d/60-ioscheduler.rules ]] || \ - echo '# set scheduler for non-rotating disks -# noop and deadline are recommended for non-rotating disks -# for rotational disks, cfq gives better performance and bfq-sq more responsive desktop environment -ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline" + echo '# set scheduler for NVMe +ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none" +# set scheduler for SSD and eMMC +ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline" # set scheduler for rotating disks -ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq-sq"' > /mnt/etc/udev/rules.d/60-ioscheduler.rules +ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"' > /mnt/etc/udev/rules.d/60-ioscheduler.rules nano /mnt/etc/udev/rules.d/60-ioscheduler.rules }