Arch Linux

System Software

https://gist.github.com/mattiaslundberg/8620837

Disk

  • 650MB EFI
  • 250MB boot
  • + root

cryptsetup -c aes-xts-plain64 -y --key-size 512 -y --use-random luksFormat /dev/nvme0n1p3

$[Get Code]12

Keyboard

setxkbmap -print

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us(dvorak)+inet(evdev)+compose(ralt)"   };
    xkb_geometry  { include "dell(dellm65)" };
};

Volume keys

Set in @@xfce4-keyboard-settings@

XF86AudioMute : pactl set-sink-mute 0 toggle

XF86AudioLowerVolume : pactl set-sink-volume 0 -5%

XF86AudioRaiseVolume : pactl set-sink-volume 0 +5%

Locale

Edit /etc/locale.gen

Run sudo locale-gen

Display Manager

LightDM

Switch the default login screen keyboard layout.

For lightdm: /etc/lightdm.conf.d/00-keyboard.conf

[SeatDefaults]
display-setup-script/=usr/bin/setxkbmap dvorak

Add the ~layout indicator to /etc/lightdm/lightdm-gtk-greeter.conf:

[greeter]
indicators = ~host;~spacer;~language;~layout;~session;~a11;~clock;~power

Suspend to RAM

Default sleep state was C2 (idle) instead of C3 (deep).

For testing:

echo "deep" > /sys/power/mem_sleep

$[Get Code]17

To make it permanent fix the kernel parameters /etc/default/grub:

GRUB_CMDLINE_DEFAULT="quiet mem_sleep_default=deep"

Remake the grub config:

grub-mkconfig -o /boot/grub/grub.cfg

$[Get Code]18

Debugging sleep using echo 1 > /sys/power/pm_trace produces a hang on resume.

Bluetooth

Suffers from issues after suspend.

Replace the Linux firmware blobs with those from the Windows driver.

https://www.dell.com/support/home/uk/en/ukbsdt1/drivers/driversdetails?driverId=1JVK3

unzip Killer-Wireless-AC-1525-1535-1435-Bluetooth-Driver\_1JVK3\_WIN\_10.0.0.448\_A07.EXE
sudo cp /lib/firmware/qca/nvm\_usb\_00000302.bin /lib/firmware/qca/nvm\_usb\_00000302.bin.orig
sudo cp /lib/firmware/qca/rampatch\_usb\_00000302.bin /lib/firmware/qca/rampatch\_usb\_00000302.bin.orig

sudo cp ./drivers/Production/Windows10-x64/Bluetooth_driver/ramps\_0x00000302\_48.dfu /lib/firmware/qca/nvm\_usb\_00000302.bin
sudo cp ./drivers/Production/Windows10-x64/Bluetooth_driver/AthrBT_0x00000302.dfu /lib/firmware/qca/rampatch\_usb\_00000302.bin




gnome@canard:/lib/firmware/qca$ md5sum *000302*
067fb95e8501bad2683df07d23539e7d  nvm_usb_00000302.bin
b3e2784b16b5b0cf5defa7eb9115956d  nvm_usb_00000302.bin.orig
47ed34d8b6af11d71036aa44314e32d3  rampatch_usb_00000302.bin
86c377ab7b2c24cc12cea5e79f71d610  rampatch_usb_00000302.bin.orig

Boot Recovery After Systemd 240 bug

Systemd 240 update introduced a bug in which luks hooks ran before keyboard drivers were loaded resulting in a LUKS password prompt without any means to type the password.

Recovery involved:

  • Boot from the archiso USB stick
  • chroot into system
  • update mkinitcpio
  • fix EFI boot

Arch chroot

After booting from archiso USB:

Decrypt and mount:

cd /mnt
mkdir root
cryptsetup open /dev/nvme0n1p3 cryptroot
mount /dev/mapper/vg0-root /mnt/root

Mount extra bits for chroot:

cd /mnt
mkdir root/hostrun
mount --bind /run root/hostrun
arch-chroot ./root

Within the chroot set up other mounts:

# mkinitcpio hooks need to see this
chroot$ mount --bind /hostrun/lvm /run/lvm 
chroot$ mount /boot

Update mkinitcpio

Update mkinitcpio to move keyboard hook immediately after udev:

vim /etc/mkinitcpio.conf
+ HOOKS=(base udev keyboard autodetect modconf block keymap encrypt lvm2 resume filesystems)
+ ## systemd version
+ #HOOKS=(base systemd keyboard autodetect modconf block sd-vconsole sd-encrypt sd-lvm2 filesystems)




pacman -Sy linux
## which should do this implicitly:
# mkinitcpio -p linux
# cd /boot && grub-mkconfig -o grub.cfg

Fix EFI boot

After some failed boot attempts ("No bootable devices") reboots tripped into Dell Recovery.

Drop in to BIOS (F2) and reconfigure the NVMe disk as an EFI boot disk.

EFI boot file : /dev/nvme0n1p1 : EFI/arch/grubx64.efi

Upgrade Wireless Drivers

Driver : ath10k_pci

Model : QCA6174

lspci:

02:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)

More fixes to try: https://forum.manjaro.org/t/solved-qualcomm-qca6174-unstable-after-standby-many-circumstances-lenovo-miix-520/79713/43

Wired Wifi Failover

Bonded wifi and wired connections for seamless handover. Prefer wired.

#!/bin/sh
CON_BOND=failover
DEV_BOND=bond0
CON_WIFI=${CON_BOND}-wifi
DEV_WIFI=wlp2s0
CON_WIRED=${CON_BOND}-wired
DEV_WIRED=enp57s0u1u1
SSID=not-the-real-ssid
WIFI_PASS=not-the-real-password

$ECHO nmcli con add type bond con-name $CON_BOND ifname $DEV_BOND mode active-backup primary $DEV_WIRED +bond.options "fail\_over\_mac=active,miimon=100,primary_reselect=always,updelay=200"
$ECHO nmcli con add type wifi con-name $CON_WIFI slave-type bond master $CON_BOND ifname $DEV_WIFI ssid $SSID
$ECHO nmcli con modify $CON_WIFI wifi-sec.key-mgmt wpa-psk wifi-sec.psk $WIFI_PASS
$ECHO nmcli con add type ethernet con-name $CON_WIRED slave-type bond master $CON_BOND ifname $DEV_WIRED

Also need to:

* set failover priority >0

Battery Life

https://amanusk.medium.com/an-extensive-guide-to-optimizing-a-linux-laptop-for-battery-life-and-performance-27a7d853856c

  • tlp
  • cpupower
  • powertop

Using intel_pstate.

# current cpufreq driver
sudo cpupower frequency-info

# current cpu governor
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor