Results 1 to 7 of 7

Thread: kernel build dierectory not found

  1. #1

    Default kernel build dierectory not found

    Hello all,
    This is my first question although i have been using Opensuse for a while now. I am trying to understand how to build a kernel module and i am following video tutorial for the same.
    in the video this guy uses Ubuntu ..and to build the module he says [ make -C /lib/modules/$(uname -r)/build M=$PWD modules ] but when i try the same it says build directory not found . i have been breaking my head since .
    this is what it says
    make: *** /lib/modules/4.12.14-lp151.28.48-default/build: No such file or directory. Stop.

    i would like to know where to find the a kernel build files ..if a different path or so.
    or if i am to download it from somewhere and how to configure the same as to build the module.

    thanks.

  2. #2
    Join Date
    Mar 2011
    Location
    Sauerland
    Posts
    4,480

    Default AW: kernel build dierectory not found

    Please post the complete!!!! input line, the compete output and the complete next line.
    Example (shows the Graphics Hardware and used and avaible driver):
    Code:
    ich@linux64:~> /sbin/lspci -nnk | grep -EiA3 'vga|3d|display'
    01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)
            Subsystem: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03]
            Kernel driver in use: nvidia
            Kernel modules: nouveau, nvidia_drm, nvidia
    ich@linux64:~>
    Complete input line:
    Code:
    ich@linux64:~> /sbin/lspci -nnk | grep -EiA3 'vga|3d|display'
    Output:
    Code:
    01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)
            Subsystem: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03]
            Kernel driver in use: nvidia
            Kernel modules: nouveau, nvidia_drm, nvidia
    Next line:
    Code:
    ich@linux64:~>
    And please use Code-Tags.
    Last edited by Sauerland; 07-Jul-2020 at 07:34.

  3. #3
    Join Date
    Sep 2012
    Posts
    5,712

    Default Re: kernel build dierectory not found

    Quote Originally Posted by gruthevmeister View Post
    Code:
    make: *** /lib/modules/4.12.14-lp151.28.48-default/build: No such file or directory.  Stop.
    To build external modules on openSUSE you need to install kernel-default-devel package.

    Please use tags [code] when ptoviding computer output.

  4. #4

    Default Re: kernel build dierectory not found

    SORRY! my bad ..

    ill uses the code tags hence forth.

    so i wrote a simple char device driver (incomplete) and i tried to compile the code using

    input :
    Code:
    h@linux-fn75:~/Documents/device-driver-tut/trial-1> make -C /lib/modules/$(uname -r)/build M=$PWD modules
    and this was the response

    output:
    Code:
    make: *** /usr/src/4.12.14-lp151.28.48-default/build: No such file or directory. 
     Stop.
    when i checked the directories i couldn't find the build folder , but here is what i found in that path .

    Code:
    h@linux-fn75:/lib/modules/4.12.14-lp151.28.48-default> ls
    kernel             modules.builtin.bin  modules.fips     modules.symbols.bin
    modules.alias      modules.dep          modules.order    vdso
    modules.alias.bin  modules.dep.bin      modules.softdep
    modules.builtin    modules.devname      modules.symbols

    i did install kernel-default-devel packages

    input code:
    Code:
    h@linux-fn75:~/Documents/device-driver-tut/trial-1> sudo zypper in kernel-default-devel
    output:
    Code:
    [sudo] password for root: Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    
    
    The following 4 NEW packages are going to be installed:
      kernel-default-devel kernel-devel kernel-macros libelf-devel
    
    
    4 new packages to install.
    Overall download size: 33.4 MiB. Already cached: 0 B. After the operation,
    additional 63.8 MiB will be used.
    Continue? [y/n/...? shows all options] (y): y
    Retrieving package kernel-macros-4.12.14-lp151.28.52.1.noarch
                                               (1/4),   6.0 MiB ( 21.0 KiB unpacked)
    Retrieving: kernel-macros-4.12.14-lp151.28.52.1.noarch.rpm .[done (755.2 KiB/s)]
    Retrieving package libelf-devel-0.168-lp151.4.3.1.x86_64
                                               (2/4), 727.0 KiB (  2.1 MiB unpacked)
    Retrieving: libelf-devel-0.168-lp151.4.3.1.x86_64.rpm ......[done (241.5 KiB/s)]
    Retrieving package kernel-devel-4.12.14-lp151.28.52.1.noarch
                                               (3/4),  17.8 MiB ( 57.4 MiB unpacked)
    Retrieving: kernel-devel-4.12.14-lp151.28.52.1.noarch.rpm ..[done (841.0 KiB/s)]
    Retrieving package kernel-default-devel-4.12.14-lp151.28.52.1.x86_64
                                               (4/4),   8.9 MiB (  4.3 MiB unpacked)
    Retrieving: kernel-default-devel-4.12.14-lp151.28.52.1.x86_[done (1016.3 KiB/s)]
    Checking for file conflicts: .............................................[done]
    Warning: Checking for file conflicts requires not installed packages to be downloaded in advance in order to access their file lists. See option '--download-in-advance' in the zypper manual page for details.
    
    
    The following package had to be excluded from file conflicts check because it is not yet downloaded:
      kernel-default
    
    
    (1/4) Installing: kernel-macros-4.12.14-lp151.28.52.1.noarch .............[done]
    (2/4) Installing: libelf-devel-0.168-lp151.4.3.1.x86_64 ..................[done]
    (3/4) Installing: kernel-devel-4.12.14-lp151.28.52.1.noarch ..............[done]
    (4/4) Installing: kernel-default-devel-4.12.14-lp151.28.52.1.x86_64 ......[done]

    i am following this tutorial where he says in the following path << /lib/modules/$(uname -r)/build >> has a makefile which apparently has all the information about the processor and which compiler to use etc. . but ofcourse he uses Ubuntu . any comment on that also helps



    i found another similar thread

    https://forums.opensuse.org/showthre...-4-4-57-18-3-1

    but again it says to install kernel-default-devel which i did.


    P.S - Thank you for the quick response .

  5. #5
    Join Date
    Sep 2012
    Posts
    5,712

    Default Re: kernel build dierectory not found

    Quote Originally Posted by gruthevmeister View Post
    Code:
    h@linux-fn75:/lib/modules/4.12.14-lp151.28.48-default> ls
    Code:
    (1/4) Installing: kernel-macros-4.12.14-lp151.28.52.1.noarch .............[done]
    (2/4) Installing: libelf-devel-0.168-lp151.4.3.1.x86_64 ..................[done]
    (3/4) Installing: kernel-devel-4.12.14-lp151.28.52.1.noarch ..............[done]
    (4/4) Installing: kernel-default-devel-4.12.14-lp151.28.52.1.x86_64 ......[done]
    kernel-default-devel must be the same version as kernel-devel. By default the latest version is installed. Either build your module for current kernel or install kernel-default-devel version 4.12.14-lp151.28.48. By default the latest version is installed.

  6. #6
    Join Date
    Mar 2011
    Location
    Sauerland
    Posts
    4,480

    Default AW: kernel build dierectory not found

    Update your System and reboot.

  7. #7

    Default Re: kernel build dierectory not found

    Quote Originally Posted by arvidjaar View Post
    kernel-default-devel must be the same version as kernel-devel. By default the latest version is installed. Either build your module for current kernel or install kernel-default-devel version 4.12.14-lp151.28.48. By default the latest version is installed.


    Thank you so much ..
    it worked ..

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •