Where have you got this command from? It is so wrong that I do not even know where to start
make -C /lib/modules/$(uname -r)/build M=$home/user/Development/Module
sudo make -C /lib/modules/$(uname -r)/build M=$home/user/Development/Module modules_install
Replace $(uname -r) with kernel version you need if compiling for non-currently running kernel.
.....
sudo make
Never ever compile anything, especially kernel, as root. In particular, it prevents you from screwing up installed kernel devel files. At this point I’d suggest to remove installed RPM, manually clean remaining directories if any, reinstall RPMs again and do it once more. Your command may accidentally have change something.
I’ve reinstalled open SUSE and all packages that I had before, to be able to compile the module. Actually the scenario changed a bit but still making problems when I try to compile it, below I’ve attached the code;
user@linux-9hyc:/run/media/user/UUI/Module> make -C /lib/modules/$(uname -r)/build M=$/run/media/user/UUI/Module
make: Entering directory '/usr/src/linux-4.1.15-8-obj/x86_64/default'
arch/x86/Makefile:129: CONFIG_X86_X32 enabled but no binutils support
/usr/src/linux-4.1.15-8/Makefile:678: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
mkdir: cannot create directory ‘run’: Permission denied
make[3]: *** No rule to make target '/usr/src/linux-4.1.15-8/run/media/user/UUI/Module/Makefile'. Stop.
/usr/src/linux-4.1.15-8/Makefile:1410: recipe for target '_module_run/media/user/UUI/Module' failed
make[2]: *** [_module_run/media/user/UUI/Module] Error 2
Makefile:146: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
Makefile:24: recipe for target '__sub-make' failed
make: *** [__sub-make] Error 2
make: Leaving directory '/usr/src/linux-4.1.15-8-obj/x86_64/default'
user@linux-9hyc:/run/media/user/UUI/Module> make -C /lib/modules/$(uname -r)/build M=$/run/media/user/UUI/Module module_install
make: Entering directory '/usr/src/linux-4.1.15-8-obj/x86_64/default'
arch/x86/Makefile:129: CONFIG_X86_X32 enabled but no binutils support
/usr/src/linux-4.1.15-8/Makefile:678: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
make[2]: *** No rule to make target 'module_install'. Stop.
Makefile:146: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
Makefile:24: recipe for target '__sub-make' failed
make: *** [__sub-make] Error 2
make: Leaving directory '/usr/src/linux-4.1.15-8-obj/x86_64/default'
user@linux-9hyc:/run/media/user/UUI/Module>
Note: Concerning to binultis I have downloaded all possible packages
I have solved the problem with binultis support and -fstack-protector as well, so the code of below is not appearing when I try to compile. However, the rest still in the same point…
If there is no secrecy involved, I’d recommend you post the stdout you’re sanitizing in its original form and the makefile on a pastebin so we can see exactly what is happening.
At this point, I’m speculating that your latest error about unable to create “run” is because your original makefile script has a hard-coded Ubuntu path. If it’s pointing to a variable path, the script likely would have found an existing “run” path common to all distros.
Am also curious whether this module is very widely used, if so it might already be compiled by someone else ready to load immediately (and depending on what it does might be loadable on the fly).
I think I found the main reason why is not adding the module. If I try to install the new kernel module it’s returning invalid format of my module when I want to insert the module (module+.ko) as shown below in the source code attached.
user@linux-9hyc:/run/media/user/UUI/module/modulePlus> make install
if /sbin/lsmod | grep -q 'module\+'; then sudo /sbin/rmmod module+; fi
sudo cp 99-module+.rules /lib/udev/rules.d;
sudo udevadm control --reload-rules
sudo /sbin/insmod module+.ko
insmod: ERROR: could not insert module module+.ko: Invalid module format
Makefile:114: recipe for target 'install' failed
make: *** [install] Error 1
user@linux-9hyc:/run/media/user/UUI/module/modulePlus>
Yup, looks like something fundamentally wrong in the makefile itself. At this point, I’d say you should ask yourself how difficult this might be to resolve and maybe look for anything anyone else may have posted doing exactly what you’re now trying to do.