unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: guix-devel@gnu.org
Subject: Kernel recompilation on Novena
Date: Sat, 6 Jun 2015 14:48:28 +0200	[thread overview]
Message-ID: <20150606124828.GA6394@debian> (raw)

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.

             reply	other threads:[~2015-06-06 12:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-06 12:48 Andreas Enge [this message]
2015-06-07 20:10 ` Kernel recompilation on Novena 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150606124828.GA6394@debian \
    --to=andreas@enge.fr \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).