Kernel sources/module building


 
Thread Tools Search this Thread
Operating Systems Linux Kernel sources/module building
# 1  
Old 08-26-2008
Kernel sources/module building

Hi All,

I've seen people build modules against a certain kernel source (eg in /usr/src/kernels/my_source/) and some people build against the sources in /lib/modules/my_source/build/

What is the difference and are there any benefits to using the /lib/modules source?

Regards,
Brendan
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Unload kernel module at boot time (Debian Wheezy 7.2, 3.2.0-4-686-pae kernel)

Hi everyone, I am trying to prevent the ehci_hcd kernel module to load at boot time. Here's what I've tried so far: 1) Add the following line to /etc/modprobe.d/blacklist.conf (as suggested here): 2) Blacklisted the module by adding the following string to 3) Tried to blacklist the module... (0 Replies)
Discussion started by: gacanepa
0 Replies

2. Solaris

Building OpenSolaris from sources

Everyone knows the project LFS (Linux from scratch), it is a book-assembly instructions GNU / Linux from source code. I managed to gather, then my knowledge of GNU / Linux grew, learned many new commands, edit config-files, base packages, kernel, etc. .. Now I would like also to explore... (0 Replies)
Discussion started by: Geekon
0 Replies

3. Linux

kernel module parameters

Hi, if I install a module with specific parameter, will this parameters applied next time system boots? for exampe, I want to disable InterruptThrottleRate modprobe e1000e InterruptThrottleRate=0 Is this parameter apllied only for this run, or this module will always use this parameter when... (2 Replies)
Discussion started by: Shedon
2 Replies

4. UNIX for Advanced & Expert Users

building a kernel (with a twist)

Hey all, I am working on a static analysis tool and I wan't to see if it can find bugs in the linux kernel, it uses LLVM framework to analyse the instructions. Long story short I need to build the kernel with a custom compiler. The compiler will create byte code files where binaries usually... (2 Replies)
Discussion started by: zigga15
2 Replies

5. IP Networking

kernel module

Hi All, I need to develop a kernel module which changes the IP address of a package according to its mac address. It would be a sort of L2 Nat. Somebody know if I can do this using netfilter?? Thanks. (2 Replies)
Discussion started by: lagigliaivan
2 Replies

6. Linux

How to convert Linux Kernel built-in module into a loadable module

