Linux live boot problem with KMS

The Linux Kernel support for modern video cards nowadays improves day by day, thanks to the great work in Open Source drivers. A new graphic system for Linux Kernel was introduced several years ago to support higher resolutions and deeper color space directly into the kernel-space rather than user-space, allowing fast virtual terminal switch and better video/monitor support. This system is called “Kernel ModeSetting”.

But sometimes the system fails to proper recognize how to setup the video card starting from the very boot sequence. The system may hangs during MKS-enabling and frame buffer module loading, especially booting in live systems.

In case of problems, Kernel Modesetting can be disabled in boot time editing the Kernel Command Line from your bootloader (lilo or grub) by simply adding this flag:

In this way your kernel will boot in standard VGA screen resolution allowing at least the usage of a standard console for data recovery or system backup.

Building FFMpeg 2.5.3 on Debian 7.8 i686

This guide will describe how to build the last FFmpeg 2.5.3 on Debian 7.8 with i686 architecture with custom install prefix both for FFmpeg and external libraries. In order to keep your system clear, FFmpeg will be compiled and installed in /opt/ffmpeg prefix, and will have all dependencies enabled using only libraries from official Debian repository with some needful libraries. Only x264, x265 and libaacplus will be added using the last version of sources from the last tarball release or the last commit in official CVS repositories.

In order to ensure that all copy and/or install commands have writing access to /opt directory, every “make install” command should be launched as root. Another solution is to create the destination directory by hand, change ownership to the building user, launch “make install” and finally re-change ownership to root. But the first is easier.

First of all you will need to install all compiling and repository tools using apt-get. You can copy/paste this command:

After that, you have to install all dependencies from official repository (both libraries and headers). Again, you can copy/paste the command:

Now you have to download official source archive. If you have problems with sources link you can browse the official FFmpeg site at and choose the last archive available. This guide will mostly work with all 2.5.x versions.

Now we need to prepare all external libraries. We start downloading sources using wget, git and mercurial. The first one is a tarball archive, so you have to extract it. The last two command directly create 2 directories with all sources inside.

In order to build x264 and x265 you will need a modern Yasm Modular Assembler. The version shipped with Debian official packages is too old (version 1.1.0), and we need YASM to be at least version 1.2.0. So we need to download and updated version on YASM and compile it.

After that you can build x264 video encoder. Enter in “x264″ directory and launch these commands. You have to prepend PATH environment variable in order to override default system path and ensure that configure script will use our fresh YASM installation. I prefer to prepend PATH in each command instead exporting it globally.

Now we have to build x265. Move to the right build folder and launch the configuration script using cmake. After that use the classical “make && make install”.

We continue building the last external library. Unpack libaacplus sources, enter in directory and build it. Have a look to the with-fftw3-prefix parameter. In Debian most of the libraries are installed in a arch-dependent directory, so you have to put the right folder based on your architecture. The most used are i386-linux-gnu and x86_64-linux-gnu. Remember to add the trailing slash at the end of the path.

All external libraries are done. Now, in order to let FFmpeg configure script to find the right external libraries, you need to prepare some environment variables. I prefer to prepare a script which do all the work and contains all configuration flags.

Now we need to launch classical “make && make install”

We are just one step from the end.

FFmpeg need to find all external libraries in order to be launched, and our libraries are installed using a custom prefix, with different directories inside /opt. I suggest to prepare an environment script which sets all variables needed, ready to be launched before calling ffmpeg command. Put it on /opt/ffmpeg/

Now, to launch FFmpeg from shell you can use these commands:

Now enjoy your fresh FFmpeg in your Debian.

Arduino Yun continuous reset

Default Arduino Yun behavior is to wait for WiFi interface to work.
If you disable Wireless interface (maybe if you want to use it as a simple Arduino with Ethernet features), its startup system will run a command called “wifi-live-or-reset” and your arduino will auto-reset about every minute.

If you don’t need WiFi feature, just comment out the line in your /etc/rc.local startup file and your Arduino starts working as expected.

If you have already disabled WiFi interface, you have to do it as faster as possible, just before your system reboot.