Skip to content

Commit f24469f

Browse files
author
Octavian Purdila
committed
Merge pull request torvalds#95 from libos-nuse/doc-env-variable
lkl: add documentation for configurable environmental variables
2 parents 29fe568 + 4f51c9f commit f24469f

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

Documentation/lkl.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,64 @@ following command:
9494

9595
$ make CROSS_COMPILE=i686-w64-mingw32- tools/lkl
9696

97+
LKL hijack library
98+
------------------
99+
100+
LKL hijack library (liblkl-hijack.so) is used to replace system calls used by an
101+
application on the fly so that the application can use LKL instead of the kernel
102+
of host operating system. LD_PRELOAD is used to dynamically override system calls
103+
with this library when you execute a program.
104+
105+
You can usually use this library via a wrapper script.
106+
107+
$ cd tools/lkl
108+
$ ./bin/lkl-hijack.sh ip address show
109+
110+
There are environmental variables to configure the behavior of LKL. The followings
111+
are the list of those variable for your environment.
112+
113+
* LKL_HIJACK_NET_TAP
114+
115+
an interface name for tap device in host operating system to connect to LKL.
116+
```
117+
$ LKL_HIJACK_NET_TAP=tap0 lkl-hijack.sh ip address show
118+
```
119+
* LKL_HIJACK_NET_IP
120+
121+
the IP address of the interface specified by LKL_HIJACK_NET_TAP.
122+
```
123+
$ LKL_HIJACK_NET_IP=198.51.100.5 lkl-hijack.sh ip address show
124+
```
125+
* LKL_HIJACK_NET_NETMASK_LEN
126+
127+
the network mask length of the interface specified by LKL_HIJACK_NET_TAP.
128+
```
129+
$ LKL_HIJACK_NET_IP=198.51.100.5 LKL_HIJACK_NET_NETMASK_LEN=24 lkl-hijack.sh ip address show
130+
```
131+
* LKL_HIJACK_NET_MAC
132+
133+
the MAC address of the interface specified by LKL_HIJACK_NET_TAP.
134+
```
135+
$ LKL_HIJACK_NET_MAC="aa:bb:cc:dd:ee:ff" lkl-hijack.sh ip address show
136+
```
137+
* LKL_HIJACK_NET_GATEWAY
138+
139+
the gateway IP address of LKL network stack.
140+
```
141+
$ LKL_HIJACK_NET_GATEWAY=198.51.100.5 lkl-hijack.sh ip address show
142+
```
143+
* LKL_HIJACK_NET_MTU
144+
145+
the MTU size of the interface specified by LKL_HIJACK_NET_TAP.
146+
```
147+
$ LKL_HIJACK_NET_MTU=1280 lkl-hijack.sh ip address show
148+
```
149+
* LKL_HIJACK_DEBUG
150+
151+
increate the verbose level of debug information.
152+
```
153+
$ LKL_HIJACK_DEBUG=1 lkl-hijack.sh ip address show
154+
```
97155

98156
FAQ
99157
---

0 commit comments

Comments
 (0)