Kickstarter: Primetime Adventures in Screen Printing

Click: Primetime Adventures in Screen Printing

The Man With The Red Face

Freedreno on the IFC6410

Finally found some more time to play with my IFC6410 dev board. I’m really happy with it, SATA is working great so it’s perfect as a small fileserver and there’s decent support for traditional Linux.

And here’s a sneak preview of what I’m currently working on: XWayland on freedreno. Still needs a slight cleanup and some more tweaks to work with the current weston and gnome-shell from git, but I’m really pleased with how fast this little board is with fully open source drivers.

OpenVPN in a lxc container

Recently I’ve been playing with lxc as a lightweight alternative to full blown virtualization and wanted to run OpenVPN in the container.

However, the tun device is not available by default in lxc containers, leading to this error:

1
ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)

As usual there’s a bunch of solutions floating around the net, but due to recent changes to lxc/systemd the old way of creating the tun device inside the container doesn’t work anymore. Instead it has to be created using the autodev hook.

For this, create a script named autodev in /var/lib/lxc/yourcontainer/

1
2
3
4
5
6
#!/bin/bash

cd ${LXC_ROOTFS_MOUNT}/dev
mkdir net
mknod net/tun c 10 200
chmod 0666 net/tun

and make it executable:

1
chmod +x autodev

Then add

1
2
3
4
lxc.hook.autodev=/var/lib/lxc/yourcontainer/autodev

# /dev/net/tun
lxc.cgroup.devices.allow = c 10:200 rwm

to /var/lib/lxc/yourcontainer/config.

More information can be found at https://wiki.archlinux.org/index.php/Lxc-systemd.

Mounting Whole Disk Images with kpartx

So you just rescued your data from a dying harddisk using ddrescue /dev/sdd backup.img and now you wonder how to get your data out of that image?

When you google “mount whole disk image”, you will find a lot of posts showing how to manually calculate the offset of each partition and then mount them by manually specifiying the partition offset. That’s a lot of work and easy to get wrong.

Luckily there’s a much better method: kpartx can create the required partition mappings in /dev/ so you access the image as if it were a real disk. In most distributions it is part of the multipath-tools package, so install that using your favourite package manager.

Now you can activate the mapping with

1
2
3
$ kpartx -va backup.img
add map loop0p1 (254:0): 0 102400 linear /dev/loop0 2048
add map loop0p2 (254:1): 0 100352 linear /dev/loop0 104448

and then simply mount the partitions as usual:

1
2
3
$ mount /dev/mapper/loop0p1 data
$ ls data
important_files

When you’re done unmount everything and remove the mapping:

1
2
3
4
5
$ umount data
$ kpartx -vd backup.img
del devmap : loop0p2
del devmap : loop0p1
loop deleted : /dev/loop0

And that’s it!

Troubleshooting

If you get this error:

1
2
3
$ kpartx -va backup.img
mount: could not find any device /dev/loop#Bad address
can't set up loop

you’re missing the loop kernel module. Just load it with

1
$ modprobe loop

Django Django

Steam on Arch Linux

If steam doesn’t start with

Unable to copy /home/$USER/.local/share/Steam/bin_steam.sh to /usr/bin/steam

check if it is marked as immutable:

1
2
$ lsattr /usr/bin/steam 
----i--------e-- /usr/bin/steam

If it is, fix it with:

1
$ sudo chattr -i /usr/bin/steam 

And enjoy!

John Talabot and The xx

Not in Milwaukee but in Copenhagen last sunday. It was amazing.

Wieso eigentlich …

keine Kommentare zur Musik?

Über Musik schreiben ist wie zu Architektur tanzen.

Wer auch immer das zuerst sagte

alt-J (∆) - An Awesome Wave