From Developer Community
This article is a stub. If you have experience with or knowledge about this topic you can help by adding to it.
first steps
Steps to build a source RPM for Code 10
prepare the build system
- Using YaST->"Software Management", install the kernel-source and kernel-syms packages.
- these packages contain the kernel build environment
- Using YaST->"Software Management", install the build package.
- this package contains the build SUSE tool
the KMP build proper
The Novell Linux University for Developers demonstrates the following steps in a visual introduction to kmp building.
- Create a staging directory on your local system.
- In your staging directory, create a driver source directory named <vendor>-<driver>-<version>. (Example: novell-sampledriver-1.0)
- In your source directory, place all your driver source code (*.c and *.h files) and a "Kbuild" file. The "Kbuild" file serves as the Makefile; information on how to create a Kbuild file is contained in the document /usr/src/linux/Documentation/kbuild/modules.txt. A sample Kbuild file is contained in the /usr/share/doc/packages/kernel-source/novell-kmp/novell-example-1.1.tar.bz2 file.
- In your staging directory, create a compressed tar file containing your driver source directory and all its contents. Name this compressed tar file "<vendor>-<driver>-<version>.tar.gz" (or "<vendor>-<driver>-<version>.tar.bz2"). A sample compressed tar file is /usr/share/doc/packages/kernel-source/novell-kmp/novell-example-1.1.tar.bz2.
- In your staging directory, create a <vendor>-<driver>.spec file as detailed in Kernel Module Packages Manual for CODE 10. A sample spec file is /usr/share/doc/packages/kernel-source/novell-kmp/novell-example.spec.
- From within your staging directory, build your source and binary rpms by using the "build" command. Use "man build" for more information on options to the "build" command. Ensure that the build completes successfully.
- The build process will place your binary rpm in the /var/rpm/build-root/usr/src/packages/RPMS directory. Install this binary on a test system and ensure that it functions as expected.
- The build process will place your source rpm in the /var/rpm/build-root/usr/src/packages/SRPMS directory. This source RPM will be used in a later step.
making your kmp autoload and autoinstall