linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [question] KBUILD_OUTPUT and modules install (with INSTALL_MOD_PATH)
@ 2020-09-14 17:57 Frank Wunderlich
  2020-09-15  2:56 ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Wunderlich @ 2020-09-14 17:57 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, linux-kernel

Hi,

i try to use modules_install target after building kernel with KBUILD_OUTPUT set

KBUILD_OUTPUT: /media/data_nvme/git/kernel/build #kernel source is in /media/data_nvme/git/kernel/BPI-R2-4.14

kernel is build successfully, but i fail on running the make modules_install target

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

Makefile:648: include/config/auto.conf: No such file or directory
make: *** [Makefile:719: include/config/auto.conf] Error 1

it looks it is ignoring the KBUILD_OUTPUT variable, as both files are present

$ ls /media/data_nvme/git/kernel/build/include/config/auto.conf
/media/data_nvme/git/kernel/build/include/config/auto.conf
$ ls /media/data_nvme/git/kernel/build/include/generated/autoconf.h
/media/data_nvme/git/kernel/build/include/generated/autoconf.h

i also tried adding KERNEL_DIR var, but also without success

sudo make ARCH=$ARCH KERNEL_DIR=$KBUILD_OUTPUT INSTALL_MOD_PATH=/media/$USER/BPI-ROOT/ modules_install

$KBUILD_OUTPUT is definitely set to right directory (checked on beginning of my function)