Hi all, I am working on USB data monitoring on Fedora Core 9. Kernel 2.6.25 has a built-in module (the one that isn't loadable, but compiles and links statically with the kernel during compilation) to snoop USB data. It is in <kernel_source_code>/drivers/usb/mon/. I need to know if I can... (0 Replies)
Discussion started by: anitemp
0 Replies

7. SuSE

FAILED during patching kernel sources

Hi all. I have an issue with kernel patching. My system: OpenSuse 10.2, kernel version: 2.6.18.2. I've downloaded the patch from kernel.org - 2.6.26. I've invoked the following command: "patch -p1 -f < patch-2.6.26" (-f - because some files are not exist. to automatically skip this issues).... (2 Replies)
Discussion started by: Vourhey
2 Replies

8. UNIX for Advanced & Expert Users

building and running a software in different linux kernel versions

my Querry is if i build a software on a specific linux kernel and then try to run it on another linux kernel ....what can be the possible problems or what errors can most probably appear while running the binary in an updated version of linux. (1 Reply)
Discussion started by: mobydick
1 Replies

9. SuSE

max number of slabs per kernel module (kernel 2.6.17, suse)

Hi All, Is there a max number of slabs that can be used per kernel module? I'm having a tough time finding out that kind of information, but the array 'node_zonelists' (mmzone.h) has a size of 5. I just want to avoid buffer overruns and other bad stuff. Cheers, Brendan (4 Replies)
Discussion started by: Brendan Kennedy
4 Replies

10. Linux

Kernel sources

I"m installing my ATI card in FC4. I'm going off of instructions that i've found. The firs step says that i need my kernel sources which i've got then it says that i've gotta unpack them so i can make links to the file later. My kernel sources that i've got are .src.rpm I've installed them but... (1 Reply)
Discussion started by: byblyk
1 Replies
Login or Register to Ask a Question
MODULE(7)					       BSD Miscellaneous Information Manual						 MODULE(7)

NAME
module -- Kernel Modules interface SYNOPSIS
options MODULAR DESCRIPTION
Kernel modules allow the system administrator to dynamically add and remove functionality from a running system. This ability also helps software developers to develop new parts of the kernel without constantly rebooting to test their changes. Additionally, the kernel may automatically load software modules as needed to perform requested operations. For example, an ``xyzfs'' module can be loaded automatically when an attempt is made to mount an ``xyzfs'' file system. Modules can also depend on other modules, and depen- dent modules are automatically loaded. When a module is no longer needed, it can be automatically unloaded. An in-kernel linker resolves symbol references between the module and the rest of the kernel. The module interface is accessed with the modctl(2) system call. All common operations involving kernel modules are handled by the modload(8), modunload(8), and modstat(8) programs. Users should never have to interact with modctl(2) directly. MODULE CLASSES
Virtual File System modules Virtual file systems may be added via the module interface. Device Driver modules Many device drivers can be loaded as a kernel module. One potential problem specific to block and character device drivers is that the device nodes must exist for the devices to be accessed. These need to be created manually, after the driver module has been successfully loaded. The majority of the device driver modules however does not need any manual intervention to function properly. Execution Interpreters Execution Interpreters can be loaded to provide support for executing binaries not normally supported by kernel. This also allows loading support for executing foreign system binaries. Execution Interpreters may require that an appropriate emulation module also be loaded. Miscellaneous modules Miscellaneous modules are modules for which there are not currently well-defined or well-used interfaces for extension. They are provided for extension, and the user-provided module initialization routine is expected to install the necessary "hooks" into the rest of the operat- ing system. An example of a "miscellaneous module" might be a loader for card-specific VGA drivers or alternate terminal emulations in an appropriately layered console driver. Security-Model modules Alternate system security models may loaded using the module facility. EXAMPLES
The common build tool of NetBSD, ``build.sh'', automatically compiles and installs all modules during a full system build and install. Some- times it is however useful to update only modules. The following example demonstrates one way to do this. It is assumed that the source code is under /usr/src, while the object and toolchain directories are under /usr/obj and /usr/tools, respectively. cd /usr/src/sys/modules export OBJDIR=/usr/obj export TOOLDIR=/usr/tools make clean make make install SEE ALSO
modctl(2), modload(8), modstat(8), modunload(8), module(9) HISTORY
The module facility was designed to be similar in functionality to the loadable kernel modules facility provided by SunOS 4.1.3. The old LKM interface was replaced by module in NetBSD 5.0. AUTHORS
The module subsystem was implemented by Andrew Doran <ad@netbsd.org>. CAVEATS
The module framework is still under active development. At least two potential caveats can be mentioned. 1. Kernel modules are built to operate only with a specific version of the NetBSD kernel. When the kernel is updated to a new version, the contents of the /stand/${ARCH}/${VERSION}/modules/ directory should be updated as well. (This location has been the subject of much discussion, and may change in future versions of NetBSD.) 2. If an attempt is made to boot the operating system from a file system for which the module is not built into the kernel, the boot may fail with the message ``Cannot mount root, error 79''. On certain architectures (currently, i386 and amd64), one may be able to recover from this error by using the ``load xxxfs'' command before trying to boot. This command is only available on newer bootload- ers. The absence of required modules or the inability of the bootloader to load the modules are common reasons for failures to boot a MODULAR ker- nel. It may be a good practice to maintain a non-MODULAR kernel in the root file system for recovery purposes. SECURITY CONSIDERATIONS
A module becomes part of the kernel once loaded. Compared to userland programs, all errors in the code can be fatal. There is no memory protection between modules and the rest of the kernel. Hence, a potential attacker with access to the modctl(2) system call can acquire com- plete and total control over the system. To avoid associated security risks, new modules can only be loaded when securelevel is less than or equal to zero, or if the kernel was built with options INSECURE. Refer to secmodel_securelevel(9) for additional details on the securelevel. Only use modules from trusted sources. BSD
December 14, 2010 BSD