Skip to contentSkip to conversation

Check handling of kernel build output directory

DISCUSSION Markus Elfring 4 participants 15 messages Oct 26, 2007 – Oct 27, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

Two ways are mentioned in the Makefile for the Linux kernel 2.6.31.1 to specify output diretories. The description of the environment variable "KBUILD_OUTPUT" is missing from the file "README".

I am trying to generate all executable files for the current stable kernel release on my openSUSE 10.3 system.

Sonne:/usr/src/linux # make mrproper
Sonne:/usr/src/linux # cp -p /boot/config-2.6.23.1-0-adjusted .config [reactivate backup copy]

Sonne:/usr/src/linux # export KBUILD_OUTPUT=/usr/src/obj/linux/2.6.23.1/x86_64/adjusted Sonne:/usr/src/linux # make silentoldconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/x86_64/Kconfig
***
*** You have not yet configured your kernel!
*** (missing kernel .config file)
***
*** Please run some configurator (e.g. "make oldconfig" or *** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** [silentoldconfig] Error 2

Another try:
Sonne:/usr/src/linux # make oldconfig
[...]
#

# configuration written to .config
#
Sonne:/usr/src/linux # date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make -j4
&& echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && make -j4 modules_install install &&
echo ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ && date
Fri Oct 26 18:38:18 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
scripts/kconfig/conf -s arch/x86_64/Kconfig
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-x86_64
  Using /usr/src/linux-2.6.23.1 as source for kernel
  /usr/src/linux-2.6.23.1 is not clean, please run 'make mrproper'
  in the '/usr/src/linux-2.6.23.1' directory.
make[1]: *** [prepare3] Error 1
make: *** [_all] Error 2
make: INTERNAL: Exiting with 5 jobserver tokens available; should be 4!

Does this error message correspond to the open issue that was described in the bug report "make randomly fails with interrupted system call on slower filesystems with parallel builds"?
http://savannah.gnu.org/bugs/?14853

When this happens, there is always one more token available than I've specified by the parameter "-j". If I ommit it, I get the following result.

Sonne:/usr/src/linux # date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make && echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && make modules_install install && echo ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ && date
Fri Oct 26 19:17:18 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Using /usr/src/linux-2.6.23.1 as source for kernel /usr/src/linux-2.6.23.1 is not clean, please run 'make mrproper'
in the '/usr/src/linux-2.6.23.1' directory.
make[1]: *** [prepare3] Error 1
make: *** [_all] Error 2

The option to build into a specific output diretory is unusable on my system so far. Would you like to share any ideas to resolve this unpleasant situation?

Regards,
Markus

#1 lore raw
Quoted 5 lines · Markus Elfring

Hello,

Two ways are mentioned in the Makefile for the Linux kernel 2.6.31.1 to specify output diretories. The description of the environment variable "KBUILD_OUTPUT" is missing from the file "README".

Aren't you supposed to use O= as described by "make help"?

Vegard

#2 lore raw
Quoted 1 line

Aren't you supposed to use O= as described by "make help"?

I expect that both ways should work. I find it easier to use the environment variable "KBUILD_OUTPUT" because the command line parameter does not need to be repeated on each make invocation.

Anyway - How do you think about my following test result?

Sonne:/usr/src/linux # MY_OUTDIR=/usr/src/obj/linux/2.6.23.1/x86_64/adjusted && rm -rf $MY_OUTDIR/*
Sonne:/usr/src/linux # unset KBUILD_OUTPUT && make mrproper
CLEAN .config
Sonne:/usr/src/linux # cp -p /boot/config-2.6.23.1-0-adjusted .config Sonne:/usr/src/linux # make O=$MY_OUTDIR oldconfig && date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make -j3 O=$MY_OUTDIR && echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && make -j3 O=$MY_OUTDIR modules_install install && echo ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ && date

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -o arch/x86_64/Kconfig
*
* Linux Kernel Configuration
*
[...]
#

# configuration written to .config
#
Fri Oct 26 20:30:39 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
scripts/kconfig/conf -s arch/x86_64/Kconfig
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-x86_64
  Using /usr/src/linux-2.6.23.1 as source for kernel
  /usr/src/linux-2.6.23.1 is not clean, please run 'make mrproper'
  in the '/usr/src/linux-2.6.23.1' directory.
make[1]: *** [prepare3] Error 1
make: *** [_all] Error 2
make: INTERNAL: Exiting with 4 jobserver tokens available; should be 3!

How does any internal status information get inconsistent here?

Regards,
Markus

#3 lore raw
Quoted 5 lines
Quoted 1 line

Aren't you supposed to use O= as described by "make help"?

I expect that both ways should work. I find it easier to use the environment variable "KBUILD_OUTPUT" because the command line parameter does not need to be repeated on each make invocation.

A wording correction:
I expect that both ways should work. I find it easier to use the environment variable "KBUILD_OUTPUT" because it does not need to be repeated on each make invocation like it must happen with the command line parameter "O=".

Regards,
Markus

#4 lore raw
Quoted 10 lines · Markus Elfring
Quoted 5 lines
Quoted 1 line

Aren't you supposed to use O= as described by "make help"?

I expect that both ways should work. I find it easier to use the environment variable "KBUILD_OUTPUT" because the command line parameter does not need to be repeated on each make invocation.

A wording correction:
I expect that both ways should work. I find it easier to use the environment variable "KBUILD_OUTPUT" because it does not need to be repeated on each make invocation like it must happen with the command line parameter "O=".

So why not just...
export O=/foo/bar

#5 lore raw
Quoted 8 lines · Jan Engelhardt
Quoted 6 lines · Markus Elfring
Quoted 5 lines
Quoted 1 line

Aren't you supposed to use O= as described by "make help"?

I expect that both ways should work. I find it easier to use the environment variable "KBUILD_OUTPUT" because the command line parameter does not need to be repeated on each make invocation.

Quoted 7 lines
Quoted 4 lines

A wording correction:
I expect that both ways should work. I find it easier to use the environment variable "KBUILD_OUTPUT" because it does not need to be repeated on each make invocation like it must happen with the command line parameter "O=".

So why not just...
export O=/foo/bar

When introducing the make O=...
I was a bit anal about where the definition of O came from so you will see that in the top-level Makefile we check if O= is defined at the commandline:

ifdef O
ifeq ("$(origin O)", "command line")

    KBUILD_OUTPUT := $(O)

endif
endif

"O" is just too vague to be picked up from the environment.

Sam

#6 lore raw
In reply to Markus Elfring

Hi Markus.

Quoted 3 lines

Two ways are mentioned in the Makefile for the Linux kernel 2.6.31.1 to specify output diretories. The description of the environment variable "KBUILD_OUTPUT" is missing from the file "README".

It is on purpose left out - README contains only the most typical stuff. And no-one has written a "everything you possible want to know about building the kernel" text yet for some reason :-(

Quoted 15 lines

I am trying to generate all executable files for the current stable kernel release on my openSUSE 10.3 system.

Sonne:/usr/src/linux # make mrproper
Sonne:/usr/src/linux # cp -p /boot/config-2.6.23.1-0-adjusted .config [reactivate backup copy]

Sonne:/usr/src/linux # export KBUILD_OUTPUT=/usr/src/obj/linux/2.6.23.1/x86_64/adjusted Sonne:/usr/src/linux # make silentoldconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
Quoted 17 lines

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/x86_64/Kconfig
***
*** You have not yet configured your kernel!
*** (missing kernel .config file)
***
*** Please run some configurator (e.g. "make oldconfig" or *** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** [silentoldconfig] Error 2

So here you do not have a .config file in the directory: /usr/src/obj/linux/2.6.23.1/x86_64/adjusted So you are told to create one using some of the available methods.

Quoted 16 lines

Another try:
Sonne:/usr/src/linux # make oldconfig
[...]
#

# configuration written to .config
#
Sonne:/usr/src/linux # date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make -j4
&& echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && make -j4 modules_install install &&
echo ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ && date
Fri Oct 26 18:38:18 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
scripts/kconfig/conf -s arch/x86_64/Kconfig
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  CHK     include/linux/version.h
  UPD     include/linux/version.h
Quoted 8 lines
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-x86_64
  Using /usr/src/linux-2.6.23.1 as source for kernel
  /usr/src/linux-2.6.23.1 is not clean, please run 'make mrproper'
  in the '/usr/src/linux-2.6.23.1' directory.
make[1]: *** [prepare3] Error 1
make: *** [_all] Error 2

Here kbuild tells you that "/usr/src/linux-2.6.23.1 is not clean". This is another way to tell you that the kernel source you are using contains files that will cause your build to fail later on.
The suggested way to fix it is to run "make mrproper" but in your case you would then delete all the output files of your vendor supplied kernel. What you should do in your case is to:
1) Take a full copy of the kernel tree
2) run "make mrproper" in the tree
3) Copy over your adjusted .config
4) make

