How to build a custom block-based Linux kernel driver
This document (7005873) is provided subject to the disclaimer at the end of this document.
The PlateSpin blkwatch module must be built for the specific kernel running on the Linux system. PlateSpin products come with pre-compiled versions of the blkwatch module for all non-debug kernels (both 32 and 64 bit ) of the following Linux distributions:
- RedHat Enterprise Linux 4 (including updates 1-8)
- RedHat Enterprise Linux 5 (including updates 1-5)
- SUSE Linux Enterprise Server 10 (including service packs 1-3)
- SUSE Linux Enterprise Server 11 (including service pack 1)
Machines that run a Linux kernel not shipped by the vendor for distributions listed above are not supported by the supplied versions of the blkwatch module. However, it is possible to recompile the blkwatch module for systems that are running any of the supported distributions with a non-standard kernel (user-built or debug). To use the blkwatch module with such kernels, it must be recompiled for the specific (source workload) kernel and incorporated back into the PlateSpin product.
On the PlateSpin server, navigate to the Platespin application's installation directory, as applicable to the environment:
C:\Program Files\PlateSpin Migrate Server
C:\Program Files\PlateSpin Protect Server
D:\Program Files\PlateSpin Forge Server
1. Open the '.\Packages\9D470BFF-E30F-4015-83D8-4D308A8C8B1B' folder and copy the file named '1.package' out of the folder.
2. Rename 1.package file with .zip extension (1.zip). Create a temporary folder at any location (e.g. 'C:\Temp\blkwatch') and extract the contents of 1.zip file to this temporary folder.
3. Use ssh or a usb key to copy the 'src' subfolder to the Linux machine that is capable of building modules for the specific kernel. To build modules for a specific kernel, it is required that both a kernel development package (kernel-devel for RHEL or kernel-source for SLES) for the corresponding target kernel and a gcc compiler be installed on the linux machine.
4. Navigate to the 'src' directory on the Linux machine and run the following command:
This will produce a blkwatch.ko file in the 'src' directory.
5. Run the following command to get the release string of the kernel:
6. Go back to the PlateSpin server and create a subfolder in the temporary folder where the package file was unpacked (as in step 2). For the subfolder name, use the following naming convention:
Replace <release string> with the actual string you obtained in step 6 and <architecture> with 'x86' for 32-bit platforms or with 'x86_64' for 64-bit platforms.
Note: the release string may contain an architecture, like this:
In that case the folder name will look like this:
7. Copy the blkwatch.ko produced in step 4 to the subfolder created in step 6.
8. Compress the contents of temporary folder (see note below in bold) using the .ZIP target format. Make sure that the compressed file contains all the folders that were unpacked in step 2, in addition to the new one created in step 6. Rename the new archive to '1.package' (replace .zip extension with .package).
Note: Make sure to archive the contents within the temporary folder, NOT the temporary folder itself. If the folder is archived it will create an additional layer in the package, causing no block-based components to be found.
9. Copy the '1.package' file produced above to the original folder ('C:\Program Files\PlateSpin Migrate Server\Packages\9D470BFF-E30F-4015-83D8-4D308A8C8B1B') as in step 1. The custom kernel module is now installed and ready for use.
make: Entering directory `/usr/src/kernels/2.6.18-308.el5-x86_64'
make: Entering directory `/usr/src/redhat/SOURCES/linux-184.108.40.206'
If kernel-devel (RedHat) or kernel-source (SLES) is not installed, install it. Both this package and gcc are required to properly build blkwatch.ko files. If this package is not installed, or not installed for the correct kernel version, the build will fail or the blkwatch.ko file will not be correct.
This Support Knowledgebase provides a valuable tool for NetIQ/Novell/SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7005873
- Creation Date:29-APR-10
- Modified Date:06-APR-13
- NetIQPlateSpin ForgePlateSpin MigratePlateSpin Protect
Did this document solve your problem? Provide Feedback