Skip to end of metadata
Go to start of metadata

Question


Is it possible to build a kernel module for a protected machine without a direct internet connection?

Solution


Note : A 6.x or newer backup agent is required on both systems in order for this process to work.
Kernel headers must also be installed on both systems.

Normally, a connection to the internet is required to build the kernel module required by the Linux backup agent. If there is no direct internet connection between the protected machine and the R1Soft build server, it is still possible to compile the kernel module by copying the headers to a second machine where the backup agent is installed.

Steps for an offline module build:
- Create a kernel header archive from the offline machine.
- Transfer the header archive to a second system where a backup agent (or the getmodule package) is installed.
- Build the module on the second system.
- Copy the completed module back to the original system.
- Restart the backup agent.

1. Create a kernel header archive from the offline machine

To generate the header package from the offline system, issue the getmodule command with the following flag:

# getmodule -ha

Note the path in /tmp where the header archive is created.

2. Transfer the header archive to a second system where a backup agent (or the getmodule package) is installed.

3. Build the module on the second system.

To build the module from the copied header archive, issue the getmodule command with the following flags:

# getmodule -headers (header_archive_path) -dest (output_path) Example: # getmodule -headers headers309872428 -dest /home/username

Note: If a module is already installed on the secondary machine, the build may fail to start with the following message :
Found installed kernel under /lib/modules/r1soft : hcpdriver-cki-X.X.X-XXX.ko
Module for uname: X.X.X-XXX.ko is already installed.
If this happens, the module listed can simply be moved to a different directory until the build is completed, and then moved back to the original location, following the offline build.

4.Copy the completed module back to the original system.The completed module should be copied back to the original system, and placed here:

/lib/modules/r1soft

5.Lastly, restart the backup agent to load the module.

Related Articles


Page: Building a Linux kernel module without an internet connection (Knowledge Base) Labels: module, offline
Page: insmod ERROR - could not insert module - Operation not permitted (Knowledge Base) Labels: module, mrf, hash, insmod, page, allocation, failure
Page: Building a Linux kernel module without an internet connection (Knowledge Base) Labels: module, offline
Labels:
module module Delete
offline offline Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.