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 :
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:
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 .
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:
h@linux-fn75:~/Documents/device-driver-tut/trial-1> sudo zypper in kernel-default-devel
output:
[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/showthread.php/524518-Kernel-Headers-for-Opensuse-42-2-Linux-kernel-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 .