Then a few minutes later you have a kernel and maybe a few modules. To install them either use sudo or do so as root:
sudo make modules_install
sudo make install

Quoted 4 lines

make: INTERNAL: Exiting with 5 jobserver tokens available; should be 4!
Does this error message correspond to the open issue that was described in the bug report "make randomly fails with interrupted system call on slower filesystems with parallel builds"?
http://savannah.gnu.org/bugs/?14853

This is something internal make stuff that is irrelevant in this case.

Sam

#7 lore raw
Quoted 2 lines

So here you do not have a .config file in the directory: /usr/src/obj/linux/2.6.23.1/x86_64/adjusted So you are told to create one using some of the available methods.

The README contains the following description.

"...
"make oldconfig" Default all questions based on the contents of
your existing ./.config file and asking about new config symbols.
"make silentoldconfig"
Like above, but avoids cluttering the screen with questions already answered.
..."

I did not expect that there are more differences besides the "silence".

Quoted 1 line

The suggested way to fix it is to run "make mrproper"

I did that clean-up step.

Quoted 1 line

but in your case you would then delete all the output files of your vendor supplied kernel.

I hope not because I've setup symbolic links to point to the current release as far I know instead of the release "2.6.22.9-0.4-default" that I am using at the moment.

Quoted 1 line

This is something internal make stuff that is irrelevant in this case.

It is relevant in my case if I want to use different output directories for parallel builds from the same source directory.

Regards,
Markus

#8 lore raw
Quoted 2 lines

I did that clean-up step.

You did it in your output directory I assume.
kbuild complains that the source directory is not clean - which is what you need to clean up.

Sam

#9 lore raw
Quoted 1 line

You did it in your output directory I assume.

No.

Quoted 2 lines

kbuild complains that the source directory is not clean - which is what you need to clean up.

I am looking for the real reasons for the occuring error messages. Let us look at another test example ...

Sonne:~ # ls -ld /usr/src/linux
lrwxrwxrwx 1 root root 23 Oct 13 10:11 /usr/src/linux -> /usr/src/linux-2.6.23.1 Sonne:~ # cd /usr/src/linux-2.6.23.1
Sonne:/usr/src/linux-2.6.23.1 # unset KBUILD_OUTPUT && make mrproper && cp -p /boot/config-2.6.23.1-0-adjusted .config && export KBUILD_OUTPUT=/usr/src/obj/linux/2.6.23.1/x86_64/adjusted && rm -rf $KBUILD_OUTPUT/*
CLEAN .config
Sonne:/usr/src/linux-2.6.23.1 # make oldconfig && date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make -j2 && echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && make -j2 modules_install install && echo ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ && date

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -o arch/x86_64/Kconfig
*
* Linux Kernel Configuration
*
*
* General setup
*
[...]
#

