Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions libkmod/libkmod-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,16 @@ KMOD_EXPORT int kmod_module_remove_module(struct kmod_module *mod, unsigned int

extern long init_module(const void *mem, unsigned long len, const char *args);

/*
* (Re-)define some linux/module.h macros.
*
* In practice, most people/distros do not have the relevant package/header during the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this comment is true anymore... we could probably just require the header

* build. The values are UAPI and cannot change, so we might as well have them locally.
*/
#define MODULE_INIT_IGNORE_MODVERSIONS 1
#define MODULE_INIT_IGNORE_VERMAGIC 2
#define MODULE_INIT_COMPRESSED_FILE 4

static int do_finit_module(struct kmod_module *mod, unsigned int flags, const char *args)
{
enum kmod_file_compression_type compression, kernel_compression;
Expand Down
12 changes: 0 additions & 12 deletions shared/missing.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
#include <unistd.h>
#include <sys/syscall.h>

/*
* Macros pulled from linux/module.h, to avoid pulling the header.
*
* In practice, very few people have it installed and distros do not install the
* relevant package during their build.
*
* Values are UAPI, so they cannot change.
*/
#define MODULE_INIT_IGNORE_MODVERSIONS 1
#define MODULE_INIT_IGNORE_VERMAGIC 2
#define MODULE_INIT_COMPRESSED_FILE 4

#ifndef __NR_finit_module
#warning __NR_finit_module missing - kmod might not work correctly
#define __NR_finit_module -1
Expand Down