-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.macos
101 lines (66 loc) · 2.79 KB
/
README.macos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Linux kmod ported to macOS/MacOS X/Darwin
-----------------------------------------
FAQ
~~~
WHAT? WHY?
The kmod software provides userspace tools for loading and unloading
Linux kernel modules. This is obviously not useful on macOS, but what
is potentially useful is libkmod and utilities like modinfo. The
purpose of this port is to provide a usable libkmod for other software
on macOS.
BUT AGAIN, WHY?
This started with my effort to port rpminspect
(https://github.com/rpminspect/rpminspect) to macOS. There is no real
reason to do this other than it is technically possible. rpminspect
reads built RPM files and then reads the files in those packages to
perform some build checks. Nothing about this actually requires
running it on Linux, so my real motivation is to prove that this is
possible. It also serves as a way for me to make sure that rpminspect
is portable across systems.
There might be a developer out there working on a Mac but targeting
Linux systems and having the ability to run rpminspect locally might
be useful. Or just gathering info on built kernel modules that happen
to exist locally on the Mac they are using. Who knows?
CAN I LOAD LINUX KERNEL MODULES ON MACOS WITH THIS?
No. Nothing about this port changes the fact that Darwin and Linux
are fundamentally different operating systems.
BUT WAIT, ISN'T MACOS MACH-O AND LINUX IS ELF?
Yes, but both of those things are just files and computer programs
read files. That's what libkmod is doing for me and ultimately what
rpminspect is doing for me.
BUILDING
~~~~~~~~
Building the software assumes you have installed the Xcode stuff and
then Homebrew. If you haven't done that yet, go and do that.
Required Homebrew packages:
autoconf
automake
gtk-doc
docbook
docbook-xsl
pkg-config
xz
Get the source:
git clone https://github.com/dcantrell/kmod.git
Build it:
# Currently I have not bothered with OpenSSL support (patches welcome)
cd kmod
autoreconf -f -i
env PKG_CONFIG_PATH=/usr/local/opt/xz/lib/pkgconfig ./configure --prefix=/usr/local --with-xz --with-zlib --without-openssl
env XML_CATALOG_FILES="/usr/local/opt/docbook-xsl/docbook-xsl/catalog.xml /usr/local/opt/docbook-xsl/docbook-xsl-ns/catalog.xml" make
Install it:
sudo make install
If someone out there wants to put this in to Homebrew so you can do
"brew install kmod-linux" or something, that would be awesome.
USING
~~~~~
For me, libkmod and the headers are most useful. Those are installed
to /usr/local. Use them like you would on Linux, but keep in mind
that loading and unloading modules is a no-op on MacOS.
Module loading and unloading functions will return -ENOTSUP on macOS
because they are not supported.
BUGS
~~~~
File issues on GitHub or send pull requests.
--
David Cantrell <[email protected]>