From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: Kernel recompilation on Novena Date: Sat, 6 Jun 2015 14:48:28 +0200 Message-ID: <20150606124828.GA6394@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1DWd-0002H9-44 for guix-devel@gnu.org; Sat, 06 Jun 2015 08:48:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1DWZ-0000KE-M2 for guix-devel@gnu.org; Sat, 06 Jun 2015 08:48:34 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:54085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1DWZ-0000J4-BU for guix-devel@gnu.org; Sat, 06 Jun 2015 08:48:31 -0400 Content-Disposition: inline List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Hello, the following should normally be a blog post; but I do not (yet?) have a blog. So I am simply using the list and its archive as a place for posting the information. Andreas For Guix to work, the Novena board needs a kernel option that is disabled by default. So before installing Guix, one needs to rebuild a kernel, which is amazingly easy using a checkout of the official Novena Linux kernel and a script also provided by the project. On the Novena machine, clone the Novena Linux kernel repository: git clone https://github.com/xobs/novena-linux.git and change into the newly created directory: cd novena-linux The default branch is the older v3.17-rc5-novena; check out the newest one: git checkout origin/v3.19-novena Copy the old kernel configuration: zcat /proc/config.gz > .config Open .config in an editor, look for the line # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set and replace it by CONFIG_DEVPTS_MULTIPLE_INSTANCES=y The Novena Wiki contains a script to build a Debian package of the kernel, see http://www.kosagi.com/w/index.php?title=Novena_linux-kernel ; I slightly modified it as follows and stored it under the name build.sh in the novena-linux directory: #!/bin/sh threads=4 version=1.4 make -j${threads} \ LD=gold \ KBUILD_DEBARCH=armhf \ KBUILD_IMAGE=zImage \ KBUILD_DTB=imx6q-novena.dtb \ KBUILD_DESTDIR=usr/share/linux-novena-ae \ KDEB_PKGVERSION=${version} \ EMAIL="andreas@enge.fr" \ NAME="Andreas Enge" \ dtbs || exit 1 make -j${threads} \ LD=gold \ KBUILD_DEBARCH=armhf \ KBUILD_IMAGE=zImage \ KBUILD_DTB=imx6q-novena.dtb \ KBUILD_DESTDIR=usr/share/linux-novena-ae \ KDEB_PKGVERSION=${version} \ EMAIL="andreas@enge.fr" \ NAME="Andreas Enge" \ deb-pkg I switched to four threads instead of the suggested two, since after all we have four cores, and changed the name and e-mail addresses (which modifies the maintainer field of the final package). I also modified KBUILD_DESTDIR, where the resulting kernel image will be installed, from usr/share/linux-novena to a custom location; this is in fact not necessary, as the file names contain sufficient information on the kernel versions to avoid conflicts. The version number in the script is that of the Debian package and of minor importance; it can be increased if one compiles a newer kernel later on. Make the script executable: chmod u+x build.sh execute it: ./build.sh and wait for a few hours while the kernel compiles. The output is (in my case one directory up, do a cd .., or maybe cd $HOME) given by five files: linux-firmware-image-3.19.0-00273-ge3b61d5_1.4_armhf.deb linux-headers-3.19.0-00273-ge3b61d5_1.4_armhf.deb linux-image-3.19.0-00273-ge3b61d5_1.4_armhf.deb linux-image-3.19.0-00273-ge3b61d5-dbg_1.4_armhf.deb linux-libc-dev_1.4_armhf.deb Only the third one is really needed. Install it with dpkg -i linux-image-3.19.0-00273-ge3b61d5_1.4_armhf.deb This installs the kernel modules into /lib/modules/3.19.0-00273-ge3b61d5/ and a number of files in /usr/share/linux-novena-ae/ (the KBUILD_DESTDIR of the script above): config-3.19.0-00273-ge3b61d5 initrd.img-3.19.0-00273-ge3b61d5 System.map-3.19.0-00273-ge3b61d5 vmlinuz-3.19.0-00273-ge3b61d5 vmlinuz-3.19.0-00273-ge3b61d5.dtb The first one is a copy of the .config created in the beginning. By the post-install scripts of the Debian package, the last two files are copied to /boot, under the names of zImage and novena.dtb. Reboot, and the new kernel is active. Thanks to Ludovic Courtès and Mark Weaver for their advice on obtaining the correct configuration.