# configuration written to .config
#
Sat Oct 27 06:43:24 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
scripts/kconfig/conf -s arch/x86_64/Kconfig
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-x86_64
  Using /usr/src/linux-2.6.23.1 as source for kernel
  /usr/src/linux-2.6.23.1 is not clean, please run 'make mrproper'
  in the '/usr/src/linux-2.6.23.1' directory.
make[1]: *** [prepare3] Error 1
make: *** [_all] Error 2
make: INTERNAL: Exiting with 3 jobserver tokens available; should be 2!

Which files are not clean in my situation after the command "make mrproper" was executed at the beginning?

Which results do you or other software developers get by such test runs on kernel releases since "2.6.22.9-0.4-default" like it is published by SUSE now?
( I can build the current Linux kernel into my source directory successfully.)

Regards,
Markus

#10 lore raw

Hi Markus.

Please do not edit cc: and to: - it is easy to miss out a mail on lkml.

Quoted 49 lines · Markus Elfring
Quoted 1 line

You did it in your output directory I assume.

No.

Quoted 2 lines

kbuild complains that the source directory is not clean - which is what you need to clean up.

I am looking for the real reasons for the occuring error messages. Let us look at another test example ...

Sonne:~ # ls -ld /usr/src/linux
lrwxrwxrwx 1 root root 23 Oct 13 10:11 /usr/src/linux -> /usr/src/linux-2.6.23.1 Sonne:~ # cd /usr/src/linux-2.6.23.1
Sonne:/usr/src/linux-2.6.23.1 # unset KBUILD_OUTPUT && make mrproper && cp -p /boot/config-2.6.23.1-0-adjusted .config && export KBUILD_OUTPUT=/usr/src/obj/linux/2.6.23.1/x86_64/adjusted && rm -rf $KBUILD_OUTPUT/*
CLEAN .config
Sonne:/usr/src/linux-2.6.23.1 # make oldconfig && date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make -j2 && echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && make -j2 modules_install install && echo ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ && date

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -o arch/x86_64/Kconfig
*
* Linux Kernel Configuration
*
*
* General setup
*
[...]
#

# configuration written to .config
#
Sat Oct 27 06:43:24 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
scripts/kconfig/conf -s arch/x86_64/Kconfig
  GEN     /usr/src/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
Quoted 1 line

From the above we can see that two make's are running in parallel here

where only one should run.
I have seen this before but only in cases where you specified several targets on the make commandline - which you do not do in the make invocation. Just to check it you could do a:
$(warning CMD=$(MAKECMDFLAGS)) around the place where SUBARCH is assigned in the top-level Makefile.

Does the issue by any chance go away if you refrain from the command && command && command && command && command && command way of doing things?

The shell _shall_ serialize it - but..

Quoted 13 lines
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h

SYMLINK include/asm -> include/asm-x86_64
Using /usr/src/linux-2.6.23.1 as source for kernel /usr/src/linux-2.6.23.1 is not clean, please run 'make mrproper' in the '/usr/src/linux-2.6.23.1' directory.
make[1]: *** [prepare3] Error 1
make: *** [_all] Error 2
make: INTERNAL: Exiting with 3 jobserver tokens available; should be 2!

Quoted 2 lines

Which files are not clean in my situation after the command "make mrproper" was executed at the beginning?

If you look at the top-level Makefile you will see:

        @echo '  Using $(srctree) as source for kernel'
        $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
                echo "  $(srctree) is not clean, please run 'make mrproper'";\
                echo "  in the '$(srctree)' directory.";\
                /bin/false; \
        fi;

So you either a .config file or the config directory. Older kernels also tested that the asm symlink in include/ was not present.
You should check that all these indeed are gone when you do "make mrproper" - you can have been hit by a privilige issue too. But that should not be the case if you copied the full tree to another place (and of course did not use cp -a). You did this - yes? And the result?

