2015-06-28

CB5-311 Ubuntu (ARM Chromebook) and fixing GLX

I did an apt-get upgrade and didn't consider the sort of breakage that could occur if the system were to replace /usr/lib/xorg/modules/extensions/libglx.so with *not* the Nvidia one. I had some erroneous messages in /var/log/Xorg.0.log that made me think the problem was because of some undefined symbols in some mesa library, but that turned out to be missing symbols in the fallback software rendering, not the actual GLX module. To fix the error, I extracted the relevant parts from the original setup script and ran them again. Here's the extracted bit:

    l4tdir=`mktemp -d`
    l4t=Tegra124_Linux_R19.3.0_armhf.tbz2
    wget -P ${l4tdir} https://developer.nvidia.com/sites/default/files/akamai/mobile/files/L4T/${l4t}
    cd ${l4tdir}
    tar xvpf ${l4t}
    cd Linux_for_Tegra/rootfs/
    tar xvpf ../nv_tegra/nvidia_drivers.tbz2
    tar cf - usr/lib | ( cd / ; tar xvf -)

    cat > install-tegra.sh << EOF
    update-alternatives --install /etc/ld.so.conf.d/arm-linux-gnueabihf_EGL.conf arm-linux-gnueabihf_egl_conf /usr/lib/arm-linux-gnueabihf/tegra-egl/ld.so.conf 1000
    update-alternatives --install /etc/ld.so.conf.d/arm-linux-gnueabihf_GL.conf arm-linux-gnueabihf_gl_conf /usr/lib/arm-linux-gnueabihf/tegra/ld.so.conf 1000
    ldconfig
    EOF

And a pastebin version because blogger butchering.

2015-02-07

CB5-311 & Ubuntu

I recently purchased a Chromebook 13 (cb5-311, 4GB RAM, 1080p, 32G SSD) and
I've managed to get Ubuntu on it.

I tried a bunch of different chrubuntu install scripts and eventually
discovered that none of them worked using default settings because they try to
install 14.10 and that's broken.

I eventually settled on this script:
https://github.com/marcino239/chrubuntu-tegra/blob/master/chrubuntu-tegra.sh

To make it work, I opened the script up and hardcoded the ubuntu_version
variable's default value to "lts" so it would pick 14.04 instead of whatever
the latest was.  I also changed the argument to umount the statefule_partition
with -l instead of -f, but I don't know if that was necessary, I just didn't
want another script to bomb out and have to start over.  I may also have put in
a touch /etc/init/whoopsie for similar reasons, but I don't recall now.

To get around the freeze due to uap0/mlan0 I did something like

    echo manual | sudo tee /etc/init/network-manager.override

This disabled network manager.  I just bring the mlan0 interface up manually
when I want it.  Later I'll probably script it.

Then I installed fvwm and generally set about customizing things.  To make up
for a lack of insert key, I made the Enter key become insert when the right alt
button is held down.  To do that, I put this in .xmodmaprc:

    keysym Alt_R = Mode_switch
    keycode 36 = Return NoSymbol Insert

So now I can use shift insert to paste by hitting alt+shift+enter.  (Order
matters).

I made a udev rule for setting permissions on the backlight so I can control
that with a script, too.  /etc/udev/rules.d/88-backlight.rules now contains
these lines:

ACTION=="add", KERNEL=="pwm-backlight", SUBSYSTEM=="backlight", RUN+="/bin/chmod 0666 /sys/devices/soc0/pwm-backlight/backlight/pwm-backlight/brightness"
ACTION=="add", KERNEL=="pwm-backlight", SUBSYSTEM=="backlight", RUN+="/bin/chgrp users /sys/devices/soc0/pwm-backlight/backlight/pwm-backlight/brightness"

I guess you can't use use GROUP and MODE to set permissions on /sys entries,
but you can use RUN to do it.

I cannot put the laptop to sleep and closing the lid does nothing, but it boots fast and can go around 12 hours before I have to recharge.  There might be other things that don't quite work, but I either don't recall or I haven't encountered them yet.