all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Kernel recompilation on Novena
@ 2015-06-06 12:48 Andreas Enge
  2015-06-07 20:10 ` Ludovic Courtès
  2015-06-15 20:42 ` Andreas Enge
  0 siblings, 2 replies; 5+ messages in thread
From: Andreas Enge @ 2015-06-06 12:48 UTC (permalink / raw)
  To: guix-devel

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-15 20:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-06 12:48 Kernel recompilation on Novena Andreas Enge
2015-06-07 20:10 ` Ludovic Courtès
2015-06-08  0:54   ` Mark H Weaver
2015-06-08 12:42     ` Ludovic Courtès
2015-06-15 20:42 ` Andreas Enge

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.