Welcome to the Linux Foundation Forum!

Lesson 7 - compiling the kernel

Hello All,

while compiling the kernel i get the following error:

CC security/integrity/platform_certs/load_uefi.o
CC security/integrity/platform_certs/keyring_handler.o
AR security/integrity/built-in.a
AR security/built-in.a
make[1]: *** [/linux_work/linux_stable/Makefile:1926: .] Error 2
make: *** [Makefile:224: __sub-make] Error 2
root@krzysztof-VirtualBox:/linux_work/linux_stable#

anyone knows what this is about?

Many thanks,
Krzysztof

Answers

  • Did you check what is Makefile:1926 does? It might offer clues.

  • zielik
    zielik Posts: 5
    edited November 2024

    The 1926 line says:

    $(build-dir): prepare
    $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 $(single-goals)

    and line 224 reads:
    $(build-dir): prepare
    $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 $(single-goals)

    Error 2 doesnt really give any clue, does it?

  • What's the CONFIG_SYSTEM_TRUSTED_KEYS setting in your config? Try clearing it if it is set by changing it to CONFIG_SYSTEM_TRUSTED_KEYS=""

  • it is set to CONFIG_SYSTEM_TRUSTED_KEYS="1", i set it to ="" and rerunning the build. Lets see how it with that setting change.

  • this got the build going but after 12hrs linux_stable folder grew to 20GB and my VM has only 30GB space and it is almost full. How much space would you recommend for a new VM so that i can compile kernel and work with it? 40GB? 50 GB?
    Do you use any IDE? i would install it as well, and need to include it in space planning....

  • leam
    leam Posts: 5

    @zielik said:
    this got the build going but after 12hrs linux_stable folder grew to 20GB and my VM has only 30GB space and it is almost full. How much space would you recommend for a new VM so that i can compile kernel and work with it? 40GB? 50 GB?
    Do you use any IDE? i would install it as well, and need to include it in space planning....

    Unless you're on an overloaded machine, it shouldn't take more than an hour or two. My dual core Dell Optiplex 960 took 92 minutes, and it was an old machine when I bought it several years ago. Something is wrong, and 20 GB is huge!

    My recommendation would be to start fresh in your repo, copy in the old config and then get back to it. Do a large root partition, 40 or 50 GB is plenty.

  • leam
    leam Posts: 5

    @leam said:

    Unless you're on an overloaded machine, it shouldn't take more than an hour or two. My dual core Dell Optiplex 960 took 92 minutes, and it was an old machine when I bought it several years ago. Something is wrong, and 20 GB is huge!

    My recommendation would be to start fresh in your repo, copy in the old config and then get back to it. Do a large root partition, 40 or 50 GB is plenty.

    I did some more digging, and there are some huge files left over as a part of the build process! Mine has a 12 GBvmlinux.o! So, I would suggest 20-30 GB for each main branch of the kernel, if you're doing things like linux_stable, linux_mainline, etc. More is better, if you have it.

    Still not sure why yours took so long, unless it ran out of space.

  • Thanks for the reply.

    I run Ubuntu as VM on Windows which has less cpu resources available.
    IT takes a couple of days to build linux_stable. I created 500 GB space for the VM and was able to resume the build. I have rerun the make build multiple times, which left some intermediate files that were probably consuming space. would you say they are in /var somewhere?
    is there a good way to clean them up between make reruns? OR do i need to delete them manually?

    Also, when it comes to the last stage of the build it shows an error without showing any special message and it is deleting the build artifact. Difficult to say what is wrong as no concrete message is displayed. Have you ever seen this?

Categories

Upcoming Training