guylhem is currently certified at Journeyer level.

Name: Charles Devereaux
Member since: 2011-01-08 05:53:05
Last Login: 2014-09-20 22:04:23

FOAF RDF Share This



AfterStep window manager, xiterm terminal emulator, TLDP Howtos, former
TLDP leader, perlmsi french healthcare data analysis suite.

Recent blog entries by guylhem

Syndication: RSS 2.0

The Thinkpad X201 tablet under OSX 10.9

The X201 tablet is a sweet device that works quite well as a hackintosh - better than my genuine Macbook Air. However,  if you have the Intel core i7 620M CPU (the most powerful one available for the X201t) you are limited: if you don’t use a DSDT, there is no sleep support, and if you use a DSDT there is no sound. Regardless of which CPU you have, there is no tablet support.

The issue was recently discussed on, with other users reporting similar problems.

After analyzing the problem, basically, the DSDT that is publically available on does not work with the core i7 tablet.

Here’s a complete fix that makes sure everything works on the core i7 with MacOSX 10.9:

First, for the sound, the DSDT contains something weird:

            Device (HDEF)
                Name (_ADR, 0x001B0000)  // _ADR: Address
                Name (_S3D, 0x03)  // _S3D: S3 Device State
                Name (RID, Zero)
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    Store (Package (0x06)
                            Buffer (0x0A)


                            Buffer (0x04)
                                 0x0C, 0x00, 0x00, 0x00                           /* …. */

                            Buffer (Zero) {}
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)

The final part does not applies to the i7 Conexant CX20585, so it should just be:

            Device (HDEF)
                Name (_ADR, 0x001B0000)  // _ADR: Address
                Name (_S3D, 0x03)  // _S3D: S3 Device State
                Name (RID, 0x00)
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                Method (_PSW, 1, NotSerialized)  // _PSW: Power State Wake

For the tablet part, it’s a bit harder. There are many thing you have to fix.

First, edit  /System/Library/extensions/Apple16X50Serial.kext/Contents/PlugIns/Apple16X50ACPI.kext/Contents/Info.plist  and replace:




But that won’t do much good because the WACF004 that shows in ioreg is disabled. Adding that to Apple16x50Serial does not help tabletmagic - you have to enable the peripheral.

I could find only one documented way, TabletEnabler. However the binaries I got do not work with 10.9 and since I don’t have the sourcecode they can’t be fixed.

So I did it my way by editing the DSDT. For the device DTR, simply replace Name (LCFG, 0x00) by Name (LCFG, 0x01) : the 1 will allow method _STA to report the device as enabled (0x0F) instead of disabled (0x0D):

                    Method (_STA, 0, NotSerialized)  // _STA: Status
                        If (LNotEqual (\PJID, 0x00))
                            Return (0x00)

                        Store (0x03, LDNS) /* \_SB_.PCI0.LPC_.LDNS */
                        If (LAnd (LDAS, LCFG))
                            Return (0x0F)
                            Return (0x0D)

Then TabletMagic will recognize the serial port, but you’re not over. You move the pen, the cursor moves, but it is way off the screen when you approach the right side.

For some reason, tablet magic has a bug so you must specify manually the dimension of the tablet and the screen.

For the tablet, use 26312 x 16520, and for the screen 1280x800. In the mappings tab, make sure you set on the left handside 00001 0001 26311 16519. You may have to do it twice, but after that the pen will work perfectly.

If you want to further fix your X201 Tablet or if you have unrelated problems, check this website:

Syndicated 2015-03-09 01:34:07 from Guylhem's most recent funny hacks & thoughts

How to recreate the x60 coreboot fast distribution

Building upon the previous results, I adapted a debian jessie to systemd starting from scratch!

First create a debian with debootstrap:
debootstrap jessie —arch i386 /attempt2/

Add a unique id for systemd:
/usr/bin/dbus-uuidgen > /attempt2/etc/

sysvinit-utils and systemd-sysv could be kept, but they are duplicated by systemd-devereaux to make sure everything works fine, which is just a  systemd-v217 built like before, with:

git clone -b v217-stable git:// && cd systemd-stable/ && git pull

apt-get install libmicrohttpd-dev libgcrypt20-dev libqrencode-dev libacl1-dev libevdev-dev gobject-introspection libdw-dev

./configure CFLAGS=’-O2 -ftrapv’ —enable-compat-libs —enable-kdbus —enable-gtk-doc —disable-maintainer-mode —disable-dependency-tracking —disable-selinux —disable-smack —disable-ima —disable-audit —enable-terminal \
—with-sysvinit-path=”” —with-sysvrcnd-path=”” —localstatedir=/var —libdir=/usr/lib —with-rootlibdir=/lib —with-rootprefix=/ —prefix=/ —bindir=/bin —sysconfdir=/etc —with-rc-local-script-path-stop=/etc/halt.local —with-kbd-setfont=/bin/setfont —with-kbd-loadkeys=/usr/bin/loadkeys —with-html-dir=/usr/share/doc/systemd —with-sy
sroot=/ —with-debug-tty=/dev/tty11 —with-bashcompletiondir=/etc/bash_completion.d/systemd —with-zshcompletiondir=”” —datadir=/usr/share —mandir=/usr/share/man —datarootdir=”/usr/share” —includedir=/usr/include/

make install DESTDIR=/systemd-vanilla.v217

This directory has been packaged with a few useful default files - nothing fancy, but enough to remove sysv-init related things, and udev since systemd-devereaux will provide it. Use the following to create a debian package:

rm -fr systemd-vanilla.v217/var/log/journal

cat systemd-vanilla.v217/lib/udev/rules.d/90-vconsole.rules | sed -e ‘s/usr\/lib\/sys
temd/lib\/systemd/g’ > systemd-vanilla.v217/lib/udev/rules.d/90-vconsole.rules

for i in halt poweroff reboot shutdown ; do ln -sf ../bin/systemctl systemd-vanilla.v
217/sbin/$i ; done

ln -sf ../bin/echo systemd-vanilla.v217/bin/invoke-rc.d
ln -sf ../bin/echo systemd-vanilla.v217/bin/update-rc.d

cp -ad /usr/bin/mesg systemd-vanilla.v217/usr/bin/
cp -ad /sbin/fstab-decode systemd-vanilla.v217/sbin/
cp -ad /sbin/killall5 systemd-vanilla.v217/sbin/
cp -ad /sbin/sulogin systemd-vanilla.v217/sbin/
cp -ad /bin/pidof systemd-vanilla.v217/bin/
cp -ad /usr/bin/lastb systemd-vanilla.v217/usr/bin/
cp -ad /sbin/fsck.nfs systemd-vanilla.v217/sbin/
cp -ad /usr/share/man/man8/sulogin.8.gz systemd-vanilla.v217/usr/share/man/man8/
cp -ad /usr/share/man/man8/pidof.8.gz systemd-vanilla.v217/usr/share/man/man8/
cp -ad /usr/share/man/man8/killall5.8.gz systemd-vanilla.v217/usr/share/man/man8/
cp -ad /usr/share/man/man8/fstab-decode.8.gz systemd-vanilla.v217/usr/share/man/man8/
cp -ad /usr/share/man/man1/mesg.1.gz systemd-vanilla.v217/usr/share/man/man1/
cp -ad /usr/share/man/man1/last.1.gz systemd-vanilla.v217/usr/share/man/man1/

echo “Package: systemd-devereaux
Version: 217-99
Architecture: i386
Maintainer: Charles Devereaux <coreboot-fast-systemd@devereaux.dotorg>
Installed-Size: 31019
Depends: libgcrypt20, libqrencode3, libevdev2, libxkbcommon0, libelf1, libdw1, libcry
ptsetup4, libcurl3, libmicrohttpd10, libglib2.0-0, libpython2.7, dmsetup, libcryptset
up4, libdevmapper1.02.1, util-linux, less, dbus
Section: misc
Priority: optional
Standards-Version: 3.9.2
Description: systemd package without any sysv init and using a separate /lib/systemd
 This does avoid debian integration of services from /usr/lib/systemd
 Create a symlink if you want such integration.” > systemd-vanilla.v217/DEBIAN/contro

md5sum `find . -type f | awk ‘/.\// { print substr($0, 3) }’` > systemd-vanilla.v217/

dpkg-deb -b systemd-vanilla.v217 systemd-devereaux-v217.deb

If you want to avoid recompiling systemd, just grab the package from

This will give you a working .deb, but you need to create pseudopackages. equivs is the easiest way to do that:

for i in libsystemd-daemon0 libsystemd-daemon0-dev libsystemd-id128-0 libsystemd-id128-dev libsystemd-journal0 libsystemd-journal-dev libsystemd-login0 libsystemd-login-dev libsystemd0 libsystemd-dev python3-systemd libpam-systemd libgudev-1.0-0 libgudev-1.0-dev libudev1 libudev-dev udev systemd initscripts sysvinit-utils sysv-rc insserv ; do
echo “Section: misc
Priority: optional
Standards-Version: 3.9.2
Package: $i
Version: 217-98
Depends: systemd-devereaux
Description: $i dummy” > $i.equivs
equivs-build $i.equivs

You are now ready for the installation. First remove debian packages that have become redundant:

apt-get remove —purge systemd systemd-sysv libsystemd0 sysv-rc insserv sysvinit-utils init initscripts libudev1 udev

