View Source

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

h2. Solution
----
h6.

*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.



h4. 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:
{code} # getmodule -ha {code}
Note the path in /tmp where the header archive is created.


h4. {color:#000000}2. Transfer the header archive to a second system where a backup agent (or the getmodule package) is installed.{color}




h4. 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:

{code}# getmodule -headers (header_archive_path) -dest (output_path)

Example:
# getmodule -headers headers309872428 -dest /home/username {code}
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.



h4. 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

h4. 5.Lastly, restart the backup agent to load the module.
{kb-related-articles}