Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-13-2014, 03:10 PM
|
#1
|
LQ Newbie
Registered: Oct 2014
Location: Canada
Distribution: Slackware 14.1
Posts: 13
Rep:
|
Make errors when building from kernel source 3.10.7 in seperate output directory
Hello,
I'm on Slackware 14.1
What I'm trying to do: 'make O=/my/build/folder' from /usr/src/linux-3.10.17, as a normal user.
I'm using a slightly modified config-generic-smp as .config
First error I get is about the source directory no being clean and that I need to 'make mrproper', but of course I can only do that as root. I figure there must be a good reason the kernel-source package ships in an unclean state.
If I run 'make mrproper' as root, then running 'make O=/my/build/folder' afterwards(as non-root) works for a while but then fails because of a missing header 'hz.h'
Turns out that 'make mrproper' deletes a bunch of headers in ./include/config so I had to reinstall the kernel-source package.
I also tried from a copied source directory (cp -s -r ...) so I could run 'make mrproper' as non-root and then recopied those headers in ./include/config but it still complains that mrproper should be run.
At this point, I'm stumped.
Last edited by duffman; 10-13-2014 at 03:14 PM.
|
|
|
10-13-2014, 03:23 PM
|
#2
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552
|
Why not make life easier and copy /usr/src/linux-3.10.17 content in your /my/build/folder, then change permissions and compile from here
Last edited by keefaz; 10-13-2014 at 03:25 PM.
|
|
|
10-13-2014, 03:46 PM
|
#3
|
LQ Newbie
Registered: Oct 2014
Location: Canada
Distribution: Slackware 14.1
Posts: 13
Original Poster
Rep:
|
I did, the problem is those missing headers in include/config, the ones that get deleted by 'make mrproper'. Are they supposed to be regenerated? Because they are not.
|
|
|
10-13-2014, 04:19 PM
|
#4
|
LQ Newbie
Registered: Oct 2014
Location: Canada
Distribution: Slackware 14.1
Posts: 13
Original Poster
Rep:
|
Here is make's output tail I get:
...
CC kernel/fork.o
CC kernel/exec_domain.o
CC kernel/panic.o
CC kernel/printk.o
CC kernel/cpu.o
CC kernel/exit.o
CC kernel/itimer.o
make[2]: *** No rule to make target `/tmp/build/kernel/include/config/hz.h', needed by `kernel/hz.bc'. Stop.
make[1]: *** [kernel] Error 2
make: *** [sub-make] Error 2
|
|
|
10-13-2014, 04:50 PM
|
#5
|
LQ Newbie
Registered: Oct 2014
Location: Canada
Distribution: Slackware 14.1
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by keefaz
Why not make life easier and copy /usr/src/linux-3.10.17 content in your /my/build/folder, then change permissions and compile from here
|
Ok so I did a real copy of the source (cp -r instead of cp -s -r) and it's compiling fine now.
Thanks.
Still irks me that I have to do a whole copy when it's already installed once.
|
|
|
10-13-2014, 04:57 PM
|
#6
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,155
Rep:
|
Quote:
Originally Posted by duffman
Still irks me that I have to do a whole copy when it's already installed once.
|
You don't have to. Why not just customize the LOCALVERSION in "General setup"?
|
|
|
10-13-2014, 05:28 PM
|
#7
|
LQ Newbie
Registered: Oct 2014
Location: Canada
Distribution: Slackware 14.1
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by Didier Spaier
You don't have to. Why not just customize the LOCALVERSION in "General setup"?
|
I always do that. I added '-custom-'. If I didn't, 'make modules_install' would overwrite the modules installed by the 'kernel-modules-smp' package, which is a bad. I learned that the hard way years ago.
Not sure what you're getting at. That setting doesn't affect where Make looks for headers.
|
|
|
10-13-2014, 05:33 PM
|
#8
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,155
Rep:
|
Quote:
Originally Posted by duffman
Not sure what you're getting at. That setting doesn't affect where Make looks for headers.
|
Actually I don't understand why you need to use "make O=". Why not build the kernel and modules in place?
|
|
|
10-13-2014, 05:54 PM
|
#9
|
LQ Newbie
Registered: Oct 2014
Location: Canada
Distribution: Slackware 14.1
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by Didier Spaier
Actually I don't understand why you need to use "make O=". Why not build the kernel and modules in place?
|
The whole point of the 'O=' functionality is to allow making kernels builds with different .config, which allows minimal rebuild times when you tweak each.
For example I could do
'make O=/my/build/folder1' where LOCALVERSION is set to 'custom1'
'make O=/my/build/folder2' where LOCALVERSION is set to 'custom2'
Because of the errors I get with 'make O=', instead I have to make a whole source copy for each config and build in place.
Follow me? I don't know how to explain it better.
|
|
|
10-13-2014, 06:31 PM
|
#10
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552
|
I never used O option, but personally I prefer don't touch /usr/src/linux* dir, as I consider it like system dir (distribution kernel source). I used to always compile custom kernels as user in separate directory (I think I read somewhere a suggestion by Linus Torvalds to not compile kernels in /usr/src)
Now if I read the Makefile about O option:
Code:
# kbuild supports saving output files in a separate directory.
# To locate output files in a separate directory two syntaxes are supported.
# In both cases the working directory must be the root of the kernel src.
# 1) O=
# Use "make O=dir/to/store/output/files/"
#
# 2) Set KBUILD_OUTPUT
# Set the environment variable KBUILD_OUTPUT to point to the directory
# where the output files shall be placed.
# export KBUILD_OUTPUT=dir/to/store/output/files/
# make
#
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
# variable.
At this point, I don't know how mrproper would deal with this, no experience on that
Last edited by keefaz; 10-13-2014 at 06:32 PM.
|
|
|
10-14-2014, 06:18 AM
|
#11
|
LQ Veteran
Registered: May 2008
Posts: 7,004
|
If you've done an in-tree build (one without 'O=/somewhere') then you can't use that source tree to build another kernel. You have to do a 'make mrproper' on it first, but once you've done that 'make mrproper' you can use the tree for any number of builds if they all use 'O=/somewhere-unique'.
The reason Pat ships /usr/src/linux in an unclean state is that its contents are required if you ever need to build out-of-tree kernel modules for use with the stock kernel. If he shipped pristine sources, then you wouldn't be able to do that. Unless that is Pat himself started building the stock kernels with O=/somewhere in order to preserve /usr/src/linux.
O= is very useful if you're building from kernel sources under the control of git. Without it a 'git checkout -f' would delete the results of your last build. If you've used O= you can switch back and forth at will, without having to give each build its own copy of the kernel sources.
I use /usr/obj/$VERSION$LOCALVERSION for my O= build directories. Once built, I do a 'make O=... clean && make O=... prepare' on the builddir to reclaim a little disk space.
I use a build script that does the build and nicely packages all this up for me. I end up
with a single package that looks something like this:
Code:
PACKAGE NAME: kernel-3.14.y-custom-3.14.20-x86_64-1_local
COMPRESSED PACKAGE SIZE: 5.4M
UNCOMPRESSED PACKAGE SIZE: 12M
PACKAGE LOCATION: kernel-3.14.y-custom-3.14.20-x86_64-1_local.txz
PACKAGE DESCRIPTION:
kernel-3.14.y-custom: Kernel 3.14.20-custom
kernel-3.14.y-custom:
kernel-3.14.y-custom: This is an all-in-one package that contains
kernel-3.14.y-custom: a linux kernel, its modules and its build directory.
kernel-3.14.y-custom:
kernel-3.14.y-custom: Package includes:
kernel-3.14.y-custom: /boot/vmlinuz-3.14.20-custom
kernel-3.14.y-custom: /boot/System.map-3.14.20-custom
kernel-3.14.y-custom: /lib/modules/3.14.20-custom/...
kernel-3.14.y-custom: /usr/obj/3.14.20-custom/...
kernel-3.14.y-custom:
May seem over-engineered to some, but I've been using this for around 4 years now and it works well for me, but we each have our own ways of doing things.
Last edited by GazL; 10-14-2014 at 06:21 AM.
|
|
|
10-14-2014, 09:45 PM
|
#12
|
LQ Newbie
Registered: Oct 2014
Location: Canada
Distribution: Slackware 14.1
Posts: 13
Original Poster
Rep:
|
Good to know, thanks.
|
|
|
10-14-2014, 09:50 PM
|
#13
|
LQ Newbie
Registered: Oct 2014
Location: Canada
Distribution: Slackware 14.1
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by GazL
May seem over-engineered to some, but I've been using this for around 4 years now and it works well for me, but we each have our own ways of doing things.
|
You can never automate too much, time is so precious
|
|
|
All times are GMT -5. The time now is 04:25 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|