Quoted 4 lines

Which results do you or other software developers get by such test runs on kernel releases since "2.6.22.9-0.4-default" like it is published by SUSE now?
( I can build the current Linux kernel into my source directory successfully.)

If you now say this is a SUSE specific problem then I suggest asking SUSE for help. At least I have not built a distribution kernel the last year or more - and I do not follow what kind of patches they apply.

Sam

#11 lore raw
Quoted 2 lines

From the above we can see that two make's are running in parallel here where only one should run.

Is this a problem here? - I can omit the parameter "-j".

Quoted 5 lines

I have seen this before but only in cases where you specified several targets on the make commandline - which you do not do in the make invocation. Just to check it you could do a:
$(warning CMD=$(MAKECMDFLAGS)) around the place where SUBARCH is assigned in the top-level Makefile.

elfring@Sonne:~/Projekte/Linux/Kernel/2.6.23.1> unset KBUILD_OUTPUT && make mrproper && cp -p /boot/config-2.6.23.1-0-adjusted .config && export KBUILD_OUTPUT=~/Projekte/Linux/Kernel/obj/2.6.23.1/x86_64/adjusted && rm -rf $KBUILD_OUTPUT/* Makefile:165: CMD=
CLEAN .config
elfring@Sonne:~/Projekte/Linux/Kernel/2.6.23.1> make oldconfig && date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make && echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && date /home/elfring/Projekte/Linux/Kernel/2.6.23.1/Makefile:165: CMD=
GEN /home/elfring/Projekte/Linux/Kernel/obj/linux/2.6.23.1/x86_64/adjusted/Makefile
scripts/kconfig/conf -o arch/x86_64/Kconfig
*
* Linux Kernel Configuration
*
*
* General setup
*
[...]
#

# configuration written to .config
#
Sa 27. Okt 14:23:51 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
/home/elfring/Projekte/Linux/Kernel/2.6.23.1/Makefile:165: CMD=
/home/elfring/Projekte/Linux/Kernel/2.6.23.1/Makefile:165: CMD=
  GEN     /home/elfring/Projekte/Linux/Kernel/obj/2.6.23.1/x86_64/adjusted/Makefile
scripts/kconfig/conf -s arch/x86_64/Kconfig
/home/elfring/Projekte/Linux/Kernel/2.6.23.1/Makefile:165: CMD=
  Using /home/elfring/Projekte/Linux/Kernel/2.6.23.1 as source for kernel
  /home/elfring/Projekte/Linux/Kernel/2.6.23.1 is not clean, please run 'make mrproper'
  in the '/home/elfring/Projekte/Linux/Kernel/2.6.23.1' directory.
make[1]: *** [prepare3] Fehler 1
make: *** [_all] Fehler 2

Are any more steps needed to perform safe Makefile debugging now? Is the specific number of (recursive) make calls interesting?

elfring@Sonne:~/Projekte/Linux/Kernel/2.6.23.1> unset KBUILD_OUTPUT && make mrproper && cp -p /boot/config-2.6.23.1-0-adjusted .config && export KBUILD_OUTPUT=~/Projekte/Linux/Kernel/obj/2.6.23.1/x86_64/adjusted && rm -rf $KBUILD_OUTPUT/* Makefile:165: CMD=
CLEAN .config
elfring@Sonne:~/Projekte/Linux/Kernel/2.6.23.1> make silentoldconfig && date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make && echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && date /home/elfring/Projekte/Linux/Kernel/2.6.23.1/Makefile:165: CMD=

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  GEN     /home/elfring/Projekte/Linux/Kernel/obj/2.6.23.1/x86_64/adjusted/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/x86_64/Kconfig
Sa 27. Okt 14:26:53 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /home/elfring/Projekte/Linux/Kernel/2.6.23.1/Makefile:165: CMD=
Using /home/elfring/Projekte/Linux/Kernel/2.6.23.1 as source for kernel /home/elfring/Projekte/Linux/Kernel/2.6.23.1 is not clean, please run 'make mrproper' in the '/home/elfring/Projekte/Linux/Kernel/2.6.23.1' directory.
make[1]: *** [prepare3] Fehler 1
make: *** [_all] Fehler 2

Quoted 3 lines

Does the issue by any chance go away if you refrain from the command && command && command && command && command && command way of doing things?

I want to ensure that every command was successfully executed. The return values will be ignored if the commands are concatenated by the metacharacter ";". I prefer to use "AND lists" here.

Quoted 1 line

So you either a .config file or the config directory.

I would expect that both will be generated in my output directory by a command like "make silentoldconfig". Why is the cleanliness check additionally performed on my source directory? Should it really matter if I want to concentrate on "objtree"?

Quoted 1 line

If you now say this is a SUSE specific problem then I suggest asking SUSE for help.

I don't want to say that. I indicated a bit about my runtime environment. Is it more likely that the Makefile will need an update?

Regards,
Markus

#12 lore raw
In reply to Sam Ravnborg
Quoted 4 lines
Quoted 2 lines

Which files are not clean in my situation after the command "make mrproper" was executed at the beginning?

If you look at the top-level Makefile you will see:

Quoted 8 lines
        @echo '  Using $(srctree) as source for kernel'
        $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
                echo "  $(srctree) is not clean, please run 'make mrproper'";\
                echo "  in the '$(srctree)' directory.";\
                /bin/false; \
        fi;

So you either a .config file or the config directory.

Well, I've thought about another viewpoint. The Makefile insists on the detail that no configuration files are allowed in the source directory if an output directory was specified. Original wording:
"...

# prepare3 is used to check if we are building in a separate output directory,
# and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree)
..."

I seems now that my troubles came from the missing decision when to move or delete the .config file from my source directory. So the following command sequence works for a completely clean build. (It can be adjusted to support parallel configurations for debug/release situations as usual.)

elfring@Sonne:~/Projekte/Linux/Kernel/2.6.23.1> unset KBUILD_OUTPUT && make mrproper && cp -p /boot/config-2.6.23.1-0-adjusted .config && export KBUILD_OUTPUT=~/Projekte/Linux/Kernel/obj/2.6.23.1/x86_64/adjusted && rm -rf $KBUILD_OUTPUT/* && make silentoldconfig && rm .config && date && echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX && make -j4 && echo YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY && date

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  GEN     /home/elfring/Projekte/Linux/Kernel/obj/2.6.23.1/x86_64/adjusted/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/x86_64/Kconfig
Sa 27. Okt 17:37:38 CEST 2007
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
GEN /home/elfring/Projekte/Linux/Kernel/obj/2.6.23.1/x86_64/adjusted/Makefile
[...]
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
Sa 27. Okt 17:55:09 CEST 2007

Regards,
Markus

#13 lore raw
In reply to Markus Elfring
Quoted 11 lines · Markus Elfring

Two ways are mentioned in the Makefile for the Linux kernel 2.6.31.1 to specify output diretories. The description of the environment variable "KBUILD_OUTPUT" is missing from the file "README".

I am trying to generate all executable files for the current stable kernel release on my openSUSE 10.3 system.

Sonne:/usr/src/linux # make mrproper
Sonne:/usr/src/linux # cp -p /boot/config-2.6.23.1-0-adjusted .config [reactivate backup copy]

.config should be copied to the output directory.

Quoted 1 line

Sonne:/usr/src/linux # export KBUILD_OUTPUT=/usr/src/obj/linux/2.6.23.1/x86_64/adjusted

#14 lore raw
Quoted 1 line

.config should be copied to the output directory.

This copy will usually happen by a command like "make O=/usr/src/obj/linux/2.6.23.1/x86_64/adjusted silentoldconfig". It seems that something runs unusual on my openSUSE 10.3 system when an extra output directory was specified.

Regards,
Markus