Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install Kernel Headers #21

Closed
1 task done
AdamTuraj opened this issue Feb 2, 2024 · 28 comments
Closed
1 task done

Unable to install Kernel Headers #21

AdamTuraj opened this issue Feb 2, 2024 · 28 comments
Labels
bug Something isn't working

Comments

@AdamTuraj
Copy link

What happened?

I am trying to install Kernal headers to download a driver to a USB Wifi stick (https://github.com/McMCCRU/rtl8188gu). The issue is there are no headers for the current Bookworm Edge 6.6.9 version. When running the make file for the driver, it points to a folder whose parent exists, but the build folder does not. If there's any way to get these kernel headers built that would be much appreciated.

How to reproduce?

git clone https://github.com/McMCCRU/rtl8188gu.git
cd rtl8188gu
make

Branch

main (main development branch)

On which host OS are you observing this problem?

Other

Relevant log URL

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@AdamTuraj AdamTuraj added the bug Something isn't working label Feb 2, 2024
@redrathnure
Copy link
Owner

redrathnure commented Feb 2, 2024

IMO the easiest way is to build your custom image. There will be few additional files in the output directory including kernel headers package.
Option 2, which might work is to find a right package on the official Armbian dep repo. You would need package for Renegade board and exactly the same kernel version. However I have no idea how realistic is to found this combination and would it work at all.

Bit more details:
this is custom Armbian build with customized kernel. Most likely you need a kernel headers which was used exactly for this build/kernel and most likely for the same distro. So I would just install VirtualBox and build a needed image with all additional deb packages.

@AdamTuraj
Copy link
Author

I'm not the most savvy when it comes to building OS's, etc. Just brought it up to see if this is something you can easily fix. Maybe someone will come around with a fix at one point although that's not me

@Phil1988
Copy link

Phil1988 commented Feb 3, 2024

+1 for this.

I also have no experience in building an OS, nor am I a programmer, so I hope someone with more knowledge can fix this :)

@ChristineBoersen
Copy link

This is the whole reason I have to build my own to begin with (that odd version of the Realtek driver that is "sorta" upstream kernel) and no one seems to set their default outputs to put source and header on them (multiple people's builds, not singling this repository out there).

@redrathnure
Copy link
Owner

@ChristineBoersen which artifact do we need from build? I may rebuild latest release and upload needed packages.

@ChristineBoersen
Copy link

ChristineBoersen commented Feb 4, 2024

It is just a compile flag :) INSTALL_HEADERS=yes BUILD_KSRC=yes INSTALL_KSRC=yes

Your latest (I pulled latest this AM) works just fine to compile with the above, under jammy, current at least.

I personally recommend adding BSFREEZE=yes so people who forget to add manually compiled network drivers don't have them die if they forget to modprobe the changes.

I'd also recommend adding the following two packages to make life easier for people needing to build a network driver to get running.

Append

  usb-modeswitch
  build-essential

to
/config/optional/architectures/arm64/_config/cli/jammy/main/packages

I haven't had a chance to put it through as a patch (and I could see some people wanting it further up in desktop/_all_distributions/main/packages for the desktop compiles)

@redrathnure
Copy link
Owner

OK, I see. Thanks for the hint. I will re-build and re-upload image and package files for the latest release.
However I am not sure it's a good idea to add build-essential to all packages by default. E.g. due to luck of disk space.

@redrathnure
Copy link
Owner

@AdamTuraj , @Phil1988 could you please check https://github.com/redrathnure/armbian-mkspi/releases/tag/mkspi%2F0.3.2-24.2.0-trunk images. Please write back results:

  1. have you managed to build custom driver/module?
  2. Did you use linux-headers-xxx.deb package? Should I publish them for the next releases?

@AdamTuraj
Copy link
Author

@redrathnure I only have one EMMC and would rather not reinstall everything. I was able to get it working although I had to defreeze the kernel. Everything seems stable although not the most ideal. If @Phil1988 has any issues I can pull it out, back everything up and try it out. Although I just got my printer working with clean firmware and need to catch up on some prints.

@redrathnure
Copy link
Owner

You may try a new image on SD card (without erasing already worked system). In any case it would be interested to see your step-by-step instructions to build https://github.com/McMCCRU/rtl8188gu.git module. Guess it would be interested for other peoples.

@AdamTuraj
Copy link
Author

I have a Qidi printer and they only pull the OS from the onboard EMMC. Unfortunately cannot use an SD card

@redrathnure
Copy link
Owner

Hm... now I'm bit confused.... which board in it? Is it the similar to MKSPI?

@AdamTuraj
Copy link
Author

The board is this:
https://qidi3d.com/en-ca/products/x-max-3-x-plus-3-x-smart-3-motherboard?variant=41682606588044

From what I understand Makerbase made it for them or maybe they sell something similar. Not really sure

@ChristineBoersen
Copy link

ChristineBoersen commented Feb 5, 2024

Hm... now I'm bit confused.... which board in it? Is it the similar to MKSPI?

Sorry I wasn't trying to be confusing, just giving a normal justification for including headers/sources is drivers that you must build before you have network (without playing games) to get people to first network connection more successfully.

I've broken this into another issue

@redrathnure
Copy link
Owner

It's OK. I just have not expected that this image is able to work on something except MKSPI board.

@Phil1988
Copy link

Phil1988 commented Feb 5, 2024

Hm... now I'm bit confused.... which board in it? Is it the similar to MKSPI?

Its asort of MKS SKIPR board which is also similar to the MKSPI.
But they didnt include the SD card.

I am currently very busy, so I cant test this for the next ~2-3 weeks.

BTW: Blame me for others to report issues here on the MKS based 3D printer boards :)
At least I was the first who wrote some instructions on how to get your OS image working on these boards :D

@redrathnure
Copy link
Owner

Actually it's perfect that this image is useful for more peoples. Perhaps we should collect list of boards which works (or might work) with this build and related known issues. So would be nice to understand name of board and needed steps to make it work. For example I assume you have slightly modified DTS files and probably some extra configuration steps.

Feel free to publish this info here (I will add it to the readme and release notice) or open PR with related changes.

@Phil1988
Copy link

Phil1988 commented Feb 5, 2024

There was little to no modifications needed :)

You can have a closer read to my tutorial here:
https://github.com/Phil1988/FreeQIDI
So it really worked "out of the box".

I expect these boards to work directly with no changes:
MKS PI
MKS SKIPR
QIDI X-4 and X-6 Mainboards (made by MKS for X-Plus 3 and X-Max 3)

Big thanks to you @redrathnure for doing this great work and for publishing it 👍

redrathnure added a commit that referenced this issue Feb 5, 2024
redrathnure added a commit that referenced this issue Feb 5, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
@redrathnure
Copy link
Owner

See https://github.com/redrathnure/armbian-mkspi/releases/tag/mkspi%2F0.3.2-24.2.0-trunk, including pre-installed usb-modeswitch and build-essential packages.

redrathnure added a commit that referenced this issue Feb 18, 2024
redrathnure added a commit that referenced this issue Feb 18, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
@ohyeah8000
Copy link

Hello Maxim,

first of all thank you very much for this really nice repo and your work!
It is a very useful piece of software for an increasing number of people I know.

I'm not a programmer but user of one of these Qidi X-Max 3 machines with an MKS PI X-4 board.
Last year I startet to search for alternative ways and your work was mentioned many times.

However currently I still struggle to implement RTL8188GU support and tried many things.
Good you have build essentials and mode switch included but it's still not possible for me to activate wireless connectivity.

iwconfig shows no wireless extensions and this means the driver is a missing part for the kernel. I tried current and also edge kernels now.

What is the right way to enable wifi then?
DKMS and some preparation? Or is something else missing?

Thanks a lot for good advice!

PS: What is the reason you don't have the edge kernel in current releases present anymore?

@redrathnure
Copy link
Owner

redrathnure commented Feb 18, 2024

Hi @ohyeah8000, thanks for the feedback.

I do not have access to your board and this WIFI dongle, so may only guessing:

  1. Looks like kernel 6.4 and later already support RTL8188GU devices. Using rtl8xxxu module. If you use Edge images (which has kernel v6.6. or v6.7) you may try follwoing:
    1.1. Check that your device is connected, e.g. by lsusb
    1.2. Ensure that it is not in CD/storage mode. Otherwise use usb_modeswitch to switch to model mode
    1.3. Try to load rtl8xxxu module. sudo lsmod | grep rtl, sudo modprobe rtl8xxxu and so on
    1.4. If no result, check dmesg. E.g. by sudo dmesg | grep rtl8xxxu or dmesg | grep 8188
    1.5. Perhaps it worth to check error on make fail McMCCRU/rtl8188gu#66 (comment) discussion

  2. If you use kernel <= 6.4 (e.g. 6.1 from current image), then seems you need to build custom module. E.g. https://github.com/McMCCRU/rtl8188gu.git or https://github.com/lwfinger/rtl8188gu. Or one of backports: https://github.com/lwfinger/rtl8xxxu/tree/main, https://github.com/wandercn/RTL8188GU. Workflow very similar to previous section:
    2.1. Check that device is visible and is not in CD/storage mode
    2.2. Build module and install it. E.g. mame && sudo make install, probably reboot
    2.3. Check module status and/or try to load it. sudo lsmod | grep 8188 and sudo modprobe -r 8188gu
    2.4. If does not work, check dmesg and/or ask people who already done this task :)

PS: please ignore 0.3.2 release, It's better to look at the latest https://github.com/redrathnure/armbian-mkspi/releases/tag/mkspi%2F0.3.3-24.2.0-trunk one, which has the both current and edge images. Please note edge image has weird issue with TS35 touchscreen.

@ohyeah8000
Copy link

Thanks man! Oh, shoot, installed 2 different 0.3.2 versions today including Klipper and everything. I have a lot of practice now and I guess a new approach will be even faster... ;)

Of course I tried almost everything you mentioned above but didn't succeed in the end. I really think the Kernel version is important. I'll let you know how it turns out and give fedback after the next attempt.

@redrathnure
Copy link
Owner

OK, just FYI, new release is out including current with 6.6 kernel. please check https://github.com/redrathnure/armbian-mkspi/releases page.

@lucymorn
Copy link

lucymorn commented Mar 4, 2024

A bit off topic, but any idea how to get headers for 5.16.20-rockchip64? I am trying to get aic8800 working, but when trying to build the driver -
make[1]: *** /lib/modules/5.16.20-rockchip64/build: No such file or directory. Stop.

@redrathnure
Copy link
Owner

Perhaps it's a question to official MKS repo.

@Guilouz
Copy link

Guilouz commented Mar 17, 2024

@Phil1988
Copy link

Phil1988 commented Mar 19, 2024

@Guilouz Yes. It gave quite some confusion about the creator so I published it at my git:

https://github.com/Phil1988/FreeQIDI
Have fun, give it a star and stuff :D

@frap129
Copy link

frap129 commented Apr 2, 2024

2 things to report. First, images built from this repo work on the new X-7 mainboard that comes in the QIDI Q1 Pro. Second thing to report is that WiFi works on it after building the aic8800 driver from here. The initial image has to built with INSTALL_HEADERS=yes BUILD_KSRC=yes INSTALL_KSRC=yes, and eject must be installed. I have added the steps to build and install the driver at build time in userpatches/customize-image.sh in my fork, which you can find here.

EDIT: In response to the initial report for this issue, rtl8188gu is no longer required. As of Linux 6.4 there is a proper driver built into the kernel.

redrathnure added a commit that referenced this issue Nov 3, 2024
redrathnure added a commit that referenced this issue Nov 3, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Nov 3, 2024
redrathnure added a commit that referenced this issue Nov 3, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Nov 30, 2024
redrathnure added a commit that referenced this issue Nov 30, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Dec 1, 2024
redrathnure added a commit that referenced this issue Dec 1, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Dec 1, 2024
redrathnure added a commit that referenced this issue Dec 1, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Dec 8, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Dec 8, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Dec 11, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Dec 11, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
redrathnure added a commit that referenced this issue Dec 12, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to #23 and #21
igorpecovnik pushed a commit to armbian/build that referenced this issue Dec 13, 2024
...to speedup the fist Klipper installation and save some time for peoples with slow internet connection
Related to redrathnure#23 and redrathnure#21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants