[PATCH] meta: Run depmod after kernel module installation

75 views
Skip to first unread message

Jan Kiszka

unread,
Jul 9, 2018, 2:31:14 AM7/9/18
to isar-users
Otherwise the module may not be found if the module package is installed
on its own, i.e. without the kernel package performing the depmod run.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
meta/recipes-kernel/linux-module/files/debian/postinst | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 meta/recipes-kernel/linux-module/files/debian/postinst

diff --git a/meta/recipes-kernel/linux-module/files/debian/postinst b/meta/recipes-kernel/linux-module/files/debian/postinst
new file mode 100644
index 0000000..baabf5d
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+depmod -a
--
2.16.4

Henning Schild

unread,
Jul 9, 2018, 3:48:22 AM7/9/18
to [ext] Jan Kiszka, isar-users
Am Mon, 9 Jul 2018 08:31:12 +0200
schrieb "[ext] Jan Kiszka" <jan.k...@siemens.com>:
That being 644 and the chmod in comnbination with AUTOLOAD do not seem
to match. Either debian will take care of +x and the chmod is not
required at all, or it needs to be 755 and the chmod needs to go away.

Henning

Jan Kiszka

unread,
Jul 9, 2018, 4:05:27 AM7/9/18
to Henning Schild, isar-users
Right, it's probably needed. At least all non-dpkg-raw hooks I found
have +x, and dpkg-raw does an install -m 755.

Jan

Jan Kiszka

unread,
Jul 9, 2018, 4:06:45 AM7/9/18
to isar-users
Otherwise the module may not be found if the module package is installed
on its own, i.e. without the kernel package performing the depmod run.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---

Change in v2:
- mark postinst executable

meta/recipes-kernel/linux-module/files/debian/postinst | 4 ++++
1 file changed, 4 insertions(+)
create mode 100755 meta/recipes-kernel/linux-module/files/debian/postinst

diff --git a/meta/recipes-kernel/linux-module/files/debian/postinst b/meta/recipes-kernel/linux-module/files/debian/postinst
new file mode 100755
index 0000000..baabf5d
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+depmod -a
--
2.16.4

Henning Schild

unread,
Jul 9, 2018, 4:31:38 AM7/9/18
to [ext] Jan Kiszka, isar-users
Am Mon, 9 Jul 2018 10:06:43 +0200
schrieb "[ext] Jan Kiszka" <jan.k...@siemens.com>:

And now remove the chmod in the AUTOLOAD, not needed anymore.

Henning

Jan Kiszka

unread,
Jul 9, 2018, 5:50:08 AM7/9/18
to isar-users
Otherwise the module may not be found if the module package is installed
on its own, i.e. without the kernel package performing the depmod run.

As we now install a postinst baseline with the right mode, the chmod on
AUTOLOAD becomes obsolete.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---

Changes in v3:
- remove now obsolete chmod on AUTOLOAD

meta/recipes-kernel/linux-module/files/debian/postinst | 4 ++++
meta/recipes-kernel/linux-module/module.inc | 1 -
2 files changed, 4 insertions(+), 1 deletion(-)
create mode 100755 meta/recipes-kernel/linux-module/files/debian/postinst

diff --git a/meta/recipes-kernel/linux-module/files/debian/postinst b/meta/recipes-kernel/linux-module/files/debian/postinst
new file mode 100755
index 0000000..baabf5d
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+depmod -a
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 3075f44..76a49f3 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -26,6 +26,5 @@ dpkg_runbuild_prepend() {

if [ ${AUTOLOAD} = "1" ]; then
echo "echo ${PN} >> /etc/modules" >> ${S}/debian/postinst
- chmod +x ${S}/debian/postinst
fi
}
--
2.16.4

Jan Kiszka

unread,
Aug 19, 2018, 3:23:43 AM8/19/18
to isar-users, Maksim Osipov
Ping. Seems this fell through the cracks.

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

Jan Kiszka

unread,
Aug 19, 2018, 6:18:00 AM8/19/18
to isar-users, Maksim Osipov
OK, this does not yet work, at least when run during image generation:
depmod will pick of the host kernel version, not that of the target, and
will fail if the differ (quite likely). That "set -e" needs to go, just
like in [1]. Will send v4.

Jan

[1]
https://github.com/siemens/jailhouse-images/commit/2a66ef8e7f86496ae919ed84cd95370a2ddb7b91#diff-61a459fb1abcb39646b0e3661640ecbf

Jan Kiszka

unread,
Aug 19, 2018, 2:57:41 PM8/19/18
to isar-users
From: Jan Kiszka <jan.k...@siemens.com>

Otherwise the module may not be found if the module package is installed
on its own, i.e. without the kernel package performing the depmod run.

As we now install a postinst baseline with the right mode, the chmod on
AUTOLOAD becomes obsolete.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---

Changes to v3:
- allow depmod to fail (e.g. when building the image)

meta/recipes-kernel/linux-module/files/debian/postinst | 2 ++
meta/recipes-kernel/linux-module/module.inc | 1 -
2 files changed, 2 insertions(+), 1 deletion(-)
create mode 100755 meta/recipes-kernel/linux-module/files/debian/postinst

diff --git a/meta/recipes-kernel/linux-module/files/debian/postinst b/meta/recipes-kernel/linux-module/files/debian/postinst
new file mode 100755
index 0000000..35d5de0
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/postinst
@@ -0,0 +1,2 @@
+#!/bin/sh
+depmod -a
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 3075f44..76a49f3 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -26,6 +26,5 @@ dpkg_runbuild_prepend() {

if [ ${AUTOLOAD} = "1" ]; then
echo "echo ${PN} >> /etc/modules" >> ${S}/debian/postinst
- chmod +x ${S}/debian/postinst
fi
}
--
2.16.4

Maxim Yu. Osipov

unread,
Aug 27, 2018, 6:08:52 PM8/27/18
to Jan Kiszka, isar-users
On 08/19/2018 09:57 PM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.k...@siemens.com>
>
> Otherwise the module may not be found if the module package is installed
> on its own, i.e. without the kernel package performing the depmod run.
>
> As we now install a postinst baseline with the right mode, the chmod on
> AUTOLOAD becomes obsolete.

Applied to the 'next',

Regards,
Maxim.
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mos...@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
Reply all
Reply to author
Forward
0 new messages