Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

compiling (or rather, failing to compile) a kernel

68 views
Skip to first unread message

Lisi Reisz

unread,
Nov 10, 2012, 6:40:02 AM11/10/12
to
I have been trying to get to grips with compiling a custom kernel. I have
been shying away for too long.

I am following Stephen's marvellous work, and had got this far:

http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack

But I get errors the end of which is below. I tried to copy and paste all the
error reports that Konsole gave me, but could not manage it. Advice, please!

Thanks,
Lisi

<quote>
tar: linux-source-3.2/sound/firewire/Makefile: Cannot open: No such
file or directory
tar: linux-source-3.2/sound/i2c: Cannot mkdir: No such file or directory
tar: linux-source-3.2/sound/i2c/i2c.c: Cannot open: No such file or directory
tar: linux-source-3.2/sound/i2c/cs8427.c: Cannot open: No such file or
directory
tar: linux-source-3.2/sound/i2c/tea6330t.c: Cannot open: No such file
or directory
tar: linux-source-3.2/sound/i2c/other: Cannot mkdir: No such file or directory
tar: linux-source-3.2/sound/i2c/other/ak4117.c: Cannot open: No such
file or directory
tar: linux-source-3.2/sound/i2c/other/tea575x-tuner.c: Cannot open: No
such file or directory
tar: linux-source-3.2/sound/i2c/other/ak4114.c: Cannot open: No such
file or directory
tar: linux-source-3.2/sound/i2c/other/ak4113.c: Cannot open: No such
file or directory
tar: linux-source-3.2/sound/i2c/other/ak4xxx-adda.c: Cannot open: No
such file or directory
tar: linux-source-3.2/sound/i2c/other/Makefile: Cannot open: No such
file or directory
tar: linux-source-3.2/sound/i2c/other/pt2258.c: Cannot open: No such
file or directory
tar: linux-source-3.2/sound/i2c/Makefile: Cannot open: No such file or
directory
tar: linux-source-3.2/Kbuild: Cannot open: No such file or directory
tar: Exiting with failure status due to previous errors
lisi@Titan:/usr/src$
</quote>


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211101135.2...@gmail.com

Lisi Reisz

unread,
Nov 10, 2012, 7:30:01 AM11/10/12
to

Lisi Reisz

unread,
Nov 10, 2012, 8:00:01 AM11/10/12
to
I have been trying to get to grips with compiling a custom kernel. I have
been shying away for too long.

I am following Stephen's marvellous work, and had got this far:

http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack

But I get these errors
http://paste.ubuntu.com/1347707/

I tried to copy and paste the whole error report that Konsole gave me, but
could not manage it. It was basically the same thing repeated with every
file, so very long. Advice, please!

Thanks,
Lisi


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211101258.4...@gmail.com

Hugo Vanwoerkom

unread,
Nov 10, 2012, 8:40:01 AM11/10/12
to
Lisi Reisz wrote:
> I have been trying to get to grips with compiling a custom kernel. I have
> been shying away for too long.
>
> I am following Stephen's marvellous work, and had got this far:
>
> http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack
>
> But I get errors the end of which is below. I tried to copy and paste all the
> error reports that Konsole gave me, but could not manage it. Advice, please!
>

<snip>

What command did you issue?

Hugo


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/k7ll5p$3hf$1...@ger.gmane.org

Stephen Powell

unread,
Nov 10, 2012, 9:40:02 AM11/10/12
to
On Sat, 10 Nov 2012 06:35:21 -0500 (EST), Lisi Reisz wrote:
>
> I have been trying to get to grips with compiling a custom kernel. I have
> been shying away for too long.
>
> I am following Stephen's marvellous work, and had got this far:
>
> http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack
>
> But I get errors the end of which is below. I tried to copy and paste all the
> error reports that Konsole gave me, but could not manage it. Advice, please!
>
> Thanks,
> Lisi
>
> ...

Hi, Lisi. My guess is that this is a permissions issue. Is your id a member
of group src? (Issue the "groups" command and see if src is one of the groups
listed in the output of the command.) Here is a summary of the permission
environment that must exist before you attempt to unpack the source as a non-root
user:

(1) The directory /usr/src must be owned by user root and by group src.
(2) The group (src) must have read, write, and execute permissions on /usr/src.
(3) The group (src) must have the "set group id" permission on /usr/src.
(4) Your non-root userid must be a member of group src.
(5) The output of the "groups" command, when issued by your non-root userid,
must list "src" as one of the groups. Please review the "Introduction"
section of the document.

--
.''`. Stephen Powell
: :' :
`. `'`
`-


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/375643185.1015443.1352...@md01.wow.synacor.com

Tom Furie

unread,
Nov 10, 2012, 10:40:02 AM11/10/12
to
On Sat, Nov 10, 2012 at 09:31:57AM -0500, Stephen Powell wrote:

> Hi, Lisi. My guess is that this is a permissions issue. Is your id a member
> of group src? (Issue the "groups" command and see if src is one of the groups
> listed in the output of the command.) Here is a summary of the permission
> environment that must exist before you attempt to unpack the source as a non-root
> user:
>
> (1) The directory /usr/src must be owned by user root and by group src.
> (2) The group (src) must have read, write, and execute permissions on /usr/src.
> (3) The group (src) must have the "set group id" permission on /usr/src.
> (4) Your non-root userid must be a member of group src.
> (5) The output of the "groups" command, when issued by your non-root userid,
> must list "src" as one of the groups. Please review the "Introduction"
> section of the document.

Alternatively, if you can't or don't want to have your user in the src
group, just extract the tarball somewhere under $HOME. From $HOME you
can run "tar xf /usr/src/linux-source-<version>.tar.bz2" (or whatever)
and it will extract it into $HOME.

Cheers,
Tom

--
Half of being smart is knowing what you're dumb at.
signature.asc

Lisi Reisz

unread,
Nov 10, 2012, 12:20:01 PM11/10/12
to
Hi Stephen - and thanks!

On Saturday 10 November 2012 14:31:57 Stephen Powell wrote:
> My guess is that this is a permissions issue.  Is your id a member
> of group src?  

Yes!
[snip]

> (1) The directory /usr/src must be owned by user root and by group src.

It wasn't, and now is.

> (2) The group (src) must have read, write, and execute permissions on
> /usr/src.

Again, they didn't, and now have.

> (3) The group (src) must have the "set group id" permission on
> /usr/src.

Again, it hadn't and now has.

> (4) Your non-root userid must be a member of group src.

yes - see below

> (5) The output of the "groups" command, when issued by your non-root
> userid, must list "src" as one of the groups.  Please review the
> "Introduction" section of the document.

Yes, I had understood that bit in the Introduction, which I had read and, I
thought, understood. :-(

Anyhow, after I did all that, I ran
$ tar -xjf linux-source-3.2.tar.bz2
and it extracted the files correctly and created the directory
linux-source-3.2

Thank you very much, Stephen. :-)

Now, back to your marvellous tome.

Lisi


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211101717.5...@gmail.com

Lisi Reisz

unread,
Nov 10, 2012, 12:30:02 PM11/10/12
to
Thanks, Tom.

I had in fact already added my user to the group src, because that instruction
came in Stephen's Introduction to his tome. But I can see this knowledge
being very useful in the future for untarring something in a directory for
which I have not got the right permissions.

So I have instructed my increasingly unreliable memory to note this well. :-)

Lisi


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211101724.5...@gmail.com

Lisi Reisz

unread,
Nov 10, 2012, 12:30:02 PM11/10/12
to
On Saturday 10 November 2012 13:34:59 Hugo Vanwoerkom wrote:
> Lisi Reisz wrote:
> > I have been trying to get to grips with compiling a custom kernel. I
> > have been shying away for too long.
> >
> > I am following Stephen's marvellous work, and had got this far:
> >
> > http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack
> >
> > But I get errors the end of which is below. I tried to copy and paste
> > all the error reports that Konsole gave me, but could not manage it.
> > Advice, please!
>
> <snip>
>
> What command did you issue?

tar -xjf linux-source-3.2.tar.bz2

But it is now solved. Stephen was right. It was a permissions problem.

Thanks for taking the trouble to answer.

Lisi


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211101720.0...@gmail.com

Martin Steigerwald

unread,
Nov 10, 2012, 1:50:01 PM11/10/12
to
Hi Lisi,

Am Samstag, 10. November 2012 schrieb Lisi Reisz:
> I have been trying to get to grips with compiling a custom kernel. I
> have been shying away for too long.
>
> I am following Stephen's marvellous work, and had got this far:
>
> http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack

This appears to be really old.

I suggest looking at

http://kernel-handbook.alioth.debian.org/

and "make-kpkg" from "kernel-package". These are the two approaches I know
of. I still use make-kpkg, cause it does everything for me in just one
command.

> But I get errors the end of which is below. I tried to copy and paste
> all the error reports that Konsole gave me, but could not manage it.
> Advice, please!

[…]
> <quote>
> tar: linux-source-3.2/sound/firewire/Makefile: Cannot open: No such
> file or directory
[…]
> lisi@Titan:/usr/src$
> </quote>

Turned out to be a permissions problem.

So you used your regular user to compile the kernel.

But a deprecated place for it. Just compile the kernel from a directory in
your home directory.

See also:

http://www.kroah.com/lkn/

Thanks,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211101946...@lichtvoll.de

Lisi Reisz

unread,
Nov 10, 2012, 2:20:02 PM11/10/12
to
Thanks, Martin. Yes, I have looked at the website you refer to, and tried to
use it. And I have the book to which you refer. The trouble is, that for
the basic stuff they are simply above my head. Stephen gives more
explanation and more and clearer instructions.

I shall certainly avail myself of what the book and
http://kernel-handbook.alioth.debian.org/ say - but shall also use Stephen's
site, which I find very useful. So much of the documentation from which one
has to work is old - but that doesn't make it useless. And anyway, I think
that Stephen updates his site, so it is not outdated.

But thank you for the recommendations. Not only might I not have known them,
but future readers of the archive might not know of them.

Lisi


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211101915.2...@gmail.com

Martin Steigerwald

unread,
Nov 10, 2012, 3:20:01 PM11/10/12
to
Am Samstag, 10. November 2012 schrieb Lisi Reisz:
> Thanks, Martin. Yes, I have looked at the website you refer to, and
> tried to use it. And I have the book to which you refer. The
> trouble is, that for the basic stuff they are simply above my
> head. Stephen gives more explanation and more and clearer
> instructions.
>
> I shall certainly avail myself of what the book and
> http://kernel-handbook.alioth.debian.org/ say - but shall also use
> Stephen's site, which I find very useful. So much of the
> documentation from which one has to work is old - but that doesn't
> make it useless. And anyway, I think that Stephen updates his site,
> so it is not outdated.

Well, if you apply common sense to what you read, old instructions can
still be quite usable. The Linux Documentation Project (TLDP) is a good
example for that.

And if Stephen updates his site, even better.

I still suggest using a directory in your home directory and having a look
at make-kpkg if you just want to compile a quick kernel now and then.

I did so today 14 times in order to find a bug.

Last call to it was:

make-kpkg -j4 --rootcmd fakeroot --initrd --append-to-version -f2fs-tp520
--revision 1 linux_image

(I build a kernel with the new flash filesystem from Samsung for this
ThinkPad T520:)

So you make old/menuconfig your kernel and then issue a command like above.
Only thing you do as root is sudo dpkg -i the build package then. You can
also build source and doc packages and so on.

I know there is the approach to build the official kernel packages, but one
has to remove targets one does not want to build for. make-kpkg just gives
me a nice kernel package for my system by default.

If anyone knows something like make-kpkg that produces packages in the
official scheme including kbuild packages, speak up.

Well, maybe you can enlighten me, cause you learnt about building kernels,
Lisi?

Thanks,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211102110...@lichtvoll.de

Stephen Powell

unread,
Nov 10, 2012, 5:50:02 PM11/10/12
to
On Sat, 10 Nov 2012 13:46:09 -0500 (EST), Martin Steigerwald wrote:
> On Sat, 10 Nov 2012 Lisi Reisz wrote:
>> I have been trying to get to grips with compiling a custom kernel. I
>> have been shying away for too long.
>>
>> I am following Stephen's marvellous work, and had got this far:
>>
>> http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack
>
> This appears to be really old.

The above document was last revised on August 4, 2012. I wouldn't classify
that as "really old". Perhaps you assumed that it is old because I
recommend using kernel-package, rather than "make deb-pkg" or some
other newer method. kernel-package has been around a while, yes. But I
recommend it for what I consider to be good reasons, which are explained
over time in the document. You are, of course, entitled to disagree with
my opinion. But it's not old. I make an effort to keep it up to date,
and suggestions are welcome.

--
.''`. Stephen Powell
: :' :
`. `'`
`-


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/153650158.1022236.1352...@md01.wow.synacor.com

Tom H

unread,
Nov 11, 2012, 12:20:01 AM11/11/12
to
On Sat, Nov 10, 2012 at 2:15 PM, Lisi Reisz <lisi....@gmail.com> wrote:
> On Saturday 10 November 2012 18:46:09 Martin Steigerwald wrote:
>> Am Samstag, 10. November 2012 schrieb Lisi Reisz:
>>>
>>> I have been trying to get to grips with compiling a custom kernel. I
>>> have been shying away for too long.
>>>
>>> I am following Stephen's marvellous work, and had got this far:
>>>
>>> http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack
>>
>> This appears to be really old.
>>
>> I suggest looking at
>>
>> http://kernel-handbook.alioth.debian.org/
>>
>> and "make-kpkg" from "kernel-package". These are the two approaches I know
>> of. I still use make-kpkg, cause it does everything for me in just one
>> command.
>>
>>> But I get errors the end of which is below. I tried to copy and paste
>>> all the error reports that Konsole gave me, but could not manage it.
>>
>>> <quote>
>>> tar: linux-source-3.2/sound/firewire/Makefile: Cannot open: No such
>>> file or directory
>>
>>> lisi@Titan:/usr/src$
>>> </quote>
>>
>> Turned out to be a permissions problem.
>>
>> So you used your regular user to compile the kernel.
>>
>> But a deprecated place for it. Just compile the kernel from a directory in
>> your home directory.
>
> Thanks, Martin. Yes, I have looked at the website you refer to, and tried to
> use it. And I have the book to which you refer. The trouble is, that for
> the basic stuff they are simply above my head. Stephen gives more
> explanation and more and clearer instructions.
>
> I shall certainly avail myself of what the book and
> http://kernel-handbook.alioth.debian.org/ say - but shall also use Stephen's
> site, which I find very useful. So much of the documentation from which one
> has to work is old - but that doesn't make it useless. And anyway, I think
> that Stephen updates his site, so it is not outdated.

Stephen's page isn't outdated. Perhaps kernel-package has been
deprecated by the kernel maintainers [1] [2] - even though it's still
being patched according to the wheezy changelog.

I've also never seen any Debian documentation pointing to building a
kernel elsewhere than in "/usr/src/". It's been the RHEL/Fedora way
for years though.

I don't see what's difficult about [3]. The problem's that if you
follow that exact procedure, you'll end end with the same kernel
version and .deb name as the linux-image package in the official
archive. You can change the kernel version by setting it as
"EXTRAVERSION" at the top of "/usr/src/linux-source-<ver>/Makefile"
(for example, the upstream release candidates set "EXTRAVERSION=-rcX")
and you can change the .deb name with "KDEB_PKGVERSION=<...> make
deb-pkg".

1. http://lists.debian.org/debian-kernel/2009/10/msg00613.html

2. http://lists.debian.org/debian-devel/2012/09/msg00330.html

3. http://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-building


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOdo=SyGe3C8e5VybJxGjc6Hmwa...@mail.gmail.com

Ralf Mardorf

unread,
Nov 11, 2012, 5:40:02 AM11/11/12
to
On Sat, 10 Nov 2012 17:45:20 -0500 (EST)
Stephen Powell <zlin...@wowway.com> wrote:
> On Sat, 10 Nov 2012 13:46:09 -0500 (EST), Martin Steigerwald wrote:
> > On Sat, 10 Nov 2012 Lisi Reisz wrote:
> >> I have been trying to get to grips with compiling a custom
> >> kernel. I have been shying away for too long.
> >>
> >> I am following Stephen's marvellous work, and had got this far:
> >>
> >> http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack
> >
> > This appears to be really old.
>
> The above document was last revised on August 4, 2012. I wouldn't
> classify that as "really old". Perhaps you assumed that it is old
> because I recommend using kernel-package, rather than "make deb-pkg"
> or some other newer method. kernel-package has been around a while,
> yes. But I recommend it for what I consider to be good reasons,
> which are explained over time in the document. You are, of course,
> entitled to disagree with my opinion. But it's not old. I make an
> effort to keep it up to date, and suggestions are welcome.

I don't have time to read the current howto now, but I'll read it ASAP.
It describes the way I build Debian and Ubuntu kernels since years, but
while my scripts are a little bit outdated, Stephen updated his howto.
However, even my outdated scripts still do work. I used a script
version from Wheezy to build a kernel for my current Ubuntu ...
$ uname -v #1 SMP PREEMPT RT Fri Nov 2 21:36:37 CET 2012 ... so 9 days
ago this old style to build a kernel still worked.

It works for Debian and Ubuntu since years. I added "--rootcmd
fakeroot", but run the script as root ;) and for sure my script does
install packages that aren't needed to build a kernel. But all in all
nothing important changed in the last years.

However, from time to time there were some issues that could be fixed
by reading the error messages and since custom build kernels usually
aren't build to fit all needs, we even could abandon some things, if
compiling those would cause trouble.

I remember one issue that occurred very often,
in /lib/modules/KERNEL_VERSION the /build and /source links were
missing or bad.

At least for Ubuntu this still is an issue, right now I noticed

"build -> /usr/src/linux-3.6.5-rt14" but correct would be linked
against "linux-headers-3.6.5-rt14".
IIRC this was an issue for my latest Debian installs too.

+1 for old school. I'm pro progress, but IMO it isn't alway progress to
use new methods, to do old things. Most of the times new methods tend to
fail, e.g. systemd [1] makes many *nix users to switch from Linux to
another *nix. Basic workflow only should change, if it's really
useful. We aren't building kernels very often, so we should be able to
relay on a method that always can be used, without reading tons of fine
manuals. I'm cleaning my tableware, but I don't change the old dishes
with new once, new tableware might look nicer, but it don't add any
new features, it only needs resources to get new tableware and it's
risky, since it might no be as dishwasher-proof as the tableware I
already own.

I hope we won't lose manifoldness for Linux :(.

Regards,
Ralf

PS:
Another example:
http://www.debian.org/doc/manuals/apt-howto/ch-helpers.en.html
I can't see anything that's obsolete.

[1] Arch Linux did ban peole from the users mailing list that argued
against systemd and meanwhile upstream makes systemd a dependency for
even DEs. I'm writing to this list and get replies off-list, because
some people aren't allowed to write to this list anymore.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20121111111629.722583ab@qrc

Martin Steigerwald

unread,
Nov 11, 2012, 1:10:01 PM11/11/12
to
Am Samstag, 10. November 2012 schrieb Stephen Powell:
> On Sat, 10 Nov 2012 13:46:09 -0500 (EST), Martin Steigerwald wrote:
> > On Sat, 10 Nov 2012 Lisi Reisz wrote:
> >> I have been trying to get to grips with compiling a custom kernel.
> >> I have been shying away for too long.
> >>
> >> I am following Stephen's marvellous work, and had got this far:
> >>
> >> http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack
> >
> > This appears to be really old.
>
> The above document was last revised on August 4, 2012. I wouldn't
> classify that as "really old". Perhaps you assumed that it is old
> because I recommend using kernel-package, rather than "make deb-pkg"
> or some other newer method. kernel-package has been around a while,
> yes. But I recommend it for what I consider to be good reasons, which
> are explained over time in the document. You are, of course, entitled
> to disagree with my opinion. But it's not old. I make an effort to
> keep it up to date, and suggestions are welcome.

I found I misread references to 2.6.8.

I am sorry. I was too quick in my judgement of how recent your webpage
was.

I use kernel-package make-kpkg myself actually.

Thanks,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211111906...@lichtvoll.de

Martin Steigerwald

unread,
Nov 11, 2012, 1:20:02 PM11/11/12
to
Right. I was too quick on that.

Sorry.

> I've also never seen any Debian documentation pointing to building a
> kernel elsewhere than in "/usr/src/". It's been the RHEL/Fedora way
> for years though.

That doesn´t make it a good practice.

I still think using a directory in home is more suitable and am following
recommendation of Greg Kroah-Hartman and others there as well as the
official recommendation in kernel README:


INSTALLING the kernel source:

- If you install the full sources, put the kernel tarball in a
directory where you have permissions (eg. your home directory) and
unpack it:

gzip -cd linux-3.X.tar.gz | tar xvf -

or

bzip2 -dc linux-3.X.tar.bz2 | tar xvf -

Replace "X" with the version number of the latest kernel.

Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be.


Granted, you can just build in a sub directory of /usr/src, but still I
would not clog that directory with my own manual builds and just leave it
to the package manager, module-assistant, possibly dkms.

Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211111911...@lichtvoll.de

Chris Bannister

unread,
Nov 11, 2012, 10:30:02 PM11/11/12
to
On Sat, Nov 10, 2012 at 09:10:01PM +0100, Martin Steigerwald wrote:
> Well, if you apply common sense to what you read, old instructions can
> still be quite usable. The Linux Documentation Project (TLDP) is a good
> example for that.

If there was one common culture then "common sense" might actually mean
something useful. (More often than not it is used in a derogatory tone.)
Documentation dating around 1999 or 2001 2002 etc, can seriously mess up
a newbies system, IMNSVHO.

--
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the
oppressing." --- Malcolm X


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20121112031639.GC27514@tal

Darac Marjal

unread,
Nov 12, 2012, 7:20:02 AM11/12/12
to
On Sat, Nov 10, 2012 at 11:56:43AM +0000, Lisi Reisz wrote:
> I have been trying to get to grips with compiling a custom kernel. I have
> been shying away for too long.
>
> I am following Stephen's marvellous work, and had got this far:
>
> http://users.wowway.com/~zlinuxman/Kernel.htm#Unpack
>
> But I get errors the end of which is below. I tried to copy and paste all the
> error reports that Konsole gave me, but could not manage it. Advice, please!
>
> Thanks,
> Lisi
>
> <quote>
> tar: linux-source-3.2/sound/firewire/Makefile: Cannot open: No such
> file or directory

Take a look at the FIRST error message of this bundle. I suspect you are
trying to extract the tarball to a directory which you don't have
permissions to write to.

signature.asc

Tom H

unread,
Nov 13, 2012, 12:10:02 AM11/13/12
to
On Sun, Nov 11, 2012 at 5:16 AM, Ralf Mardorf
<ralf.m...@alice-dsl.net> wrote:
>
> I don't have time to read the current howto now, but I'll read it ASAP.
> It describes the way I build Debian and Ubuntu kernels since years, but
> while my scripts are a little bit outdated, Stephen updated his howto.
> However, even my outdated scripts still do work. I used a script
> version from Wheezy to build a kernel for my current Ubuntu ...
> $ uname -v #1 SMP PREEMPT RT Fri Nov 2 21:36:37 CET 2012 ... so 9 days
> ago this old style to build a kernel still worked.
>
> I remember one issue that occurred very often,
> in /lib/modules/KERNEL_VERSION the /build and /source links were
> missing or bad.
>
> At least for Ubuntu this still is an issue, right now I noticed
>
> "build -> /usr/src/linux-3.6.5-rt14" but correct would be linked
> against "linux-headers-3.6.5-rt14".
> IIRC this was an issue for my latest Debian installs too.
>
> +1 for old school. I'm pro progress, but IMO it isn't alway progress to
> use new methods, to do old things. Most of the times new methods tend to
> fail, e.g. systemd [1] makes many *nix users to switch from Linux to
> another *nix. Basic workflow only should change, if it's really
> useful. We aren't building kernels very often, so we should be able to
> relay on a method that always can be used, without reading tons of fine
> manuals. I'm cleaning my tableware, but I don't change the old dishes
> with new once, new tableware might look nicer, but it don't add any
> new features, it only needs resources to get new tableware and it's
> risky, since it might no be as dishwasher-proof as the tableware I
> already own.
>
> I hope we won't lose manifoldness for Linux :(.
>
> [1] Arch Linux did ban peole from the users mailing list that argued
> against systemd and meanwhile upstream makes systemd a dependency for
> even DEs. I'm writing to this list and get replies off-list, because
> some people aren't allowed to write to this list anymore.

Thanks for the continued rants about Arch, systemd, and Linux; your
point has yet to sink in! :)

A bug report was filed more or less a year ago about make-kpkg's
kernel_headers target not creating the build and source symlinks (or
creating them incorrectly) but I can't find it at the moment.

You can force the build symlink to point at the "right" directory by copying
"/usr/share/kernel-package/examples/etc/kernel/postinst.d/force-build-link"
to
"/etc/kernel/postinst.d/force-build-link"

You could create a "force-source-link" script to do the same for the
source symlink if you're unhappy with the current make-kpkg default.

"make deb-pkg" creates the build symlink in the debbuild script but
doesn't create the source symlink.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOdo=SyRUFO3LM4uJQVorBU6vg7...@mail.gmail.com

Tom H

unread,
Nov 13, 2012, 12:20:02 AM11/13/12
to
Thanks for the README snippet above. I'd never seen it before.

"kernel-du-jour" :)

That RHEL/Fedora dont' use "/usr/src" might, on its own, not make it
good practice, but since they're following kernel documentation
perhaps it does!


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOdoSwahxSGWxr7cY_vmoY9...@mail.gmail.com

Tom Furie

unread,
Nov 13, 2012, 1:30:01 AM11/13/12
to
On Tue, Nov 13, 2012 at 12:10:55AM -0500, Tom H wrote:

> That RHEL/Fedora dont' use "/usr/src" might, on its own, not make it
> good practice, but since they're following kernel documentation
> perhaps it does!

The kernel documentation does not say not to /usr/src, it says not to
use /usr/src/linux. That doesn't mean you can't use
/usr/src/linux-source-2.6.32-5, or whatever else you might like, it just
means you shouldn't use /usr/src/linux.

Cheers,
Tom

signature.asc

Neal Murphy

unread,
Nov 13, 2012, 1:50:02 AM11/13/12
to
For generic upstream packages including the kernel, one can build them in pert
near any directory anywhere. The only caveat is that you have to specify that
location when you build companion klibc, iptables, xtables-addons and openswan
(to name a few packages).

I don't know the requirements of "The Debian Way", though I would expect
Debian builds to be slightly restricted, like putting the unpacked source
package dirs in a common parent dir.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211130145.560...@alum.wpi.edu

Tom H

unread,
Nov 13, 2012, 2:10:01 AM11/13/12
to
The documentation says

- If you install the full sources, put the kernel tarball in a
directory where you have permissions (eg. your home directory)

which basically means "don't use /usr/src" since a regular user
doesn't have write access to it by default.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOdo=SytR4rqBuT_ULj399BEgGS...@mail.gmail.com

Tom Furie

unread,
Nov 13, 2012, 2:50:03 AM11/13/12
to
On Tue, Nov 13, 2012 at 01:59:41AM -0500, Tom H wrote:

> The documentation says
>
> - If you install the full sources, put the kernel tarball in a
> directory where you have permissions (eg. your home directory)
>
> which basically means "don't use /usr/src" since a regular user
> doesn't have write access to it by default.

Which is fine for an essentially single-user system such as a home
desktop machine, but if you have a group of people who will be building
software for the system, it might make sense to have the sources in a
central location and have those people be members of a group that has
access there.

This leads into a political/philosophical discussion which probably
doesn't belong on this list.

Cheers,
Tom

--
Once I finally figured out all of life's answers, they changed the questions.
signature.asc

Tom H

unread,
Nov 13, 2012, 10:50:03 AM11/13/12
to
On Tue, Nov 13, 2012 at 2:41 AM, Tom Furie <t...@furie.org.uk> wrote:
> On Tue, Nov 13, 2012 at 01:59:41AM -0500, Tom H wrote:
>
>> The documentation says
>>
>> - If you install the full sources, put the kernel tarball in a
>> directory where you have permissions (eg. your home directory)
>>
>> which basically means "don't use /usr/src" since a regular user
>> doesn't have write access to it by default.
>
> Which is fine for an essentially single-user system such as a home
> desktop machine, but if you have a group of people who will be building
> software for the system, it might make sense to have the sources in a
> central location and have those people be members of a group that has
> access there.

I'd say the opposite. On a single-user system, using "/usr/src" to
check out code or unpack a source-code tarball's OK if that's what you
want to do but on a multi-user system, no way (even if this was SOP a
century or two ago)!

I've been pointed to this email of Linus's:

https://lkml.org/lkml/2000/7/27/10

<begin>

I would suggest that people who compile new kernels should:

- NOT do so in /usr/src. Leave whatever kernel (probably only the
header files) that the distribution came with there, but don't touch
it.

- compile the kernel in their own home directory, as their very own
selves. No need to be root to compile the kernel. You need to be root
to _install_ the kernel, but that's different.

- not have a single symbolic link in sight (except the one that the
kernel build itself sets up, namely the "linux/include/asm" symlink
that is only used for the internal kernel compile itself)

And yes, this is what I do. My /usr/src/linux still has the old 2.2.13
header files, even though I haven't run a 2.2.13 kernel in a _loong_
time. But those headers were what glibc was compiled against, so those
headers are what matches the library object files.

And this is actually what has been the suggested environment for at
least the last five years. I don't know why the symlink business keeps
on living on, like a bad zombie. Pretty much every distribution still
has that broken symlink, and people still remember that the linux
sources should go into "/usr/src/linux" even though that hasn't been
true in a _loong_ time.

Is there some documentation file that I've not updated and that people
are slavishly following outdated information in? I don't read the
documentation myself, so I'd never notice ;)

</end>


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOdo=SwJw4T-x-MV7JHHA=9csBCCsyu9ffx=Y+UhUWa...@mail.gmail.com

Stephen Powell

unread,
Nov 13, 2012, 10:40:01 PM11/13/12
to
On Sun, 11 Nov 2012 05:16:29 -0500 (EST), Ralf Mardorf wrote:
>
> I remember one issue that occurred very often,
> in /lib/modules/KERNEL_VERSION the /build and /source links were
> missing or bad.
> ...
> "build -> /usr/src/linux-3.6.5-rt14" but correct would be linked
> against "linux-headers-3.6.5-rt14".
> IIRC this was an issue for my latest Debian installs too.

I've never encountered this. Or if I have, I've never noticed
it or it never mattered. I've built out-of-kernel-source-tree modules
in conjunction with a custom kernel (by using the modules_image target)
and I've also been forced to deal with out-of-kernel-source-tree
Debian module packages that aren't designed to work with kernel-package
(by using the kernel_headers target and dkms), but in both cases
I had no trouble building the modules. Remember, for cases where
the module source package is designed to work with kernel-package,
you don't need to build or install a headers package in order to
build the modules. That's one of the qualities I like. I think it's
stupid to require that the user build and install a headers package
when the entire kernel source tree is already installed. A headers
package is a subset of the source tree, is it not? So why
build or install a headers package if the source tree is installed?

--
.''`. Stephen Powell
: :' :
`. `'`
`-


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1957485600.1086639.1352...@md01.wow.synacor.com

Stephen Powell

unread,
Nov 13, 2012, 10:50:02 PM11/13/12
to
On Sun, 11 Nov 2012 13:06:31 -0500 (EST), Martin Steigerwald wrote:
>
> I found I misread references to 2.6.8.

You raise an interesting point. Perhaps references to kernel-image vs.
linux-image have outlived their usefulness by now. I will consider
removing them in a future revision (and the references to 2.6.8 will
disappear along with them).

--
.''`. Stephen Powell
: :' :
`. `'`
`-


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1717483459.1086707.1352...@md01.wow.synacor.com
0 new messages