From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 93D29138334 for ; Fri, 7 Jun 2019 08:10:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7FECCE0867; Fri, 7 Jun 2019 08:10:46 +0000 (UTC) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5CB0AE0867 for ; Fri, 7 Jun 2019 08:10:46 +0000 (UTC) Received: by mail-io1-xd41.google.com with SMTP id m24so758721ioo.2 for ; Fri, 07 Jun 2019 01:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ALeIadKwesqumhWp4VWawAgtkwPKmgrl5no0SiD6UKU=; b=N1iyF8OkkGNy0mM4HhaO7RNE/QG9k8TV22950S9mz3Ip6dsbyYHYV3YPs6WmnwnTCY dIigFDSmpFhm5rsKvkWmGtlAecum9jKojfQ0KQnmMIQ1T0Wxlmo8BclyDAPBbbYOl8PW IYhEvAdrodGkgWyNqQueCYEw+WCNnIicAAO/gAOZkfvQ2P35o10OU4GXHvTlK8thnzWI NCPFFqROI0KuAFCE0SGijbGWNCArq4v04by5+J/RPH0LL5Xwy9UjzTIB3wmYaorSmi5v H0QEkrp5zv3R51uNSs0gl2yNcu0pjzzFdho2Rdj14Wt9/auFbEo79O+TZGFGx0T+MvlT h5xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ALeIadKwesqumhWp4VWawAgtkwPKmgrl5no0SiD6UKU=; b=QCdpjxtcDO6eQI4/2GdrpLx+F/bKb3fzu0Qry7Fs+EerfBoIW0pVRP9mqTAQhkrNhE OO9HHvYn84V2Jh8N2RON10DJByg7HqswVC6gDzJgUabaujjhyLhKOzkYNIeWlZbRa7mG qdZV95fypjhGTDTNahcXycnXo7ychgj/Ns/FYFXQJTaHZ8Uq4Z0C8+u096G+/wtLT5zF DUjpcIdlHBxN4r9ca1SGNL8aEPJftUjumLEFwrs8EYP/C/uqzGxBt40L2vv9u3hg73o7 kcP5qqJ23rugAIt+DfeFmRuzXmKuHLkIKuQcGifPM1BJLduLwgJEKysWTWvsOtSUT/RJ Io+Q== X-Gm-Message-State: APjAAAX7nsDItHUQNOn40LGX5Li1WXp0/vKKQSXzuwRWPE1N0B0AEZ6Y YZfMqe8cEBLKc9SSLoTDoua2HCBA137c45xL/LEPI0DGfJU= X-Google-Smtp-Source: APXvYqy1Vyg+LtTVZR0MAABz7n6d4/kbSzVXIpO147yFyqidzbTYy66ahsdJta0rBGGKaWCzjfCUll/1ha1pzEj62X0= X-Received: by 2002:a05:6602:47:: with SMTP id z7mr5850920ioz.236.1559895045311; Fri, 07 Jun 2019 01:10:45 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-alt@lists.gentoo.org Reply-to: gentoo-alt@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <20190604100102.GB182@gentoo.org> <20190604103752.GC182@gentoo.org> <20190604172419.GE11924@gentoo.org> <20190605185033.GJ27241@gentoo.org> In-Reply-To: <20190605185033.GJ27241@gentoo.org> From: Michael Fothergill Date: Fri, 7 Jun 2019 09:10:34 +0100 Message-ID: Subject: Re: [gentoo-alt] problem installing gentoo prefix on debian buster To: gentoo-alt@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: 32ea6940-4788-407f-b674-9ec93f9b98f1 X-Archives-Hash: e5c582f5ceee9dabdc5e40c4ffec1234 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