Wednesday, May 15, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1340  / 2 Years ago, mon, july 4, 2022, 1:19:22

Main Question:


Need a solution to apply a hardware support patch to my current working kernel in Ubuntu 22.04, so that it will fix the exact issue (here keyboard not working) without affecting other settings.


Background


Tried dual booting Ubuntu on my laptop(Asus vivobook s14-K3402ZA), the installation succeeded but keyboard was not working from boot, later found that only external keyboard is supporting and internal keyboard not working with Ubuntu 22.04 LTS - kernel 5.15.0-50-generic


The issue was identified at “Try before install” and do proceed because I found a patch online that solved the issue for similar models - from the information got from comments It will be added in a future 6.1 kernel release.


But in order to get it working on current mainline kernel, Tried the steps mentioned in this answer.


Downloaded latest longterm 5.15 release 5.15.74, Successfully complied the .deb package and installed - the keyboard issue fixed but there are several other issues regarding display brightness, scaling, refresh rate etc.


More From » kernel

 Answers
5

I think the issue is because the Ubuntu / Debian release kernel comes with some extra patches or may be due to the configuration difference in installed kernel version and the one from kernel.org.


Note that 5.15.74 is a mainline Linux version and mentioned 5.15.0-50 is an Ubuntu version, both are not same.


As all other functionalities are working in source kernel, it is better to build a custom patched kernel from source kernel to correct the issue.


Steps to follow,



  1. Enable source code repositories, this will add needed deb-src lines in /etc/apt/sources.list.


    enable-source-repo



  2. Install the tools require to compile the packages from source code,also ensure around 20+ GB disc space before building.


    # To install build tools
    sudo apt update
    sudo apt build-dep linux linux-image-$(uname -r)

    sudo apt install libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf llvm build-essential libncurses5-dev gcc bc dwarves


  3. Obtaining the source for Ubuntu release: The source code which generated a specific binary package may be obtained using the apt source <package> command, to get other versions check this - official documentation, [ ref-2 ]


    # switch to root
    sudo su

    # get the current kernel source downloaded and extracted (ignore the end user warning)
    apt source linux-image-unsigned-$(uname -r)

    cd /path/to/linux-<version>/

    # Give all user execution permissions to scripts (Important, otherwise error will be thrown even if you are running them as root)
    chmod a+x debian/scripts/*
    chmod a+x -R ./scripts


  4. Download and apply the patch,


    patch -p1 < ~/Downloads/<patch-name>.patch


  5. Copy the existing configurations,


    cp /boot/config-$(uname -r) ./.config

    # update config for new kernel
    make oldconfig


  6. Compile the kernel, [ref]


    make -j16 deb-pkg LOCALVERSION=-custom

    You want to replace -j16 with however many threads your processor has (use getconf _NPROCESSORS_ONLN to get the number). the “LOCALVERSION” option can be anything you want. It’s only there for documentation purposes. Now your kernel should be compiling. This could take a while, depending on your hardware (1-2 hours)



  7. Install the new patched kernel, update grub and reboot to new kernel


    # change to parent dir
    cd ..

    dpkg -i *.deb

    update-grub
    reboot

    Use the mainline tool to remove old kernel,




[#193] Tuesday, July 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cisccla

Total Points: 66
Total Questions: 134
Total Answers: 115

Location: Croatia
Member since Fri, Sep 11, 2020
4 Years ago
cisccla questions
Tue, Nov 16, 21, 08:40, 3 Years ago
Thu, Sep 1, 22, 19:53, 2 Years ago
Fri, Apr 21, 23, 20:17, 1 Year ago
Thu, Dec 2, 21, 15:29, 3 Years ago
;