From: Gregory Shearman <zekeyg@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Gentoo-sources: can't make menuconfig with user? User can't access ncurses?
Date: Tue, 3 Jan 2012 12:13:17 +1100 [thread overview]
Message-ID: <20120103011317.GA8670@pacific.net.au> (raw)
In-Reply-To: <ieZNE-3qe-19@gated-at.bofh.it>
In linux.gentoo.user, you wrote:
> On Mon, 2 Jan 2012 20:58:18 -0200
> Claudio Roberto França Pereira <spideybr@gmail.com> wrote:
>
>> I'm not currently at my Gentoo box, sorry for this, but if I don't
>> post this now I'll probably forget to post it at all.
>> Anyways, last time I tried upgrading my kernel, I copied my .config
>> and ran make menuconfig as my main user, but it whined about missing
>> ncurses libraries or something. After su'ing, everything went better
>> than expected.
>> Was that normal behavior? I remember configuring my kernel as user
>> before. Even compiling it as user.
>
>
> How did you install the kernel sources?
>
> If you downloaded them as a normal user you should be able to make
> menuconfig; make; sudo make install just fine.
>
> If portage installed the sources, then you should
> configure/compile/install as root. The sources are owned by portage
> (IIRC) and you can't su to that user, leaving only root. Or, try adding
> yourself to the portage group. Personally I think that's too much
> effort for zero gain so I always do it as root.
I use a separate output directory that is under control of the user.
What I do as an ordinary user:
mkdir <kerneloutputdir>
zcat /proc/config.gz > <kerneloutputdir>/.config
# assuming you have this option set in your kernel ie the current kernel
# config saved in /proc/config.gz
cd /usr/src/linux
# assuming that /usr/src/linux is a soft link to your new kernel
# directory.
make O=<kerneloutputdir> oldconfig
# The "O=" makes sure that any kernel output goes to the directory under
# the permissions and control of the kernel builder user rather than in
# the kernel directory under root permissions.
# If you want to make changes to the new kernel then:
make O=<kerneleoutputdir> menuconfig
You can then proceed with building kernel and modules. Yes, I know that
"make" without a command will automatically build both kernel image and
modules but I prefer to do things explicitly.
make O=<kerneleoutputdir> bzImage
make O=<kerneleoutputdir> modules
You can then install the new kernel and modules as root:
make O=<kerneleoutputdir> modules_install
make O=<kerneleoutputdir> install
You need to set the following environment variable:
KBUILD_OUTPUT=<kerneloutputdir>
This variable ensures that any emerged app can find the kernel output if
necessary. I've created a script in /etc/profile.d that automatically
keeps this environment variable up to date. Oh, remember to unset this
variable if you do *anything* requiring a busybox build (eg genkernel).
An enjoyable side-effect of this system is that when you remove an
obselete kernel from your system using "emerge -C <oldkernelversion>",
everything will be removed because there are no changes, no files added
to those portage added kernel directory.
The kernel builder user does nothing but build new kernels. This user's
home directory is a hierarchy containing current kernel builds.
I've been using this system for years now, on all my gentoo systems. It
is second nature. Of course, the .bash_history of the kernel builder
user is *very* useful for quickly doing all this from the command line.
I used to have a script to automate all this, but it is just as easy to
do from the command line.
--
Regards,
Gregory.
next parent reply other threads:[~2012-01-03 1:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ieZaW-2xe-9@gated-at.bofh.it>
[not found] ` <ieZNE-3qe-19@gated-at.bofh.it>
2012-01-03 1:13 ` Gregory Shearman [this message]
2012-01-03 14:30 ` [gentoo-user] Gentoo-sources: can't make menuconfig with user? User can't access ncurses? Mick
[not found] <if1cJ-5VM-23@gated-at.bofh.it>
[not found] ` <if1cJ-5VM-25@gated-at.bofh.it>
[not found] ` <if1cJ-5VM-21@gated-at.bofh.it>
[not found] ` <ifdGW-1V5-21@gated-at.bofh.it>
2012-01-17 22:23 ` Gregory Shearman
[not found] <CAGo3WeqXCawy_=XJ5UZV6w8BONRmr4OSh+J=UbNEgjFGAGV3TA@mail.gmail.com>
2012-01-02 23:44 ` Alan McKinnon
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=20120103011317.GA8670@pacific.net.au \
--to=zekeyg@gmail.com \
--cc=gentoo-user@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