Asus ZenBook UX303LN-4199H Debian install tips

Boot and configure Windows OEM in order to keep productId, and a restore partition. Gonna help for any warranty or resell. Wifi needs firmware, and you need wifi for the install, so get the debian installer from : http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/daily-builds/sid_d-i/current/amd64/iso-cd/firmware-testing-amd64-netinst.iso

Working “top line” buttons, in /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="

Select internal speakers/jack as default sound card (instead of HDMI). In ̀/etc/modprobe.d/something.conf:

options snd-hda-intel index=1,0  # fucking hdmi

Use bumblebee, to make apps use nvidia GPU when needed

apt-get install bumblebee-nvidia primus
dpkg --add-architecture i386 ; sudo apt-get update
sudo apt-get install bumblebee-nvidia primus primus-libs:i386 libgl1-nvidia-glx:i386
sudo adduser $USER bumblebee

Disable instant shutdon in wonsole when accidently hitting the power button instead of Suprr: check your /etc/systemd/logind.conf file. It should look like this:

#HandlePowerKey=poweroff

and change the value to

HandlePowerKey=ignore

Patch for kernel 3.16, to get a “working” touchpad : https://github.com/hanipouspilot/ubuntu-fixes/commit/de3ba763aebbea303f077acfc75952af23b1f38b

And use tutorial on https://wiki.debian.org/HowToRebuildAnOfficialDebianKernelPackage to build your new kernel.

Included in Sid’s kernel as of 3.16.7-ckt9-1.

## NetworkManager

To prevent NetworkManager from managing not real interfaces, edit ̀/etc/NetworkManager/NetworkManager.conf :

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[keyfile]
unmanaged-devices=interface-name:vmnet1;interface-name:vmnet8;interface-name=tun0

NetworkManager will warn about /usr/bin/arping not being found:

apt-get install iputils-arping

If you want to be asked for your WPA2 keys, you need to : apt-get install gnome-keyring

Déboires d'un linuxien un peu old-school devant le présent de chez Microsoft

Nouvelle machine, nouveaux ennuis.

J’achète un laptop pour particulier chez une grande enseigne informatique, je rentre chez moi. Avant de l’attaquer au tournevis pour remplacer le disque dur tout lent par un SSD correct, et installer un système que je connais, je le démarre “normalement”, afin au minimum de tester les fonctionnalités de base. Pas envie d’avoir d’avoir des soucis avec la garantie en cas de gros tas de pixel mort.

Je branche je boote

J’ai pas trop d’options différentes, mais j’ai envie de cliquer partout pour tester le trackpad. J’active par mégarde le “Narrateur” qui va me lire tout ce qu’il se passe à l’écran.

C’est chiant. Je reclique au même endroit, le narrateur me pronounce en anglais robotique “Command not available” et j’a une mini-fenêtre qui s’affiche en bas à gauche de mon écran. Le laptop continue de me parler avec sa voix à la GripsouGrishnak quand je fais des choses. Je ferme la mini fenêtre… ouf elle est partie.

Je dis à Windows que je suis un Français de France en France qui parle Français (France).

J’accepte une tonne de légalo-bullshit sans le lire.

Je choisi de nommer donner un petit nom à ma nouvelle acquisition, je mets Choupinette.

Je configure le Wifi en tapant à la main ma clé à rallonge. Dommage que je ne puisse pas utiliser la webcam intégrée pour scanner un QRcode, parceque je m’y reprends à 3 fois.

Je demande la configuration rapide parceque j’ai peur de ne pas être capable de gérer plus compliqué, et que je suis pressé.

Il me demande un compte hotmail avec un magnifique “Connectez-vous pour accéder facilement ŕ votre courrier électronique, vos fichiers, paramčtres…”. Je me dis alors que le Français de France doit être une langue trop exotique. Je crée un nouveau compte car je n’ai pas d’autre options, et les accents reviennent.

Il me demande alors:

  • mon nom, je mets n’importe quoi
  • mon email, je mets n’importe quoi en @hotmail.com, ca me rappelle MSN (T-E-X-T-OOOO génération texto)

Le bousin fait des trucs, avec plein de couleurs qui me permettent au passage de tester d’éventuels pixels morts de l’écran, ce qui est très pratique.

C’est long, et rien ne se passe à part me dire que c’est “Bientôt prêt”. C’est bientôt prêt pendant 5 minutes, puis l’installeur passe en “souris qui attend”. Alors j’attends.

Longtemps.

Très longtemps.

Je me demande ce qu’il peut bien faire de bizarre, et je regarde si l’installeur fait des choses sur le réseau.

Et il se trouve que oui, plein de connexions vers des IP Microsoft avec un port “à la con” (qui se trouve être du teredo) sont bloquées par mon parefeu :

SRC=192.168.3.139 DST=157.56.144.215 PROTO=UDP SPT=54095 DPT=3544

Damned ! J’autorise tout à sortir depuis cette IP, et j’attends… et il se passe pas grand chose.

Du NetBios, de l’ARP, des bricoles, le pointeur de la souris continue de tourner sur lui même.

Pf. 15 minutes plus tard je reboot un peu de rage, quand je m’aperçois qu’en fait mon compte spécial lolilol kikoo msn me sert à ouvrir la session. Quelle idée à la con! Quelle idée à la con numéro 2 d’avoir mis n’importe quoi comme mot de passe dont je ne me rappelle plus.

Pas grave, je demande à Microsoft, via Internet sur un autre poste, comment réinitialiser mon mot de passe, sachant que toutes les informations de téléphone, etc. sont complètement fausses.

Et là magie: il me répond bien gentilment de tout simplement réinstaller mon OS… ce qui va me prendre encore 20 bonnes minutes.

LINKCEPTION

wget "http://tinyurl.com/m7mgdn3"

or

http://tinyurl.com/m7mgdn3

Source code https://github.com/conchyliculture/inception

DualHead setup with GLX

Introduction

Not wanting to miss the cryptocurrency fad, I desired to mine a few of my own. Scrypt-based crypto-coins, like Litecoin are (currently) best mined with ~ATI~ AMD GPU. So I got myself a second-hand HD7950 and decided to use it only for mining, while relying on the HD4000 GPU ( integrated in my core-i7 processor ) for desktop and not-too-intensive gaming gaming.

This tutorial/rant won’t go into much detail about the mining part, and miner configuration. This is already well explained everywhere else on the internet.

Braindead customer (Windows user)

Setting it all up under Windows was pretty straigthforward:

  1. Install catalyst drivers
  2. Install intel drivers
  3. Make the board believe there’s a monitor actually installed
  4. Install the required accelerated parallel programming SDK
  5. Install cgminer and point it to your favorite pool
  6. (optional) Overclock the board with OverDrive
  7. Get dem coins, while playing heartstone without issue

This was fine, but not very satisfying. On to the real men world.

Proprietary driver hell

The previous method was more of a proof of concept. I want the same setup to run under Debian/Sid so I can be all nice and cozy.

The install procedure still kinda works, except you have of course to download linux-64b versions of the driver installer. I used the 14.4 version, which seemed to support Sid’s kernel (not anymore: 3.13 only… sigh ).

I configure my desktop manager to run a “dual seat” configuration like so:

Seat0 corresponds to the integrated HD4000 and Seat1 the 7950.

You can see it starts two different Xorg processes with two different configuration files which are:
xorg.0.conf:

xorg.1.conf:

WARNING these config files were hacked from scavenging the internet. Therefore I can’t be sure they are optimized, make any sense, or aren’t the source of the issues I’ll discuss in the end of this post.

All is well with this configuration. I just had to specify the DISPLAY variable before running the mining scripts. ALAS , the issue with this is that AMD drivers have the urge to take a shit in your /usr/lib directory, moving around graphic libraries, and symlinking their own in weird places.

What this means is both Xorg instances have to run with AMD libraries, which is fine with the Seat1 configuration from above, but totally breaks GLX loading for the Seat0 (the one with a real monitor).

There is some hope though, AMD is nice enough to provide two scripts:

  • /usr/lib/fglrx/switchlibGL
  • /usr/lib/fglrx/switchlibglx

which are able to undo and restore the /usr/lib hell. The problem is, I still can’t have both versions of libGL.so and libglx.so for my two Xorg instances.

Renzotech my /usr/lib

I wasn’t sure that the previous two scripts were the only things the huge-ass driver installer was doing. The bulldozer approach I had was:

  • Take a LVM snapshot from a fresh Debian/sid, then install AMD’s drivers
  • Mount the snapshot, and make a quick diff to round up all the burps the AMD installer does in my /: diff -qr / /mnt/snap/

I was now sure that only /usr/lib̀ was impacted by all the fun the proprietary drivers have to offer.

I just had to keep two different directories:

  1. one clean /usr/lib for my Seat0 X, with only Debian libs
  2. one dirty /usr/lib for my Seat1 X, with AMD libs

My system being Debian Sid, it breaks all the time, and keeps having kernel updates and whatnots, so I may have to reinstall the AMD drivers every so often. Moreover, there is no chance in hell I was going to patch the +100Mb installer thing to make it behave in a dedicated /usr/lib tree. So in the end I decided to have two /usr/lib folders :

  • /usr/lib for Seat1, with AMD libs
  • /usr/lib-test for Seat0 without those libs

Of course, I want all the updates backported in /usr/lib-test, so after every upgrade, I just run the following script:

What it does is:

  • Checking your /usr/lib is dirty with proprietary drivers
  • (optional) Deleting /usr/lib-test
  • Creating /usr/lib-test as a “hollow” copy of /usr/lib, with only symlinks
  • Restoring the ̀libGL.so and libglx.so symlinks to link to the Debian ones (as would switchlibGL and ̀switchlibglx do)

WARNING !!!! The script doesn’t care about 32 bits libs. I’m not running any 32 bit program on the AMD card, so I don’t care about them. When I want to restore them in my “clean” /usr/lib-test (for example, after an update) I just run:

apt-get install --reinstall libgl1-mesa-dri:i386 \
    libgl1-mesa-glx:i386 libglapi-mesa:i386 libglu1-mesa:i386 \
    libglew1.10:i386 libxmu6:i386 libxt6:i386

before running the above script.

And voilà ! …. not really. Last but not least, We need to specify our Seat0’s X to load its libs from /usr/lib-test :

# cat > /usr/bin/X-0 <<EOF
export LD_LIBRARY_PATH="/usr/lib-test"
exec /usr/bin/X "$@"
EOF
# chmod a+x&nbsp;/usr/bin/X-0</span>

and change the path to that X in the lightdm.conf file (xserver-command directive).

When your input devices play dirty tricks

This is the last issue I had to assess. Don’t remove the lines concerning input devices from the previous xorg.(0|1).conf files. They prevent the Seat1 Xorg from using your mouse and keyboard.

You get VERY weird stuff happenning when you control two Xorg process with the same set of keyboard+mouse, including:

  • unwanted processes starts from clicking on shortcuts
  • moving files from your desktop around from bad drag and drops
  • wrecking your system up, from running your commands in rogue xterms …