MODULES=(dell-laptop dell-wmi acpi_cpufreq) ... DAEMONS=(syslog-ng sensors healthd smartd sensord hddtemp acpid laptop-mode cpufreq iptables ip6tables !network net-profiles net-auto-wired net-auto-wireless @openntpd sshd ddclient cupsd crond dbus mbm-gpsd gpsd @avahi-daemon bluetooth alsa mpd mpdscribble pcscd gdm
When X11 starts with an external (full HD) screen attached, it clones the display, which seems to mess up XRandR afterwards.
As of gdm-3.4.1, this doesn't happen anymore, and this hack can be deactivated.
Investigating into diffed logs, it shows
(II) intel(0): Using fuzzy aspect match for initial modes (II) intel(0): Output LVDS1 using initial mode 1024x768 (II) intel(0): Output HDMI3 using initial mode 1024x768 ... (**) intel(0): DPI set to (89, 121) ... (II) intel(0): Allocated new frame buffer 1024x768 stride 4096, tiled
(II) intel(0): Using exact sizes for initial modes (II) intel(0): Output LVDS1 using initial mode 1366x768 ... (**) intel(0): DPI set to (119, 121) ... (II) intel(0): Allocated new frame buffer 1408x768 stride 5632, tiled
when no screen is attached, and the desired behaviour is observed.
To fix this, the built-in LCD screen (
LVDS1) is pinned to its nominal resolution with an xorg.conf snippet.
Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 Modes "1366x768" EndSubSection EndSection
As X11 starts in clone mode, all the others are pinned too, but it's not a big deal.
By default, only vertical two-finger scrolling is enabled. The horizontal one can be activated through some more X configuration. We also enable other niceties at the same time.
... Option "CornerCoasting" "1" Option "HorizEdgeScroll" "1" Option "HorizTwoFingerScroll" "1" Option "VertEdgeScroll" "1" ...
While we're at it, a dead-key international Dvorak mapping is also set as the default.
Section "InputClass" Identifier "evdev keyboard catchall" MatchIsKeyboard "on" ... # Keyboard layouts Option "XkbLayout" "us" Option "XkbVariant" "dvorak-intl" Option "XkbOptions" "terminate:ctrl_alt_bksp" EndSection
Dell still doesn't cater for us Dvorak users, and do not offer that keyboard layout on their laptops. Fortunately, some shops, such as this one, offer decently priced stickers to overlay on top of the keys, and make the laptop's in-built keyboard truly usable (apart, sadly, for the backlight which stills shows a QWERTY layout…).
At some point, GDM started behaving erratically and making my sessions freeze. I switched to SLiM, a simple and lightweight session manager. However, it doesn't expect exactly the same sessions as GDM, and doesn't set them exactly in the same way (no PulseaAudio, no
A quick fix was to add a custom
.xinitrc in my session.
#!/bin/bash mv .xsession-errors .xsession-errors.old pulseaudio --start & /etc/gdm/Xsession fvwm > .xsession-errors
ENABLE_AUTO_HIBERNATION=1 HIBERNATE_COMMAND=/usr/bin/systemctl hibernate
Since ArchLinux migrated to systemd, the rest of this section is outdated. Rather, one has to look towards
/etc/systemd/logind.confv None of the following is needed anymore
The desired behaviour is a follows.
Add the relevant file to manage the power button.
event=button/power action=/etc/acpi/actions/lm_power.sh %e
And the related script.
#!/bin/bash /bin/sync if [ x`cat /sys/class/power_supply/AC/online` == x1 ]; then /usr/bin/logger "[$0] Suspending due to $1 event ($2)" /usr/sbin/pm-suspend else /usr/bin/logger "[$0] Hibernating due to $1 event ($2) on battery" /usr/sbin/pm-hibernate fi
Since May 19 (at least, on my machine) there is a
/etc/acpi/handler.sh which “takes an entry for all actions.” It is also mentioned here. However, it races with the configuration above (both suspending AND powering the machine off). Simply renaming it out of the way seems to work.
We add another set of event and script tr manage the lid.
event=button/lid action=/etc/acpi/actions/lm_lid_e6320.sh %e
#!/bin/bash if [ x`cat /sys/class/power_supply/AC/online` == x1 ]; then if grep -q closed /proc/acpi/button/lid/LID/state; then /usr/bin/logger "[$0] Blanking and locking due to $1 event ($2) (or so should it be)" fi else if grep -q closed /proc/acpi/button/lid/LID/state; then /usr/bin/logger "[$0] Suspending due to $1 event ($2) on battery" /bin/sync /usr/sbin/pm-suspend fi fi
Sometimes, the ethernet interface (driven by
e1000e) does not see any carrier (
NO-CARRIER) despite being properly plugged in. This is a known bug, with a patch waiting in the pipe. This seems to be related to power management, and the device sleeping when it shouldn't.
In the meantime, forcibly waking the device works.
$ sudo -i # echo on > /sys/bus/pci/devices/0000\:00\:19.0/power/control
Its status (RF-Kill/flight mode) is linked to the wireless button on the right side of the laptop. This is confirmed by the AT+CFUN command on
Wireless button on:
$ sudo screen /dev/ttyACM0 *EMRDY: 1 AT+CFUN? +CFUN: 1 OK
$ sudo screen /dev/ttyACM0 *EMRDY: 1 AT+CFUN? +CFUN: 4 OK
In that latter mode, many functions used below just return
The pseudo reference says the GPS's output is first configured through
ttyACM0. Experience here however shows that all the initialisation can be done on
ttyACM2 (GPSD initialisation string, huh?). We set it on, with a period of 1 second, and enable DGPS.
$ sudo screen /dev/ttyACM2 *EMRDY: 1 AT+CFUN=1 OK AT*E2GPSCTL=1,1,1 OK AT*E2GPSNPD
After the last command, NMEA strings will start outputing, which GPSD can happily munch on.
# Default settings for gpsd. START_DAEMON="true" GPSD_OPTIONS="" DEVICES="/dev/ttyACM2" USBAUTO="true"
$ sudo rc.d start gpsd :: Starting gpsd [DONE]
There is also an application, MBM-GPSD, which can do all that on our behalf. It is in AUR. Using it just requires starting it before gpsd, and pointing the latter to
/dev/gps0 instead of
The ArchLinux Wiki has some documentation on the topic. We first adjust the default options.
ttyACM1 #921600 115200 lock crtscts modem passive novj defaultroute noipdefault usepeerdns noauth hide-password persist holdoff 10 maxfail 0 debug
Then the peers file.
file /etc/ppp/options.mobile connect "/usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat"
As mentionned on the ArchWiki, the chat scripts are not present, so me first
mkdir /etc/ppp/chatscripts, then add (copy/paste) the relevant chat script (the SIM card has no PIN code; had it had one, MBM would have taken care of it anyway; the same goes for the mode).
ABORT 'BUSY' ABORT 'NO CARRIER' ABORT 'VOICE' ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'DELAYED' REPORT CONNECT TIMEOUT 6 '' 'ATQ0' 'OK-AT-OK' 'ATZ' TIMEOUT 3 #'OK' @/etc/ppp/chatscripts/pin 'OK-AT-OK' 'ATI' 'OK' 'ATZ' 'OK' 'ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0' #'OK' @/etc/ppp/chatscripts/mode 'OK-AT-OK' @/etc/ppp/chatscripts/apn 'OK' 'ATDT*99***1#' TIMEOUT 30 CONNECT ''
To which a symlink is created as
'ln -s '/etc/ppp/chatscripts/apn.au.vodafone /etc/ppp/chatscripts/apn.
Finally, all this can be hooked into
CONNECTION='ppp' INTERFACE='ignore' PEER='mobile' PPP_TIMEOUT=30
We follow the document about Using an OpenPGP SmartCard. The BCM5880, which support the CCID protocol, is supported through ArchLinux packages
As the key is already on the OpenPGP, it needs to be registered to the local GPG so it can use it. It seems to be sufficient to import the public key via GnuPG's
$ gpg --card-edit Application ID ...: [...] ssb# 2048R/72DDD6F1 created: 2009-05-11 expires: 2010-11-04 gpg/card> fetch gpg: requesting key 13912971 from http server olivier.mehani.name gpg: key 98C66655: "Olivier Mehani <email@example.com>" not changed gpg: Total number processed: 1 gpg: unchanged: 1
The initramfs needs to support resuming. This is configured in the relevant file by adding the hook before filesystems.
... HOOKS="base udev autodetect pata scsi sata resume filesystems usbinput" ...
The initramfs can then be rebuilt.
$ sudo mkinitcpio -p linux ==> Building image from preset: 'default' -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img ==> Starting build: 3.0-ARCH -> Parsing hook: [base] -> Parsing hook: [udev] -> Parsing hook: [autodetect] -> Parsing hook: [pata] -> Parsing hook: [scsi] -> Parsing hook: [sata] -> Parsing hook: [resume] -> Parsing hook: [filesystems] -> Parsing hook: [usbinput] ==> Generating module dependencies ==> Creating gzip initcpio image: /boot/initramfs-linux.img ==> Image generation successful ==> Building image from preset: 'fallback' -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect ==> Starting build: 3.0-ARCH -> Parsing hook: [base] -> Parsing hook: [udev] -> Parsing hook: [pata] -> Parsing hook: [scsi] -> Parsing hook: [sata] -> Parsing hook: [resume] -> Parsing hook: [filesystems] -> Parsing hook: [usbinput] ==> Generating module dependencies ==> Creating gzip initcpio image: /boot/initramfs-linux-fallback.img ==> Image generation successful
Grub2 generates most of its configuration file automatically, and forgets about manual additions. Fortunately, it can be tweaked in
/etc/default/grub, by setting
DEFAULT variant is only appended to the kernel's command line on normal boots, while the non-
DEFAULT one is always added).
Then, grub can be reconfigured.
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
After suspend, with OpenNTPd running, the machine clock ends up being too fast by a few minutes. This is because suspend/hibernate disturbs NTP estimates.
Adding a script in
/etc/pm/sleep.d/ seems to do the trick fix the problem. An issue has been openned with ArchLinux about that.
#!/bin/sh # # 90openntpd: suspend/wakeup OpenNTPd case "$1" in hibernate|suspend) ;; thaw|resume) systemctl restart openntpd.service ;; *) exit $NA ;; esac