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

* Re: Kernel recompilation on Novena
  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-15 20:42 ` Andreas Enge
  1 sibling, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2015-06-07 20:10 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Thanks for the info!

I wonder what the status of our linux-libre package is on armhf.  I
guess we first need a config file for that platform, based on the x86
ones.

Ludo’.

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

* Re: Kernel recompilation on Novena
  2015-06-07 20:10 ` Ludovic Courtès
@ 2015-06-08  0:54   ` Mark H Weaver
  2015-06-08 12:42     ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2015-06-08  0:54 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> Thanks for the info!
>
> I wonder what the status of our linux-libre package is on armhf.  I
> guess we first need a config file for that platform, based on the x86
> ones.

I may be showing my ignorance, but it seems to me that kernels built for
armhf and mips machines usually need custom patches and configuration
that vary from one machine to another.  Or at least the armhf and mips
machines that I have access to (Novena and Loongson-based laptops)
require additional patches and custom configuration.

They also typically use bootloaders other than GRUB.  The Loongson-based
machines use PMON and the Novena uses U-Boot.

IMO, the first step is to make it easier to create custom linux-libre
packages with custom patches and additional configuration.  We will also
need to support other bootloaders.

      Mark

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

* Re: Kernel recompilation on Novena
  2015-06-08  0:54   ` Mark H Weaver
@ 2015-06-08 12:42     ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2015-06-08 12:42 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Thanks for the info!
>>
>> I wonder what the status of our linux-libre package is on armhf.  I
>> guess we first need a config file for that platform, based on the x86
>> ones.
>
> I may be showing my ignorance, but it seems to me that kernels built for
> armhf and mips machines usually need custom patches and configuration
> that vary from one machine to another.  Or at least the armhf and mips
> machines that I have access to (Novena and Loongson-based laptops)
> require additional patches and custom configuration.

Yeah, right.  I don’t know how much per-machine customization is needed.

> They also typically use bootloaders other than GRUB.  The Loongson-based
> machines use PMON and the Novena uses U-Boot.

Yes, but: <https://wiki.linaro.org/LEG/Engineering/Kernel/GRUB>.
It would be wonderful if we could stick to GRUB.

> IMO, the first step is to make it easier to create custom linux-libre
> packages with custom patches and additional configuration.

Patches going in that direction would be great.

Ludo’.

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

* Re: Kernel recompilation on Novena
  2015-06-06 12:48 Kernel recompilation on Novena Andreas Enge
  2015-06-07 20:10 ` Ludovic Courtès
@ 2015-06-15 20:42 ` Andreas Enge
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Enge @ 2015-06-15 20:42 UTC (permalink / raw)
  To: guix-devel

On Sat, Jun 06, 2015 at 02:48:28PM +0200, Andreas Enge wrote:
> the following should normally be a blog post; but I do not (yet?) have a blog.

I now do have a blog and made this the first post:
   https://enge.fr/blog/
   https://enge.fr/blog/?p=21

One can also comment, but only after clicking on the title of the entry
to open a page with only this entry (since so far there is only one, the
difference between "all entries" and "one specific entry" is slight...).

Andreas

^ 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.