Add some of kivutar's patches for ARM Linux