This will also remove some things we need, that will be installed back after systemd-deveraux is installed. Precisely, the following packages will be removed:
  bsdmainutils* bsdutils* dmsetup* e2fsprogs* init* initscripts* insserv*
  libcryptsetup4* libdevmapper1.02.1* libsystemd0* libudev1* man-db* procps*
  systemd* systemd-sysv* sysv-rc* sysvinit-utils* udev* util-linux*

NB: init-system-helpers is used to maintain compatibility with debian scripts - you should keep it in case you want to symlink /usr/lib/systemd to /lib/systemd to use debian systemd services

To avoid any problem with dependancies, install not just systemd-devereaux real package but also the pseudopackages we just created before:
dpkg -i *deb

Fix a few files either with systemd-firstboot or manually. A chroot in your debootstrap directory will be enough for now:
echo nameserver > etc/resolv.conf
udevadm hwdb —update
cat etc/passwd | sed -e ‘root:.:0:/root::0:/g’ > etc/passwd
cat etc/shadow | sed -e ‘root:.:/root::/g’ > etc/shadow

At this point, your installation is quite broken. First, let’s install some dependancies:
apt-get -f install

We can now install back the important things that were removed:
apt-get install bsdmainutils bsdutils dmsetup e2fsprogs libcryptsetup4 libdevmapper1.02.1 man-db procps util-linux

We can also replace cron by systemd-cron to process /etc/crontab
apt-get remove —purge cron
apt-get install systemd-cron

That’s not all. Let’s install the basics:

A few network utilities:
apt-get install iw wpasupplicant links ethtool tcpdump rfkill dnsutils sshfp telnet lsof wireless-tools bridge-utils nmap horst whois nfs-common avahi-utils openssh-server

A few console tools:
apt-get install mc vim bc screen debsums attr minicom attr hdparm powertop gpm cryptmount cryptsetup-bin xfsprogs acpid acpi-fakekey usbutils pciutils strace

A few sound tools (if only to silence the console beep in alsamixer)
apt-get install alsa-base alsa-tools alsa-utils mpg123 sox flite

NB: we do not install kbd since keyboard-configuration console-setup etc are redundant with systemd keyboard config, so we use instead a package providing sensible defaults for a x60 (mostly udev and sysctl rules)
dpkg -i x60-defaults-devereaux.deb

This package is available on

For the console configuration, check /etc/locale.conf and /etc/vconsole.conf. If you want to use another .map keyboard file, put it in /usr/share/keymaps

This package also includes configuration for the network ala systemd (ex:  61 /etc/resolve.conf to be a symlink to /run/systemd/resolve/resolv.conf), and services for a few utilities like ssh and gpm

Check the configuration in /etc/systemd/network then if it’s ok, enable it now and for future reboots with:

systemctl start systemd-networkd
systemctl enable systemd-networkd

For hooks, ie things that you want to start once the machine is online, use After=systemd-networkd-wait-online.service as a “dependency”.

(A tarball matching this exact same configuration is available on ; if you are using it, just start here)

Voila, your are done - format the target partition, for example /dev/sda3 with:
mkfs.xfs -L thinkpad /dev/sda3 -l lazy-count=1

Then mount it and copy the files from the tarball into the new partition:

mount /dev/sda3 /mnt ; tar zxvf attempt.tgz
rsync -aAXvHWx /attempt /mnt

And declare the partition type in fstab, otherwise systemd will not be able to mount it in read-write mode:
echo “/dev/sda3 / xfs rw,relatime,attr2,nobarrier,inode64,allocsize=8192k,noquota 0 1” > etc/fstab

You may want to remove my default SSH keys - they will be recreated on reboot:

rm /etc/ssh/ssh_host*

Add to your coreboot grub.cfg the following to add a menu entry:

menuentry ‘1: Debian GNU/Linux coreboot systemd’ {
    set root=(ahci0,3)
    linux /kernel/bzImage libahci.ignore_sss=1 raid=noautodetect i915.lvds_downclock=1 i915.i915_enable_rc6=7 nohz=on nmi_watchdog=0 thinkpad_acpi.brightness_enable=0 thinkpad_acpi.force_load=1 thinkpad_acpi.fan_control=1 snd-hda-intel.index=0 snd_hda_intel.power_save=10 snd_hda_intel.model=thinkpad snd-hda-intel.probe_mask=0x103 snd-pcsp.index=1 btusb.reset=1 ath9k.ps_enable=1 ath9k.btcoex_enable=1 i915.fastboot=1 pcie=aspm pcie_aspm.policy=powersave tpm_tis.force=1 tpm_tis.interrupts=0 tpm_tis.hid=PNP0C31 quiet root=/dev/sda3

Thanks to the kernel configuration and patches posted before on, the boot time has been halved:

$ systemd-analyze
Startup finished in 763ms (kernel) + 579ms (userspace) = 1.343s

However, something still needs to be fixed: wpa+dhcp means the network connection is only available 1.3 seconds later.

X is a work-in-progress - packages will be posted soon. At the moment, the target is to get to X in an additional 0.5 to 0.7s, so that you get to X in less than 2 seconds. This may not be possible on X60-tablets which need more time for the wacom digitizer initialization.

Merry christmas and enjoy the fast boot times!

Syndicated 2014-12-25 17:33:00 from Guylhem's most recent funny hacks & thoughts

Using systemd on a debian wheezy

Ever since 2006, I have dreamt of a init system that would integrate sysvinit, cron and inetd. There have been various attempts, but now systemd seems like the best answer to this old problem.

However, after trying to install systemd on my debian wheezy with the system-V compatibility mode (apt-get install), I was greatly disappointed by the speed

Here is what systemd-analyze blame reported:
  7774ms networking.service
  3453ms aiccu.service
  2625ms debian-enable-units.service
  1691ms keyboard-setup.service
  1491ms console-setup.service
  1029ms acpi-fakekey.service
   699ms console-kit-log-system-start.service
   655ms motd.service
   616ms gpm.service
   580ms hdapsd.service
   547ms acpi-support.service
   543ms bootlogs.service
   508ms cron.service
   503ms rc.local.service
   442ms NetworkManager.service
   432ms udev.service
   428ms systemd-logind.service
   408ms lightdm.service
   381ms saned.service
   379ms udev-trigger.service
   368ms sys-kernel-security.mount
   343ms systemd-modules-load.service
   339ms systemd-sysctl.service
   336ms dev-mqueue.mount
   320ms dev-hugepages.mount
   315ms systemd-user-sessions.service
   285ms sys-kernel-debug.mount
   247ms systemd-remount-api-vfs.service
   244ms run-lock.mount
   234ms run-user.mount
   180ms upower.service
   166ms console-kit-daemon.service
   164ms pppd-dns.service
   163ms systemd-tmpfiles-setup.service
   147ms alsa-utils.service
   131ms hdparm.service
   127ms kbd.service
    41ms polkitd.service
    36ms chain.mount
    31ms remount-rootfs.service
    19ms udisks.service
     2ms sys-fs-fuse-connections.mount

systemctl told me which services were started by LSB compatibility scripts:
acpi-fakekey.service      loaded active running       LSB: Start acpi_fakekey daemon
acpi-support.service      loaded active exited        LSB: Start some power management scripts
aiccu.service             loaded active running       LSB: SixXS Automatic IPv6 Connectivity Client Utility
alsa-utils.service        loaded active exited        LSB: Restore and store ALSA driver settings
bootlogs.service          loaded active exited        LSB: Log file handling to be done during bootup.
cron.service              loaded active running       LSB: Regular background program processing daemon
gpm.service               loaded active running       LSB: gpm sysv init script
hdapsd.service            loaded active running       LSB: initscript to start hdapsd
hdparm.service            loaded active exited        LSB: Tune IDE hard disks
kbd.service               loaded active exited        LSB: Prepare console
keyboard-setup.service    loaded active exited        LSB: Set preliminary keymap
motd.service              loaded active exited        LSB: Create dynamic part of /etc/motd
networking.service        loaded active running       LSB: Raise network interfaces.
pppd-dns.service          loaded active exited        LSB: Restore resolv.conf if the system crashed.
rc.local.service          loaded active exited        LSB: Run /etc/rc.local if it exist

The culprits are there - 7 seconds hogged by networking stuff alone is not acceptable - even if it requires wifi association with wpa_supplicant then negociation of an IP address with dhcp

I decided to do it “from scratch”, following the example of whose scripts have been slightly adapted.

The basic idea here is to try and keep debian compatibility as much as possible while using systemd completely, without any sysvinit compatibility layer - which means some services will have to be rewritten.

1. Getting and comping systemd

You will need to install the following packages:
libgcrypt-dev libattr1-dev libacl1-dev libcap-dev libblkid-dev libpam0g-dev libcryptsetup-dev libkmod-dev gtk-doc-tools gperf cryptmount cryptsetup

You will also need libcryptsetup-dev libkmod-dev from testing, as the versions in wheezy are too od.

To mix packages : add testing to sources.list
echo ‘APT::Default-Release “stable”;’ > /etc/apt/apt.conf

Then you can use “apt-get install -t testing” to install any package from testing.

systemd is a work-in-progress, so installing a long-term stable release seems like the best idea. You can do that with git:
git clone -b v210-stable git://
cd systemd-stable/ && git pull

The following autoconf actions will prepare systemd for you:

./ —prefix=/usr —with-udevrulesdir=/lib/udev/rules.d —with-distro=debian —with-sysvinit-path= —with-sysvrcd-path= —disable-selinux —enable-libcryptsetup —disable-audit —disable-tcpwrap —disable-plymouth

./configure CFLAGS=’-O2 -ftrapv’ —enable-gtk-doc —disable-selinux —disable-smack —disable-ima —with-sysvinit-path=”” —with-sysvrcnd-path=”” —localstatedir=/var —libdir=/usr/lib —with-rootlibdir=/lib —with-rootprefix=/ —prefix=/ —bindir=/bin —sysconfdir=/etc —with-rc-local-script-path-stop=/etc/halt.local —with-firmware-path=/lib/firmware —with-kbd-setfont=/bin/setfont —with-kbd-loadkeys=/usr/bin/loadkeys —with-html-dir=/usr/share/doc/systemd —with-sysroot=/ —with-debug-tty=/dev/tty11 —with-bashcompletiondir=/etc/bash_completion.d/systemd —with-zshcompletiondir=”” —datadir=/usr/share —mandir=/usr/share/man —datarootdir=”/usr/share” —includedir=/usr/include/

A quick explaination is needed: Audit slows down the kernel, and is only good for corporate use, while IMA goes hand to hand with TPM (and checksums can do the same job more easily) so we disable them. AppArmor/SElinux/SECCOMP/SMACK are different ways to do MAC, but require configuration on debian so they are also disabled - and likewise for sysvinit compat since we just don’t want that. I use bash so I also disabled zsh completion.

For the directories :
- localstatedir is where the journal is kept, so /var/log
- libdir is where the libs links and pkgconfigs are installed, so /usr/lib
- rootlibdir is where libs links target and the pamsecurity is, so /lib
- firmware-path is where firmware files are found, so /lib/firmware
- rootprefixdir and prefix is where /lib/udev/ and /lib/systemd/ go, with some bins in bin/, so /
- bindir is where the rest of the binaries go, /bin
- sysconfdir is where etc/systemd, etc/udev and the etc/.d directories (tmpfiles, binfmt, modules-load, sysctl, pam) along with xdg, kernel, so /etc
- sysroot is where the required includes and libs are found, so /
- datarootdir is where README and some code sample will be installed, with doc/systemd automatically being added as a suffix, so /usr/share
- datadir is where the locales and dbus-1 services go, so also /usr/share
- sharedata is where polkit-1, kbd-model-map and some pkgconfig files go, but they are correctly found by default.

You can now compile with make, but borefore you do the installation,  manually remove each file from udev since systemd provide his own udevd:

cat /var/lib/dpkg/info/udev.list|xargs rm

You may want to keep only /usr/share/man/man8/scsi_id.8.gz manpage, /etc/modprobe.d/fbdev-blacklist.conf and the initramfs-tools hooks and tools from /usr/share/initramfs-tools.

You could remove udev altogether, but for this first article we just watch to stitch together something that will work.

After running make install, one binary is forgotten, so copy it manually, and remove the locales (unless you really want/need them) which for some reason end up in /share:
cp systemd /sbin
rm -fr /share

Here is a list of the files that will be installed:

Congratulations, you are now ready to use systemd!

But before you reboot, some small changes must be made:
 - add myhostname to /etc/nsswitch.conf, so that it works even without DNS
 - move your sysctl stuff from /etc/sysctl.conf to files in /etc/sysctl.d/
 - certain files must be created automatically, so I created /etc/tmpfiles.d/debian.conf with:
D /run/lock 0755 root root
D /run/sendsigs.omit.d 0755 root root
L /run/initctl - - - - /dev/initctl
D /run/network 0755 root netdev
 - for my thinkpad, I added some hdaps UDEV rules in /etc/51-hdapsd.rules :
 KERNEL==”event[0-9]*”, ATTRS{phys}==”hdaps/input1”,ATTRS{modalias}==”input:b0019v1014p5054e4801-*”,SYMLINK+=”input/hdaps/accelerometer-event”
 - bluetooth in debian has a problem with bluetooth.conf content being ignored, so I used another udev rule named /etc/rules.d/20-bluetooth.rules:
 ACTION==”add”, KERNEL==”hci0”, RUN+=”/usr/sbin/hciconfig hci0 up piscan”
 -  systemd-journal will complain of unknown group systems-journal in /lib/tmpfiles.d/systemd.conf 25 to 28, so simply add a group named systemd-journal, for example under GID 11 (unused in /etc/group)
You may also want to set some defaults :
 - in /etc/systemd/system/bootchart.conf I use:
 - in journald.conf I use:
 - in logind.conf I use:
 - in system.conf I use:

2. Fixing bugs

2.1 blank screen (only with an old version of native video init coreboot)

On a x60 with native video init on an old coreboot, the #1 problem is a blank screen when you boot. That’s due to some i915 mode change, that I thought be caused by the backlight service or the console kit services

The easiest answer seemed to be booting the kernel in a way that would disable the mode change with “quiet systemd.show_status=1 video=inteldrmfb:off” and to mask these services:
systemctl mask console-kit-daemon
systemctl mask systemd-vconsole-setup

They allow you to use use localectl to set your keyboard, etc - no need for them, especially since we can create a loadkeys service.

However, for some reason (maybe linked to udev) the backlight service always came back.

Since it is not that important to me - but having the possibility to use my laptop without fiddling around is quite important to me, I decided to remove altogether the backlight service (there is also a fix on if you want to try and keep the backlight service.)

rm /lib/systemd/systemd-backlight
rm /lib/systemd-backlight@.service

2.2 network

Another big problem is starting ifup automatically - I did it with a change to /lib/udev/rules.d/99-systemd.rules :

SUBSYSTEM==”net”, KERNEL!=”lo”, TAG+=”systemd”, ENV{SYSTEMD_ALIAS}=”/sys/subsystem/net/devices/$name”

SUBSYSTEM==”net”, KERNEL!=”lo”, TAG+=”systemd”, ENV{SYSTEMD_ALIAS}=”/sys/subsystem/net/devices/$name” ENV{SYSTEMD_WANTS}=”ifup@%k.service”

The next problem is some characters in files: if you did not delete it, the old udevd might complain of “invalid key/value pair” in file /lib/udev/rules.d/91-permissions and 95-keymap.rules, line 93 at character 37 and line 96  at character 142  : simply add a \ to the first (so that it goes on to the next line), and remove the # and what follows for the second

Finally, here is what a “verbose” systemd boot now looks like, with systemd.show_status=1 in the kernel options:
Loading, please wait…

Welcome to Debian GNU/Linux 7 (wheezy)!

[  OK  ] Reached target Sound Card.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Encrypted Volumes.
[  OK  ] Set up automount Arbitrary Executable File Formats File System Automount Point.
[  OK  ] Reached target Swap.
         Expecting device dev-disk-by\x2duuid-3236\x2dFC87.device…
         Expecting device dev-disk-by\x2duuid-7ECE\x2dEB6A.device…
[  OK  ] Created slice Root Slice.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on Delayed Shutdown Socket.
[  OK  ] Listening on Syslog Socket.
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Listening on udev Control Socket.
[  OK  ] Listening on udev Control Socket.
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Listening on Journal Socket.
[  OK  ] Created slice System Slice.
         Starting File System Check on Root Device…
         Starting Create list of required static device nodes for the current kernel…
         Starting udev Coldplug all Devices…
         Mounting Huge Pages File System…
         Mounting POSIX Message Queue File System…
         Mounting Debug File System…
         Starting udev Coldplug all Devices…
         Starting udev Kernel Device Manager…
         Starting Applies powertop recommandations…
[  OK  ] Created slice system-getty.slice.
         Starting Apply Kernel Variables…
         Starting Journal Service…
[  OK  ] Started Journal Service.
[  OK  ] Reached target Slices.
         Mounting Temporary Directory…
[  OK  ] Mounted Debug File System.
[  OK  ] Mounted POSIX Message Queue File System.
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Started File System Check on Root Device.
[  OK  ] Started Create list of required static device nodes for the current kernel.
[  OK  ] Started Applies powertop recommandations.
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Mounted Temporary Directory.
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Created slice system-ifup.slice.
         Starting Clean old interface status during boot…
         Starting Create static device nodes in /dev…
         Starting Remount Root and Kernel File Systems…
[  OK  ] Started Clean old interface status during boot.
[  OK  ] Started Create static device nodes in /dev.
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Created slice system-systemd\x2drfkill.slice.
         Starting Load/Save RF Kill Switch Status of rfkill1…
         Starting Load/Save RF Kill Switch Status of rfkill0…
[  OK  ] Reached target Bluetooth.
         Starting Load/Save Random Seed…
         Starting udev Kernel Device Manager…
[  OK  ] Reached target Local File Systems (Pre).
         Mounting /chain…
[  OK  ] Mounted /chain.
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started Load/Save RF Kill Switch Status of rfkill1.
[  OK  ] Started Load/Save RF Kill Switch Status of rfkill0.
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Reached target Local File Systems.
         Starting Create Volatile Files and Directories…
         Starting Trigger Flushing of Journal to Persistent Storage…
[  OK  ] Started Create Volatile Files and Directories.
         Starting Update UTMP about System Reboot/Shutdown…
[  OK  ] Started Trigger Flushing of Journal to Persistent Storage.
[  OK  ] Started Update UTMP about System Reboot/Shutdown.
[  OK  ] Reached target System Initialization.
[  OK  ] Listening on ACPID Listen Socket.
[  OK  ] Listening on sshd.socket.
[  OK  ] Reached target Timers.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting Start ifup for wlan0…
[  OK  ] Started Start ifup for wlan0.
         Starting Start ifup for eth0…
[  OK  ] Started Start ifup for eth0.
         Starting System Logging Service…
[  OK  ] Started System Logging Service.
         Starting Periodic Command Scheduler…
         Starting Login Service…
         Starting Permit User Sessions…
         Starting D-Bus System Message Bus…
[  OK  ] Started D-Bus System Message Bus.
         Starting Network Service…
[  OK  ] Started Periodic Command Scheduler.
[  OK  ] Started Permit User Sessions.
[  OK  ] Started Network Service.
[  OK  ] Reached target Network.
         Starting Getty on tty1…
[  OK  ] Started Getty on tty1.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started Login Service.
[  OK  ] Reached target Multi-User System.

Unless you really like these messages, I suggest booting in quiet mode and using systemctl or journald to check when some service fails.

3. Adding features

First, read the basics in so that you know how you can access the journal with journalctl, or a bit harder that you can stop it with systemctl kill —kill-who=main —signal=SIGUSR2 systemd-journald.service

3.1 Keeping boot messages

If you do not want clear the tty1 console, to read systemd messages : cp /lib/systemd/system/getty\@.service /etc/systemd/system/getty@tty1.service and set TTYVTDisallocate=no

3.2 Adding services

systemctl told me which services were started by LSB compatibility scripts, so I started creating some systemd .service scripts

The most important is to start the network automatically:

Description=Start ifup for %I

ExecStart=/sbin/ifup —allow=hotplug %I
ExecStop=/sbin/ifdown %I

Description=Clean old interface status during boot

ExecStart=-/bin/rm -f /etc/network/run/ifstate

You may want to keep your cron scripts, so use cron.service:
Description=Periodic Command Scheduler

ExecReload=/bin/kill -HUP $MAINPID


For X, I wanted something as minimal as possible - no session manager no nothing, so here’s a minimal display-manager.service:
Description=Start X-Window graphical mode

ExecStart=/bin/su root -l -c /usr/bin/xinit — vt12


Also, I use a mouse even in console mode so this is done gpm.service:
Description=GPM mouse daemon

ExecStart=/usr/sbin/gpm -m /dev/input/mice -t exps2
ExecReload=/bin/kill -HUP $MAINPID


If you care about running scripts when cables are plugged or unplugged, ifplugd\@.service:
Description=Daemon which acts upon network cable insertion/removal

ExecStart=/usr/sbin/ifplugd %i
SuccessExitStatus=0 1 2


Having not explored systemd facilities so much, I load my keyboard map myself in loadkeys.service:
Description=Boottime keyboard map and eventually font

ExecStart=/bin/loadkeys -q /usr/local/share/


To adjust the time, start ntp.service:
Description=Network Time Service

ExecStart=/usr/sbin/ntpd -g -u ntp:ntp


And in case you need to recreate your ssh keys automatically when they are removed, sshd-genkeys.service:
Description=SSH Key Generation

ExecStart=/usr/bin/ssh-keygen -A


And of course, some scripts to start ssh, when the port 22 is accessed, sshd.socket:



And to start sshd, sshd\@.service:
Description=SSH Per-Connection Server

ExecStartPre=/bin/mkdir -m700 -p /var/run/sshd
ExecStart=-/usr/sbin/sshd -i
ExecReload=/bin/kill -HUP $MAINPID

You can start rsyslog with syslog.service:
Description=System Logging Service

ExecStart=/usr/sbin/rsyslogd -n -c5


You can start these services to make sure they work before you install them with systemctl enable which will add symlinks:


4. Optimizing

When you are done, you may want to get a baseline of your system performance with the following commands:

$ systemd-analyze
Startup finished in 2.244s (kernel) + 611ms (userspace) = 2.856s

More precisely:

$ systemd-analyze blame
           106ms systemd-logind.service
            84ms systemd-udev-trigger.service
            82ms cron.service
            82ms gpm.service
            79ms systemd-user-sessions.service
            47ms powertop.service
            45ms systemd-tmpfiles-setup-dev.service
            38ms dev-hugepages.mount
            37ms sys-kernel-debug.mount
            34ms tmp.mount
            28ms dev-mqueue.mount
            26ms systemd-networkd.service
            22ms systemd-remount-fs.service
            16ms loadkeys.service
            16ms systemd-fsck-root.service
            14ms systemd-update-utmp.service
            14ms systemd-journal-flush.service
            12ms udisks.service
            12ms ifupdown-clean.service
            11ms systemd-sysctl.service
            11ms systemd-tmpfiles-setup.service
            11ms sshd at 0-
            10ms kmod-static-nodes.service
             8ms chain.mount
             7ms systemd-rfkill at rfkill0.service
             5ms systemd-random-seed.service
             4ms systemd-udevd.service
             1ms systemd-rfkill at rfkill1.service

If you want a graphic, use systemd-analyze plot > boot-chart.svg

systemd-analyze and systemd-analyze blame basically told me a 8 years old laptop running debian wheezy start in 3 seconds, after spending a bit more than 2 seconds starting the kernel, then a bit less than 1 second starting the daemons I want - much better that sysvinit, with only minimal changes!

This is a good start, but it requires many tweaks. Doing deeper changes with a debian built to support systemd (jessie !) can give you much better results, halving the 3 seconds to 1.3s

This is studied in the next post.

Syndicated 2014-12-25 17:00:27 from Guylhem's most recent funny hacks & thoughts

Unicode Greek and Maths letters with Linux

Here’s my new QWERTY keyboard:

 ¬∞ / ¹≈ / ²≠ / ³∇ / ⁴∀ / ⁵∪ / ⁶∩ / ⁷∈ / ⁸⊂ / ⁹≽ / ⁰≿ / ⁻ ⃗ / ⁺±
 θΘ / ωΩ / ɛƐ / ρϱ / ꚍꚌ / ψΨ / υϒ / ι∫ / ϖϵ / πΠ /  ̂  ̈ /  ̃ ̧  /  ̊  ̀
 α∂ / σΣ / δΔ / φΦ / ɣΓ / ηϘ / ϕϑ / 𝟀κ / λΛ /   ̅ ́ /   ̆ ̇
 ζϟ / ξΞ / ςϚ / √⊥ / βϐ / νͲ / μϡ / ≤≺ / ≥≻ / / ⃝

It’s a xmodmap I wrote to write math easily, using the 3rd and 4th level (AltGr and Shift+AltGr), while keeping the standard layout by default.

For most letters, you’ll find greek letters - including the rare ones, like script theta : ϑ, script phi ϕ, script epsilon ϵ and even the really rare ancient-greek ones (check wikipedia, they all have a cool story)

  • sampi Ͳ : U+0372 U+0373
  • numeric sampi ϡ : U+03E0 U+03E1
  • koppa Ϙ : U+03DE U+03DF
  • numeric koppa ϟ : U+03D8 U+03D9
  • digamma ς : U+03DA U+03DB  (but also U+03C2)

Numeric koppa looks ϟ like thunderbolts : ϟϟ. With koppa I can even add clouds above to make a full storm:-)


ϟϟ ! ! ϟϟ ! !

Not sure I’ll ever use them, but who knows - and they’re fun!!

Digamma ς the last one is still used and goes by many names - waw, epsimmon, stigma, or “final sigma” as that’s what σ should look like when it’s at the end of a words (so says wikipedia!)

You’ll notice my lowercase gamma, taus and chis are not standard, because I hate the way they look in most fonts : a gamma that looks like a y or a chi that looks like a x won’t cut it . So I dug in unicode shapes and found some cool replacements. Likewise for epsilon, which is accompanied by a big epsilon for whenever I need it and the standard awfully round ϵ next to omegapi ϖ (that’s not a creative name, whoever created that one must have been really tired :-)

Beside all this unicode goodness, I have :

 - On the first row, math symbols (with the integral as Shift+AltGr I, the other exception being square root and perpedicular for the letter V, and rounded d ∂ for Shift+AltGr a, to keep company to α)

 - On the right handside, accents - so I can add a macron on any letter, or do vectors like α⃗ (alpha vector says hello!), or strike through things  a⃗⃠ (alpha vector says goodbye!)

I love unicode and xmodmap :-)

Syndicated 2014-12-10 01:28:47 from Guylhem's most recent funny hacks & thoughts

Google apps catchall not catching yahoo recovery email

