From: Michael Fothergill <michael.fothergill@gmail.com>
To: gentoo-alt@lists.gentoo.org
Subject: Re: [gentoo-alt] problem installing gentoo prefix on debian buster
Date: Fri, 7 Jun 2019 09:10:34 +0100 [thread overview]
Message-ID: <CANc=Sd0yvMd2fUHpOkbkbtyvOfwjA6P6HybGgj4MX37TSPUBuQ@mail.gmail.com> (raw)
In-Reply-To: <20190605185033.GJ27241@gentoo.org>
Many thanks for your reply.
The reason for compiling a kernel in gentoo tailored for use in debian
is as follows.
A while ago when the first set of kernels were made with the patches
for the meltdown and spectre vulnerabilities, I
installed the latest kernels with these fixes as soon as they were
released into my gentoo install.
Then I thought to do the same thing in debian.
But there was a problem.
Debian only put out new kernels from time to time and no spectre
enabled off the shelf kernel was available.
So that meant I would have to compile a custom kernel in debian as I
did in gentoo which would have the spectre fix in it.
This turned out not to be an easy task.
At the time you could only compile the spectre fix with gcc 8 and you
could only install it if you were running debian unstable (sid).
I ended up upgrading my debian stretch install to unstable and
installed gcc 8 with some effort.
I tried to configure and install a new kernel using the make kpkg
command in debian but I could not make it work.
It seemed to me that building kernels in gentoo was a lot easier than
in debian at the time.
Since then off the shelf kernels have been created in debian that
contain the meltdown and spectre fixes but I notice there seem to be
new vulnerability fixes
in the pipeline in upcoming kernel releases.
So I then began to wonder if I could make an extra kernel that would
be made to be used in debian at the same time as I would make the
gentoo one - both
kernels being made in gentoo. The debian one would be ported to my
debian install.
I then posted this on to the gentoo kernel page on the forum site and
Neddy Seagoon the site administrator and Hu the moderator both helped
with some creative
suggestions see here:
https://forums.gentoo.org/viewtopic-t-1096872.html
Neddy Seagoon suggested (at least) two useful things:
1. make a new copy of the makefile for the current kernel and change
the EXTRAVERSION parameter from -gentoo to -debian:
e.g.
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 1
SUBLEVEL = 1
EXTRAVERSION = -gentoo
NAME = Shy Crocodile
He then pointed out that the kernel make system has some useful targets in it:
...
Kernel packaging:
rpm-pkg - Build both source and binary RPM kernel packages
binrpm-pkg - Build only the binary kernel RPM package
deb-pkg - Build both source and binary deb kernel packages
bindeb-pkg - Build only the binary kernel deb package
...
2. He then said I would have to copy the kernel directory contents and
compile the new kernel in it etc.
We then had a discussion about the fact that copying the kernel
directory was kind of untidy etc.
Then Hu made a post saying there there were ways to build multiple
kernels from a single tree by setting certain environment variables
($KBUILD_OUTPUT, $INSTALL_PATH, $INSTALL_MOD_PATH) that would mean you
could avoid copying the kernel.
I found a script Hu had posted on this elsewhere on the gentoo forums:
#!/bin/bash
TDIR="$1"; shift
if [ -z "${TDIR}" ]; then
TDIR="$(uname -r)"
echo 'No release specified. Defaulting to '"\"$TDIR\""'.'
fi
TKERN="${TDIR/*_}"
BDIR="$HOME"/kernel/
KSRC="${1:-/usr/src/linux-"${TKERN}"}"; shift
export KBUILD_OUTPUT="${BDIR}${TDIR}/"
export INSTALL_PATH="${BDIR}install/${TDIR}/boot/"
export INSTALL_MOD_PATH="${BDIR}install/${TDIR}/"
if [ ! -d "$KSRC" ]; then
echo 'Directory '"$KSRC"' does not exist.' >&2
exit 1
fi
for a in "$KBUILD_OUTPUT" "$INSTALL_PATH"; do
if [ ! -d "$a" ]; then
mkdir -p "$a" || exit $?
echo "Created $a"
fi
done
echo KBUILD_OUTPUT="${KBUILD_OUTPUT}"
echo INSTALL_PATH="${INSTALL_PATH}"
echo INSTALL_MOD_PATH="${INSTALL_MOD_PATH}"
cd "$KSRC"
exec /bin/bash
I had a go at running it.
If you look toward the end of the gentoo forums thread you will see
the problems i encountered trying to do this in practice.
I had problems making the make deb-pkg and/or make bindeb-pkg command
work in gentoo.
Then I had the idea of installing gentoo prefix in debian itself and
experimenting with the idea of getting the host debian install
to make the deb packages that produce the debian kernel image files
and doing the initramfs set up but still using the gentoo
prefix and portage to compile and configure the kernel itself ready
for debian to do the packaging that gentoo seemed to be poor at
doing in practice.
I also looked at the electron builder package a bit to see if it could
help here.
Comments appreciated.
Regards
MF
next prev parent reply other threads:[~2019-06-07 8:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 9:47 [gentoo-alt] problem installing gentoo prefix on debian buster Michael Fothergill
2019-06-04 10:01 ` Fabian Groffen
2019-06-04 10:10 ` Michael Fothergill
2019-06-04 10:37 ` Fabian Groffen
2019-06-04 10:51 ` Michael Fothergill
2019-06-04 11:01 ` Michael Fothergill
2019-06-04 11:13 ` Fabian Groffen
2019-06-04 11:21 ` Michael Fothergill
2019-06-04 11:28 ` Michael Fothergill
2019-06-04 11:35 ` Michael Fothergill
2019-06-04 11:46 ` Olivier Huber
2019-06-04 11:54 ` Fabian Groffen
2019-06-04 12:02 ` Michael Fothergill
2019-06-04 13:26 ` Michael Fothergill
2019-06-04 11:08 ` Michael Fothergill
2019-06-04 16:19 ` Michael Fothergill
2019-06-04 17:24 ` Fabian Groffen
2019-06-05 7:38 ` Michael Fothergill
2019-06-05 17:16 ` Michael Fothergill
2019-06-05 18:50 ` Fabian Groffen
2019-06-07 8:10 ` Michael Fothergill [this message]
2019-07-03 17:17 ` Michael Fothergill
2019-06-04 10:39 ` Michael Fothergill
2019-06-17 9:19 ` Fabian Groffen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANc=Sd0yvMd2fUHpOkbkbtyvOfwjA6P6HybGgj4MX37TSPUBuQ@mail.gmail.com' \
--to=michael.fothergill@gmail.com \
--cc=gentoo-alt@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox