Jump to content

ag123

Members
  • Posts

    337
  • Joined

  • Last visited

Community Answers

  1. ag123's post in DKMS: Exec format error was marked as the answer   
    DKMS is 'quite complicated' , in an attempt to understand all that 'cryptic' stuff, I went googling around
    https://wiki.archlinux.org/title/Dynamic_Kernel_Module_Support
    https://www.linuxjournal.com/article/6896
    https://github.com/dell/dkms
    https://wiki.gentoo.org/wiki/DKMS
    https://www.collabora.com/news-and-blog/blog/2021/05/05/quick-hack-patching-kernel-module-using-dkms/
    https://www.baeldung.com/linux/dynamic-kernel-module-support
    https://nilrt-docs.ni.com/opkg/dkms_opkg.html
    ^ surprisingly I found this guide/tutorial from national instruments 'quite intuitive'
    and I dug further into how to make a kernel module, well at least a 'hello world'
    https://tldp.org/LDP/lkmpg/2.6/html/
    https://tldp.org/LDP/lkmpg/2.6/lkmpg.pdf
    The Linux Kernel Module Programming Guide
    Peter Jay Salzman
    Michael Burian
    Ori Pomerantz
    Copyright © 2001 Peter Jay Salzman
    ---
    ok I actually tried building that 'hello world'  kernel module and *it works*, for practically 'ancient' 2001 instructions.
    so it turns out that to compile a kernel module, you do not need to build it in the kernel source tree itself
    and that is *without* DKMS, read that last 2 tldp guides: The Linux Kernel Module Programming Guide
    you can try building and inserting the 'hello world' module into your kernel, no DKMS, whatever, after you build your module !
    in short is it not necessary to build a kernel module within the kernel source tree itself, but that there are some procedures as spelled out
    in that 2 tldp docs.
    (but fast forward to today, this same instruction may not work if you are using secure boot, then a lot more complicated things like module signing gets involved, review that dkms link from dell)
    -------
    now back to DKMS , where does that fit in?
    so it turns out that DKMS is a utility / tool / system / automation tool, to help you *rebuild the kernel module* - out of linux kernel source tree (i.e. as like the hello world module above), *without building the kernel from source itself* !
    but that you need to ***rebuild the kernel module from source***(e.g. using DKMS), then all the other links above are guides that may be relevant
    ----
    now add more complications / complexities, normally what you wanted is a *driver* , not simply a kernel module
    the driver often has several parts - the kernel module itself (this is the 'easy' part, you need to build it - from source), and that does not mean having to build the kernel itself from source, but you need to build the *kernel *** module *** *.
    after you build the kernel module successfully, say, then there are more blows and pitfall
    these days wifi and many network hardware requires *firmware files* , these *firmware files* can consist of 'bin' (firmware binary) and configuration (some of them text files) some of these firmware stuff lives in /lib/firmware.
    then that you need your kernel module, you can deem that the 'driver core' that  interface the OS and interface those firmware. those firmware do not necessary run on the (host) cpu (i.e. your pc) but instead in the wifi chip  itself.
    this is the part that is *highly opaque*, there are so many wifi chips that are *undocumented*, the firmware is *undocumented* and if you do not have any source for your kernel module which interface the firmware to the os, you are out-of-luck.
    -----
     
    to summarise - normally, one cannot hope to take a binary kernel module install it in your current kernel and hope it 'just works'.
    if that works, a lot of things such as module versions and various constraints imposed by the kernel matches that in the kernel module itself, i.e. that module is compiled specifically for that specific kernel itself !
    DKMS do not solve this, DKMS only *helps you rebuild the (kernel) module *** from source *** *, (and install it optionally).
    the idea is this, you have the *source* to your out of kernel source *kernel modules*, when you upgrade the kernel, e.g. such as an apt-upgrade etc, DKMS can be triggered to *rebuild the kernel module from source* (and install it) in the new kernel (binary) tree e.g. copy that into /lib/modules/{kernel version}/xxx
    ---
    if the kernel module is part of the kernel source tree itself, it actually do not need DKMS.  But that if the errors occurs  after building that *kernel module* (i.e. driver) , then congrats - you found a 'bug' in the *kernel module (driver)*, and that is true even if it is out of kernel source as a DKMS build. i.e. the driver sources need to be patched to work in the new kernel.
  2. ag123's post in no release file was marked as the answer   
    i'd be kind of 'off topic' here, armbian is somewhat in the 'fast lane', 'bleeding edge'
    https://www.debian.org/releases/
    recently when we worked on Orange Pi Zero 3 
    we actually jumped right into bookworm, had there been something more 'bleeding edge' that may be it
    and that we jumped into 6.6 kernel (as it is about the 1st kernel that has support for Orange Pi Zero 3 on allwinner H618 cpu, and that actually as development progress, it actually advanced to 6.7, 6.8 etc.
    Today, I just installed Ubuntu jammy from Ubuntu, only to find that that is 6.5 !
    and that even orange pi's 'official' image for Orange Pi Zero 3 gets 'left behind' at 6.1
     
    I'd suggest to try upgrading to the 'latest'  debian (bookworm?) image, it may take quite a bit of  'reinstall' though. And that everything is 'brand new', 'bleeding edge' there.
    the python 3 version is 3.11, that in ubuntu jammy is 3.10 !
    that said, there are bound to be some broken bones left around somewhere, it is 'under construction'  (all the time) 
     
    oh some fun stuff, 6.8 is  9 days old, who knows that might be the new Armbian kernel 
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
     
     
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines