Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build a statically linked version of kmod #3981

Merged
merged 1 commit into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions packages/kmod/kmod.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,48 @@ cp COPYING COPYING.LGPL
cp tools/COPYING COPYING.GPL

%build

%define _configure ../configure

mkdir static-build
pushd static-build

%cross_configure \
--with-zlib \
--with-zstd \
--without-openssl

%make_build LDFLAGS="-all-static"

popd

mkdir dynamic-build
pushd dynamic-build

%cross_configure \
--with-zlib \
--with-zstd \
--without-openssl

%make_build

popd

%install
pushd dynamic-build
%make_install
popd

pushd static-build
install -p tools/kmod %{buildroot}%{_cross_bindir}

for b in depmod insmod lsmod modinfo modprobe rmmod ; do
ln -s kmod %{buildroot}%{_cross_bindir}/${b}
done

install -d %{buildroot}%{_cross_sbindir}
ln -s ../bin/kmod %{buildroot}%{_cross_sbindir}/modprobe
popd

%files
%license COPYING.LGPL COPYING.GPL
Expand Down