A very good friend of mine use one of my domains for its password recovery email address - in case something happens to the mainstream account. For such purposes, I keep a  special domain on a grand-fathered “google apps” plans - with no real users, just one administrator and a catchall set to never mark anything as spam and forward everything to a special email.

Recently, my friend forgot his yahoo password and for whatever reason, the mail with the recovery link was *NOT* reaching him, despite the catchall!! It was not in spam, not in the trash, nowhere after the google app- apparently it was just silently discarded by google. Separate tests using another (non yahoo) domain to send a similar email to the recovery address *DID* work, suggesting indeed that  the spare domain setup and the catchall did work, and that the problem was somewhere else.

In the end, I had to create a special user with this given email on this domain so that my friend could log in and receive the recovery link from yahoo.

That’s extra weird - maybe some recently-added Google security feature to avoid account thievery by a catchall. But this raises the question -  is there that much interest for a “premium” account in 2014???

Syndicated 2014-08-19 21:29:37 from Guylhem's most recent funny hacks & thoughts

19 older entries...


guylhem certified others as follows:

  • guylhem certified jimray as Master
  • guylhem certified dmerrill as Master
  • guylhem certified godoy as Master
  • guylhem certified olea as Master
  • guylhem certified esr as Master
  • guylhem certified rms as Master

Others have certified guylhem as follows:

  • redi certified guylhem as Journeyer
  • badvogato certified guylhem as Apprentice

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

Share this page