Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Running depmod in the package installation
@ 2020-03-16  1:43 Carlos Santos
  2020-03-17 21:23 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Carlos Santos @ 2020-03-16  1:43 UTC (permalink / raw)
  To: buildroot

Hello buildrooters,

Currently if a package installs a kernel module it must be loaded by
means of its full path, e.g

    insmod /lib/modules/$(/bin/uname -r)/extra/pvrsrvkm.ko

This is required because modprobe does not work, since we must run

    $(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) <kernel-version>

So I did this in package/ti-sgx-km/ti-sgx-km.mk, to test:

define TI_SGX_KM_INSTALL_TARGET_CMDS
        $(TARGET_MAKE_ENV) $(MAKE) $(TI_SGX_KM_MAKE_OPTS) \
                DISCIMAGE=$(TARGET_DIR) \
                kbuild_install -C $(@D)/$(TI_SGX_KM_SUBDIR)
        kver=$$($(MAKE) -C $(LINUX_DIR) --no-print-directory -s
kernelversion); \
        $(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) $$kver
 endef

With this change a "modprobe pvrsrvkm" works but I wonder if it should
be better to run depmod in a target-finalize hook in linux/linux.mk,
e.g,

define LINUX_DEPMOD
        $(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) \
                $$($(MAKE) -C $(LINUX_DIR) --no-print-directory -s
kernelversion)
endef

What do you think?

-- 
Carlos Santos <unixmania@gmail.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Buildroot] Running depmod in the package installation
  2020-03-16  1:43 [Buildroot] Running depmod in the package installation Carlos Santos
@ 2020-03-17 21:23 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2020-03-17 21:23 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2020-03-15 22:43 -0300, Carlos Santos spake thusly:
> Hello buildrooters,
> 
> Currently if a package installs a kernel module it must be loaded by
> means of its full path, e.g
> 
>     insmod /lib/modules/$(/bin/uname -r)/extra/pvrsrvkm.ko
> 
> This is required because modprobe does not work, since we must run
> 
>     $(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) <kernel-version>

Damn, I was pretty sure we already did it, but it appears not.

> So I did this in package/ti-sgx-km/ti-sgx-km.mk, to test:
> 
> define TI_SGX_KM_INSTALL_TARGET_CMDS
>         $(TARGET_MAKE_ENV) $(MAKE) $(TI_SGX_KM_MAKE_OPTS) \
>                 DISCIMAGE=$(TARGET_DIR) \
>                 kbuild_install -C $(@D)/$(TI_SGX_KM_SUBDIR)
>         kver=$$($(MAKE) -C $(LINUX_DIR) --no-print-directory -s
> kernelversion); \
>         $(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) $$kver
>  endef
> 
> With this change a "modprobe pvrsrvkm" works but I wonder if it should
> be better to run depmod in a target-finalize hook in linux/linux.mk,
> e.g,

Exactly what I was going to suggest.

> define LINUX_DEPMOD
>         $(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) \
>                 $$($(MAKE) -C $(LINUX_DIR) --no-print-directory -s kernelversion)

I guess you'd want to use $(LINUX_VERSION_PROBED) instead of
hand-calling kernelversion, linux/linux.mk at 159:

    # Get the real Linux version, which tells us where kernel modules are
    # going to be installed in the target filesystem.
    LINUX_VERSION_PROBED = ....

Regards,
Yann E. MORIN.

> endef
> 
> What do you think?
> 
> -- 
> Carlos Santos <unixmania@gmail.com>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-17 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-16  1:43 [Buildroot] Running depmod in the package installation Carlos Santos
2020-03-17 21:23 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox