[Bug 1781143] [NEW] Additional LKM not added after upgrading to Ubuntu 18.04 (maybe be a bug in "libkmod")
Lancillotto
1781143 at bugs.launchpad.net
Wed Jul 11 07:46:17 UTC 2018
Public bug reported:
Hi, I have reported on Dracut GitHub the following issue
https://github.com/dracutdevs/dracut/issues/426 .
After upgrading to Ubuntu 18.04 (Linuxmint 19) dracut does not add
additional drivers.
After a lot of investigation I found a problem into the libkmod.
---------------------------------------------
Here is a sample code to replicate the issue:
---------------------------------------------
#include <libkmod.h>
#include <stdio.h>
#define _cleanup_(x) __attribute__((cleanup(x)))
static inline void kmod_module_unref_listp(struct kmod_list **p) {
if (*p)
kmod_module_unref_list(*p);
}
#define _cleanup_kmod_module_unref_list_
_cleanup_(kmod_module_unref_listp)
static inline void kmod_module_info_free_listp(struct kmod_list **p) {
if (*p)
kmod_module_info_free_list(*p);
}
#define _cleanup_kmod_module_info_free_list_
_cleanup_(kmod_module_info_free_listp)
static inline void kmod_unrefp(struct kmod_ctx **p) {
kmod_unref(*p);
}
#define _cleanup_kmod_unref_ _cleanup_(kmod_unrefp)
int main(int argc, char** argv) {
_cleanup_kmod_unref_ struct kmod_ctx *ctx = NULL;
_cleanup_kmod_module_unref_list_ struct kmod_list *list = NULL;
int err;
//char alias[2048] = "cryptd";
char alias[2048] = "ahci cryptd";
char kerneldir[256] = "/lib/modules/4.15.0-24-generic/";
printf("libkmod tester...\n");
ctx = kmod_new(kerneldir, NULL);
err = kmod_module_new_from_lookup(ctx, alias, &list);
if (err < 0) {
printf("Error (%d) looking for aliases \"%s\"\n.", err, alias);
return 1;
}
printf("Got list pointer 0x%lx .\n.", (unsigned long)(void *)list);
return 0;
}
----------------------------------------
And here the script to build and run it:
----------------------------------------
#!/bin/bash
CUR_DIR=$(dirname $0)
EXE_NAME=kmod-tester
gcc -Wall *.c -lkmod -o ${EXE_NAME} && \
${CUR_DIR}/${EXE_NAME}
Regards,
Antonio Petricca
---------------
lsb_release -rd
---------------
Description: Linux Mint 19 Tara
Release: 19
-------------------------
apt-cache policy libkmod2
-------------------------
libkmod2:
Installed: 24-1ubuntu3
Candidate: 24-1ubuntu3
Version table:
*** 24-1ubuntu3 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
** Affects: man-db (Ubuntu)
Importance: Undecided
Status: New
** Attachment added: "kmod-tester.c"
https://bugs.launchpad.net/bugs/1781143/+attachment/5162259/+files/kmod-tester.c
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to man-db in Ubuntu.
https://bugs.launchpad.net/bugs/1781143
Title:
Additional LKM not added after upgrading to Ubuntu 18.04 (maybe be a
bug in "libkmod")
Status in man-db package in Ubuntu:
New
Bug description:
Hi, I have reported on Dracut GitHub the following issue
https://github.com/dracutdevs/dracut/issues/426 .
After upgrading to Ubuntu 18.04 (Linuxmint 19) dracut does not add
additional drivers.
After a lot of investigation I found a problem into the libkmod.
---------------------------------------------
Here is a sample code to replicate the issue:
---------------------------------------------
#include <libkmod.h>
#include <stdio.h>
#define _cleanup_(x) __attribute__((cleanup(x)))
static inline void kmod_module_unref_listp(struct kmod_list **p) {
if (*p)
kmod_module_unref_list(*p);
}
#define _cleanup_kmod_module_unref_list_
_cleanup_(kmod_module_unref_listp)
static inline void kmod_module_info_free_listp(struct kmod_list **p) {
if (*p)
kmod_module_info_free_list(*p);
}
#define _cleanup_kmod_module_info_free_list_
_cleanup_(kmod_module_info_free_listp)
static inline void kmod_unrefp(struct kmod_ctx **p) {
kmod_unref(*p);
}
#define _cleanup_kmod_unref_ _cleanup_(kmod_unrefp)
int main(int argc, char** argv) {
_cleanup_kmod_unref_ struct kmod_ctx *ctx = NULL;
_cleanup_kmod_module_unref_list_ struct kmod_list *list = NULL;
int err;
//char alias[2048] = "cryptd";
char alias[2048] = "ahci cryptd";
char kerneldir[256] = "/lib/modules/4.15.0-24-generic/";
printf("libkmod tester...\n");
ctx = kmod_new(kerneldir, NULL);
err = kmod_module_new_from_lookup(ctx, alias, &list);
if (err < 0) {
printf("Error (%d) looking for aliases \"%s\"\n.", err, alias);
return 1;
}
printf("Got list pointer 0x%lx .\n.", (unsigned long)(void
*)list);
return 0;
}
----------------------------------------
And here the script to build and run it:
----------------------------------------
#!/bin/bash
CUR_DIR=$(dirname $0)
EXE_NAME=kmod-tester
gcc -Wall *.c -lkmod -o ${EXE_NAME} && \
${CUR_DIR}/${EXE_NAME}
Regards,
Antonio Petricca
---------------
lsb_release -rd
---------------
Description: Linux Mint 19 Tara
Release: 19
-------------------------
apt-cache policy libkmod2
-------------------------
libkmod2:
Installed: 24-1ubuntu3
Candidate: 24-1ubuntu3
Version table:
*** 24-1ubuntu3 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/man-db/+bug/1781143/+subscriptions
More information about the foundations-bugs
mailing list