change default 60-ioscheduler.rules with modern recommendations (fix https://gitlab.manjaro.org/applications/manjaro-architect/-/issues/293)

merge-requests/273/head
beliys 3 years ago
parent 81e77ca1a6
commit d6cab7d882

@ -72,7 +72,7 @@ rm_pgs(){
chroot_interactive() { chroot_interactive() {
DIALOG " $_EnterChroot " --infobox "$_ChrootReturn" 0 0 DIALOG " $_EnterChroot " --infobox "$_ChrootReturn" 0 0
echo "" echo ""
echo "" echo ""
arch_chroot bash arch_chroot bash
@ -131,7 +131,7 @@ install_vanilla_de_wm() {
*) loopmenu=0 *) loopmenu=0
return 0 return 0
;; ;;
esac esac
done done
} }
@ -235,7 +235,7 @@ install_de_wm() {
# If at least one package, install. # If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then if [[ $(cat ${PACKAGES}) != "" ]]; then
clear clear
if $hostcache; then if $hostcache; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR
else else
@ -302,7 +302,7 @@ enable_dm() {
check_for_error "add default xdm" "$?" check_for_error "add default xdm" "$?"
DM=$(cat ${PACKAGES}) DM=$(cat ${PACKAGES})
DM_ENABLED=1 DM_ENABLED=1
else else
# enable display manager for systemd # enable display manager for systemd
arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR
check_for_error "enable $(cat ${PACKAGES})" "$?" check_for_error "enable $(cat ${PACKAGES})" "$?"
@ -315,7 +315,7 @@ install_network_menu() {
declare -i loopmenu=1 declare -i loopmenu=1
while ((loopmenu)); do while ((loopmenu)); do
local PARENT="$FUNCNAME" local PARENT="$FUNCNAME"
submenu 5 submenu 5
DIALOG " $_InstNMMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_InstNMMenuBody\n " 0 0 5 \ DIALOG " $_InstNMMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_InstNMMenuBody\n " 0 0 5 \
"1" "$_SeeWirelessDev" \ "1" "$_SeeWirelessDev" \
@ -437,7 +437,7 @@ enable_nm() {
if [[ -e /mnt/.openrc ]]; then if [[ -e /mnt/.openrc ]]; then
arch_chroot "rc-update add $(cat ${PACKAGES}) default" 2>$ERR arch_chroot "rc-update add $(cat ${PACKAGES}) default" 2>$ERR
check_for_error "add default $(cat ${PACKAGES})." $? check_for_error "add default $(cat ${PACKAGES})." $?
else else
arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR
check_for_error "enable $(cat ${PACKAGES})." $? check_for_error "enable $(cat ${PACKAGES})." $?
fi fi
@ -663,7 +663,7 @@ TTYPath=/dev/tty12" >> /mnt/etc/systemd/jounald.conf
sed -i '/MaxLevelConsole/ s/#//' /mnt/etc/systemd/journald.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 DIALOG " Hibernation setup " --yesno "\nAre you sure you want to enable hibernation automatically? \n " 0 0; then
if ! [[ -e /mnt/etc/fstab ]]; then if ! [[ -e /mnt/etc/fstab ]]; then
generate_fstab 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") autologin_user=$(echo /mnt/home/* | cut -d/ -f4 | fzf --reverse --prompt="user> " --header="Choose the user to automatically log in")
fi fi
#enable autologin #enable autologin
case "$(echo $dm)" in case "$(echo $dm)" in
gdm) sed -i "s/^AutomaticLogin=*/AutomaticLogin=$autologin_user/g" /mnt/etc/gdm/custom.conf 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/^AutomaticLoginEnable=*/AutomaticLoginEnable=true/g' /mnt/etc/gdm/custom.conf
sed -i 's/^TimedLoginEnable=*/TimedLoginEnable=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/^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 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 sed -i 's/^#autologin-user-timeout=0/autologin-user-timeout=0/' /mnt/etc/lightdm/lightdm.conf
@ -716,12 +716,12 @@ fi
set_schedulers() { set_schedulers() {
[[ -e /mnt/etc/udev/rules.d/60-ioscheduler.rules ]] || \ [[ -e /mnt/etc/udev/rules.d/60-ioscheduler.rules ]] || \
echo '# set scheduler for non-rotating disks echo '# set scheduler for NVMe
# noop and deadline are recommended for non-rotating disks ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none"
# for rotational disks, cfq gives better performance and bfq-sq more responsive desktop environment # set scheduler for SSD and eMMC
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline" ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline"
# set scheduler for rotating disks # 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 nano /mnt/etc/udev/rules.d/60-ioscheduler.rules
} }

Loading…
Cancel
Save