A couple of issues/questions when compiling a kernel from source

I am trying to follow this ArchWiki article to compile the newly released linux 6.0 kernel.

However I get stuck when checking if the kernel tree is clean following the instructions:

To finalise the preparation, ensure that the kernel tree is absolutely clean; do not rely on the source tree being clean after unpacking. To do so, first change into the new kernel source directory created, and then run the make mrproper command:

$ cd linux-A.B.C
$ make mrproper

Note: The mrproper Make target depends on the clean target, and thus, it is not necessary to execute both. See [1] for reference.

Running the make mrproper command, I get the following:

Makefile:191: *** source directory cannot contain spaces or colons. Stop.

These are the lines 190-192 in Makefile:

ifneq ($(words $(subst :, ,$(abs_srctree))), 1)
$(error source directory cannot contain spaces or colons)
endif

Tried anyway to compile and again:

$ make -j8 
Makefile:191: *** source directory cannot contain spaces or colons.  Stop.

This is where I am stuck. I would appreciate any help/suggestions/pointers to resolve this issue.

1 Like

Update:

Not sure if I am doing it right but with a bit of searching the www, it seemed as if I needed to move the source directory elsewhere.

I had it at

/home/pebcak/Temp/Build/Kernel/linux-6.0

first. And now at

/home/pebcak/linux-6.0

and running make mproper in linux-6.0 gives no output.

So I guess everything is clean now.
:thought_balloon:
:thinking:

:grey_question:

Update2:

Well, I have sort of succeeded in building the kernel and boot into it.
Everything seems to be working but the WiFi.

I did get a lot of “questions” when running the make command at the last step to which I had no clue what to answer. The default seemed to be N and that is what I chose.

I’ll appreciate any help, comments, suggestions etc to learn a bit more about this process.

Linux-6.0

1 Like

Just guessing, but could it be that somewhere during the make process the path for some files used became too long and got truncated?

Might be.
I couldn’t see anything that had a colon or a space in it.
Just moving the source directory and having it immediately under home seemed to resolve it.

1 Like

Update3:

YAY! Seems I got it right the second time around.

I used the .config file from a running linux-zen kernel when compiling the first time.
The second time I used the default configuration from the official Arch Linux kernel package.

Then I used make olddefconfig to accept all the defaults.

Not sure if this explain the successful build but the kernel is bootable and so far everything seems to be working as expected.

System:
  Kernel: 6.0.0arch-linux-6.0 arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: initrd=\arch-gnome\amd-ucode.img
    initrd=\arch-gnome\initramfs-linux-6.0.img rw
    root=UUID=0d19c35e-8b2b-4844-a2e6-359ae17575e1 rootflags=subvol=@
    amd_pstate.shared_mem=1 lsm=lockdown,yama,apparmor,bpf loglevel=3
    nowatchdog zswap.enabled=0
  Desktop: GNOME v: 42.5 tk: GTK v: 3.24.34 info: plank wm: gnome-shell
    dm: GDM v: 42.0 Distro: Arch Linux
Machine:
  Type: Mini-pc System: ASUSTeK product: MINIPC PN51 v: 0409
    serial: <superuser required>
  Mobo: ASUSTeK model: PN51 serial: <superuser required> UEFI: ASUSTeK
    v: 0409 date: 07/28/2021
CPU:
  Info: model: AMD Ryzen 7 5700U with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 2 gen: 3 level: v3 built: 2020-22 process: TSMC n7 (7nm)
    family: 0x17 (23) model-id: 0x68 (104) stepping: 1 microcode: 0x8608102
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 8 MiB desc: 2x4 MiB
  Speed (MHz): avg: 751 high: 1449 min/max: 400/4372 boost: enabled
    scaling: driver: amd-pstate governor: ondemand cores: 1: 1098 2: 1096
    3: 400 4: 1098 5: 440 6: 400 7: 400 8: 400 9: 1449 10: 479 11: 400
    12: 400 13: 1370 14: 1097 15: 1090 16: 400 bogomips: 57506
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT enabled with STIBP
    protection
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, STIBP:
    always-on, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected

As this is a learning experience for me, I’ll appreciate any and all comments, suggestions and feedback on what I have posted above. Please feel free to point out if I have done it the wrong way or if it could be done in a better way. Also I would appreciate if you could share resources you know of so that I could read up on the subject of kernel configuration, patching, removal of unneeded modules and so on and so forth.