guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Kernel recompilation on Novena


From: Andreas Enge
Subject: Kernel recompilation on Novena
Date: Sat, 6 Jun 2015 14:48:28 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

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="address@hidden" \
        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="address@hidden" \
        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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]