this message seems to be triggered by Makefile in root (here i tried to add the KBUILD_OUTPUT in the test before include without success)

 718 include/config/auto.conf:
 719     $(Q)test -e include/generated/autoconf.h -a -e $@ || (      \
 720     echo >&2;                           \
 721     echo >&2 "  ERROR: Kernel configuration is invalid.";       \
 722     echo >&2 "         include/generated/autoconf.h or $@ are missing.";\

any idea?

regards Frank


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [question] KBUILD_OUTPUT and modules install (with INSTALL_MOD_PATH)
  2020-09-14 17:57 [question] KBUILD_OUTPUT and modules install (with INSTALL_MOD_PATH) Frank Wunderlich
@ 2020-09-15  2:56 ` Masahiro Yamada
  2020-09-15  5:42   ` Frank Wunderlich
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2020-09-15  2:56 UTC (permalink / raw)
  To: Frank Wunderlich; +Cc: Michal Marek, Linux Kernel Mailing List

On Tue, Sep 15, 2020 at 2:57 AM Frank Wunderlich
<frank-w@public-files.de> wrote:
>
> Hi,
>
> i try to use modules_install target after building kernel with KBUILD_OUTPUT set
>
> KBUILD_OUTPUT: /media/data_nvme/git/kernel/build #kernel source is in /media/data_nvme/git/kernel/BPI-R2-4.14
>
> kernel is build successfully, but i fail on running the make modules_install target
>
>   ERROR: Kernel configuration is invalid.
>          include/generated/autoconf.h or include/config/auto.conf are missing.
>          Run 'make oldconfig && make prepare' on kernel src to fix it.
>
> Makefile:648: include/config/auto.conf: No such file or directory
> make: *** [Makefile:719: include/config/auto.conf] Error 1
>
> it looks it is ignoring the KBUILD_OUTPUT variable, as both files are present


KBUILD_OUTPUT is an environment variable.

Did you set (export) it
before doing 'make modules_install'?



> $ ls /media/data_nvme/git/kernel/build/include/config/auto.conf
> /media/data_nvme/git/kernel/build/include/config/auto.conf
> $ ls /media/data_nvme/git/kernel/build/include/generated/autoconf.h
> /media/data_nvme/git/kernel/build/include/generated/autoconf.h
>
> i also tried adding KERNEL_DIR var, but also without success
>
> sudo make ARCH=$ARCH KERNEL_DIR=$KBUILD_OUTPUT INSTALL_MOD_PATH=/media/$USER/BPI-ROOT/ modules_install



This is no variable like KERNEL_DIR.

"git grep KERNEL_DIR" obviously has no hit
in the kernel directory.






> $KBUILD_OUTPUT is definitely set to right directory (checked on beginning of my function)
>
> this message seems to be triggered by Makefile in root (here i tried to add the KBUILD_OUTPUT in the test before include without success)
>
>  718 include/config/auto.conf:
>  719     $(Q)test -e include/generated/autoconf.h -a -e $@ || (      \
>  720     echo >&2;                           \
>  721     echo >&2 "  ERROR: Kernel configuration is invalid.";       \
>  722     echo >&2 "         include/generated/autoconf.h or $@ are missing.";\
>
> any idea?
>
> regards Frank
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [question] KBUILD_OUTPUT and modules install (with INSTALL_MOD_PATH)
  2020-09-15  2:56 ` Masahiro Yamada
@ 2020-09-15  5:42   ` Frank Wunderlich
  2020-09-15  7:54     ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Wunderlich @ 2020-09-15  5:42 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Michal Marek, Linux Kernel Mailing List

Am 15. September 2020 04:56:55 MESZ schrieb Masahiro Yamada <masahiroy@kernel.org>:
>On Tue, Sep 15, 2020 at 2:57 AM Frank Wunderlich

>> i try to use modules_install target after building kernel with
>KBUILD_OUTPUT set
>>
>> KBUILD_OUTPUT: /media/data_nvme/git/kernel/build #kernel source is in
>/media/data_nvme/git/kernel/BPI-R2-4.14
>>
>> kernel is build successfully, but i fail on running the make
>modules_install target
>>
>>   ERROR: Kernel configuration is invalid.
>>          include/generated/autoconf.h or include/config/auto.conf are
>missing.
>>          Run 'make oldconfig && make prepare' on kernel src to fix
>it.
>>
>> Makefile:648: include/config/auto.conf: No such file or directory
>> make: *** [Makefile:719: include/config/auto.conf] Error 1
>>
>> it looks it is ignoring the KBUILD_OUTPUT variable, as both files are
>present
>
>
>KBUILD_OUTPUT is an environment variable.
>
>Did you set (export) it
>before doing 'make modules_install'?

Yes i exported it before use at beginning of my script [1] and modules_install used inside install function [2]. It works with build-function [3].
As the script is big i linked the relevant parts...i checked KBUILD_OUTPUT at beginning of install function so i'm sure it was set

>> $ ls /media/data_nvme/git/kernel/build/include/config/auto.conf
>> /media/data_nvme/git/kernel/build/include/config/auto.conf
>> $ ls /media/data_nvme/git/kernel/build/include/generated/autoconf.h
>> /media/data_nvme/git/kernel/build/include/generated/autoconf.h


[1] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L75
[2] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L368
[3] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L578
regards Frank

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [question] KBUILD_OUTPUT and modules install (with INSTALL_MOD_PATH)
  2020-09-15  5:42   ` Frank Wunderlich
@ 2020-09-15  7:54     ` Masahiro Yamada
  2020-09-15  8:07       ` Aw: " Frank Wunderlich
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2020-09-15  7:54 UTC (permalink / raw)
  To: Frank Wunderlich; +Cc: Michal Marek, Linux Kernel Mailing List

On Tue, Sep 15, 2020 at 2:42 PM Frank Wunderlich
<frank-w@public-files.de> wrote:
>
> Am 15. September 2020 04:56:55 MESZ schrieb Masahiro Yamada <masahiroy@kernel.org>:
> >On Tue, Sep 15, 2020 at 2:57 AM Frank Wunderlich
>
> >> i try to use modules_install target after building kernel with
> >KBUILD_OUTPUT set
> >>
> >> KBUILD_OUTPUT: /media/data_nvme/git/kernel/build #kernel source is in
> >/media/data_nvme/git/kernel/BPI-R2-4.14
> >>
> >> kernel is build successfully, but i fail on running the make
> >modules_install target
> >>
> >>   ERROR: Kernel configuration is invalid.
> >>          include/generated/autoconf.h or include/config/auto.conf are
> >missing.
> >>          Run 'make oldconfig && make prepare' on kernel src to fix
> >it.
> >>
> >> Makefile:648: include/config/auto.conf: No such file or directory
> >> make: *** [Makefile:719: include/config/auto.conf] Error 1
> >>
> >> it looks it is ignoring the KBUILD_OUTPUT variable, as both files are
> >present
> >
> >
> >KBUILD_OUTPUT is an environment variable.
> >
> >Did you set (export) it
> >before doing 'make modules_install'?
>
> Yes i exported it before use at beginning of my script [1] and modules_install used inside install function [2]. It works with build-function [3].
> As the script is big i linked the relevant parts...i checked KBUILD_OUTPUT at beginning of install function so i'm sure it was set
>
> >> $ ls /media/data_nvme/git/kernel/build/include/config/auto.conf
> >> /media/data_nvme/git/kernel/build/include/config/auto.conf
> >> $ ls /media/data_nvme/git/kernel/build/include/generated/autoconf.h
> >> /media/data_nvme/git/kernel/build/include/generated/autoconf.h
>
>
> [1] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L75
> [2] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L368
> [3] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L578
> regards Frank


[3] is unrelated since
"#&& make modules_install 2>&3" is commented out.


In [1], you export KBUILD_OUTPUT as a normal user,
then in [2], you run the commands with 'sudo'.

That is why KBUILD_OUTPUT was not passed.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Aw: Re: [question] KBUILD_OUTPUT and modules install (with INSTALL_MOD_PATH)
  2020-09-15  7:54     ` Masahiro Yamada
@ 2020-09-15  8:07       ` Frank Wunderlich
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Wunderlich @ 2020-09-15  8:07 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Michal Marek, Linux Kernel Mailing List

> Gesendet: Dienstag, 15. September 2020 um 09:54 Uhr
> Von: "Masahiro Yamada" <masahiroy@kernel.org>

> On Tue, Sep 15, 2020 at 2:42 PM Frank Wunderlich
> <frank-w@public-files.de> wrote:
> > Yes i exported it before use at beginning of my script [1] and modules_install used inside install function [2]. It works with build-function [3].

> > [1] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L75
> > [2] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L368
> > [3] https://github.com/frank-w/BPI-R2-4.14/blob/5.9-rc/build.sh#L578
>
> [3] is unrelated since
> "#&& make modules_install 2>&3" is commented out.

i just wanted to point to build-process where KBUILD_OUTPUT is used :)

> In [1], you export KBUILD_OUTPUT as a normal user,
> then in [2], you run the commands with 'sudo'.
>
> That is why KBUILD_OUTPUT was not passed.

thank you very much...i remember why (because the sudo) i passed the vars here i already exported ;)

i tried the KERNEL_DIR here (found somewhere but not checked in Makefile), but not the KBUILD_OUTPUT, don't ask me why...with passing KBUILD_OUTPUT there all works as expected.

sudo make ARCH=$ARCH INSTALL_MOD_PATH=$INSTALL_MOD_PATH KBUILD_OUTPUT=$KBUILD_OUTPUT modules_install

Thanks for pointing to this ;)

regards Frank

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-15  8:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14 17:57 [question] KBUILD_OUTPUT and modules install (with INSTALL_MOD_PATH) Frank Wunderlich
2020-09-15  2:56 ` Masahiro Yamada
2020-09-15  5:42   ` Frank Wunderlich
2020-09-15  7:54     ` Masahiro Yamada
2020-09-15  8:07       ` Aw: " Frank Wunderlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).