diff mbox

[LEDE-DEV] Using PROVIDES with kmod packages

Message ID aeca0665-93af-be73-9d81-531f52b6950f@gmail.com
State RFC
Headers show

Commit Message

Rafał Miłecki Feb. 17, 2017, 1:53 p.m. UTC
I was doing some fun experiments with ssb/bcma/b43 as a research based on:
[PATCH RFC] kernel: allow selecting kmod-ssb on TARGET_brcm47xx_mips74k

I was trying to build 2 variants of ssb package and 2 variants of b43 package.
It didn't work, most likely because of the way PROVIDES is handled. I stripped
down my changes to a simple ssb module package dif (see below). With this change
applied I'm getting:

Collected errors:
  * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-b43:
  *      kmod-ssb *
  * opkg_install_cmd: Cannot install package kmod-b43.

Is this possible to make PROVIDES work with kernel module packages?

Comments

Jonas Gorski Feb. 17, 2017, 2:14 p.m. UTC | #1
Hi,

On 17 February 2017 at 14:53, Rafał Miłecki <zajec5@gmail.com> wrote:
> I was doing some fun experiments with ssb/bcma/b43 as a research based on:
> [PATCH RFC] kernel: allow selecting kmod-ssb on TARGET_brcm47xx_mips74k
>
> I was trying to build 2 variants of ssb package and 2 variants of b43
> package.
> It didn't work, most likely because of the way PROVIDES is handled. I
> stripped
> down my changes to a simple ssb module package dif (see below). With this
> change
> applied I'm getting:
>
> Collected errors:
>  * satisfy_dependencies_for: Cannot satisfy the following dependencies for
> kmod-b43:
>  *      kmod-ssb *
>  * opkg_install_cmd: Cannot install package kmod-b43.
>
> Is this possible to make PROVIDES work with kernel module packages?

Our kernel can handle ko's built into the kernel and just create empty
packages, so wouldn't changing the DEPENDS to
@PCI_SUPPORT||TARGET_brcm47xx||TARGET_brcm63xx enough?

If that isn't enough you could also create a
KernelPackage/ssb/brcm47xx (see e.g. crypto-misc, which as a x86
variant, or crypto-sha512 which even has a x86_64 one). With some
oppropriate overrides.


Regards
Jonas
Rafał Miłecki Feb. 17, 2017, 2:38 p.m. UTC | #2
On 17 February 2017 at 15:14, Jonas Gorski <jonas.gorski@gmail.com> wrote:
> On 17 February 2017 at 14:53, Rafał Miłecki <zajec5@gmail.com> wrote:
>> I was doing some fun experiments with ssb/bcma/b43 as a research based on:
>> [PATCH RFC] kernel: allow selecting kmod-ssb on TARGET_brcm47xx_mips74k
>>
>> I was trying to build 2 variants of ssb package and 2 variants of b43
>> package.
>> It didn't work, most likely because of the way PROVIDES is handled. I
>> stripped
>> down my changes to a simple ssb module package dif (see below). With this
>> change
>> applied I'm getting:
>>
>> Collected errors:
>>  * satisfy_dependencies_for: Cannot satisfy the following dependencies for
>> kmod-b43:
>>  *      kmod-ssb *
>>  * opkg_install_cmd: Cannot install package kmod-b43.
>>
>> Is this possible to make PROVIDES work with kernel module packages?
>
> Our kernel can handle ko's built into the kernel and just create empty
> packages, so wouldn't changing the DEPENDS to
> @PCI_SUPPORT||TARGET_brcm47xx||TARGET_brcm63xx enough?

I don't want to build ssb into the kernel. I want to add kmod-ssb
package with per device rootfs feature.


> If that isn't enough you could also create a
> KernelPackage/ssb/brcm47xx (see e.g. crypto-misc, which as a x86
> variant, or crypto-sha512 which even has a x86_64 one). With some
> oppropriate overrides.

This also doesn't help me. I need two variants of b43 package, not one
modified. It's because most mips74k devices can work with b43 with
bcma only. There are only about 2 devices than need modified b43
package with ssb support enabled.
In other words I need exactly something like PROVIDES ;)
Jonas Gorski Feb. 17, 2017, 3:06 p.m. UTC | #3
On 17 February 2017 at 15:38, Rafał Miłecki <zajec5@gmail.com> wrote:
> On 17 February 2017 at 15:14, Jonas Gorski <jonas.gorski@gmail.com> wrote:
>> On 17 February 2017 at 14:53, Rafał Miłecki <zajec5@gmail.com> wrote:
>>> I was doing some fun experiments with ssb/bcma/b43 as a research based on:
>>> [PATCH RFC] kernel: allow selecting kmod-ssb on TARGET_brcm47xx_mips74k
>>>
>>> I was trying to build 2 variants of ssb package and 2 variants of b43
>>> package.
>>> It didn't work, most likely because of the way PROVIDES is handled. I
>>> stripped
>>> down my changes to a simple ssb module package dif (see below). With this
>>> change
>>> applied I'm getting:
>>>
>>> Collected errors:
>>>  * satisfy_dependencies_for: Cannot satisfy the following dependencies for
>>> kmod-b43:
>>>  *      kmod-ssb *
>>>  * opkg_install_cmd: Cannot install package kmod-b43.
>>>
>>> Is this possible to make PROVIDES work with kernel module packages?
>>
>> Our kernel can handle ko's built into the kernel and just create empty
>> packages, so wouldn't changing the DEPENDS to
>> @PCI_SUPPORT||TARGET_brcm47xx||TARGET_brcm63xx enough?
>
> I don't want to build ssb into the kernel. I want to add kmod-ssb
> package with per device rootfs feature.

What I mean is you can make it visible also for TARGET_brcm47xx, and
if the subtarget chooses to built it into the kernel then kmod-ssb
will be empty, and if it doesn't, then kmod-ssb will contain ssb.ko,
just like on other targets.

So no need for variants here, no?

>> If that isn't enough you could also create a
>> KernelPackage/ssb/brcm47xx (see e.g. crypto-misc, which as a x86
>> variant, or crypto-sha512 which even has a x86_64 one). With some
>> oppropriate overrides.
>
> This also doesn't help me. I need two variants of b43 package, not one
> modified. It's because most mips74k devices can work with b43 with
> bcma only. There are only about 2 devices than need modified b43
> package with ssb support enabled.
> In other words I need exactly something like PROVIDES ;)

So you want to build b43 twice for the same subtarget, once with bcma
only, and once with ssb support in addtion?


Regards
Jonas
Rafał Miłecki Feb. 17, 2017, 4:56 p.m. UTC | #4
On 17 February 2017 at 16:06, Jonas Gorski <jonas.gorski@gmail.com> wrote:
> On 17 February 2017 at 15:38, Rafał Miłecki <zajec5@gmail.com> wrote:
>> On 17 February 2017 at 15:14, Jonas Gorski <jonas.gorski@gmail.com> wrote:
>>> On 17 February 2017 at 14:53, Rafał Miłecki <zajec5@gmail.com> wrote:
>>>> I was doing some fun experiments with ssb/bcma/b43 as a research based on:
>>>> [PATCH RFC] kernel: allow selecting kmod-ssb on TARGET_brcm47xx_mips74k
>>>>
>>>> I was trying to build 2 variants of ssb package and 2 variants of b43
>>>> package.
>>>> It didn't work, most likely because of the way PROVIDES is handled. I
>>>> stripped
>>>> down my changes to a simple ssb module package dif (see below). With this
>>>> change
>>>> applied I'm getting:
>>>>
>>>> Collected errors:
>>>>  * satisfy_dependencies_for: Cannot satisfy the following dependencies for
>>>> kmod-b43:
>>>>  *      kmod-ssb *
>>>>  * opkg_install_cmd: Cannot install package kmod-b43.
>>>>
>>>> Is this possible to make PROVIDES work with kernel module packages?
>>>
>>> Our kernel can handle ko's built into the kernel and just create empty
>>> packages, so wouldn't changing the DEPENDS to
>>> @PCI_SUPPORT||TARGET_brcm47xx||TARGET_brcm63xx enough?
>>
>> I don't want to build ssb into the kernel. I want to add kmod-ssb
>> package with per device rootfs feature.
>
> What I mean is you can make it visible also for TARGET_brcm47xx, and
> if the subtarget chooses to built it into the kernel then kmod-ssb
> will be empty, and if it doesn't, then kmod-ssb will contain ssb.ko,
> just like on other targets.
>
> So no need for variants here, no?

OK, I think you're correct.


>>> If that isn't enough you could also create a
>>> KernelPackage/ssb/brcm47xx (see e.g. crypto-misc, which as a x86
>>> variant, or crypto-sha512 which even has a x86_64 one). With some
>>> oppropriate overrides.
>>
>> This also doesn't help me. I need two variants of b43 package, not one
>> modified. It's because most mips74k devices can work with b43 with
>> bcma only. There are only about 2 devices than need modified b43
>> package with ssb support enabled.
>> In other words I need exactly something like PROVIDES ;)
>
> So you want to build b43 twice for the same subtarget, once with bcma
> only, and once with ssb support in addtion?

So far I only started playing with this, but yes, that was my initial
idea. I don't know if I'll implement it yet. Just fun project for now
:)
Jonas Gorski Feb. 17, 2017, 5:15 p.m. UTC | #5
On 17 February 2017 at 17:56, Rafał Miłecki <zajec5@gmail.com> wrote:
> On 17 February 2017 at 16:06, Jonas Gorski <jonas.gorski@gmail.com> wrote:
>> On 17 February 2017 at 15:38, Rafał Miłecki <zajec5@gmail.com> wrote:
>>> On 17 February 2017 at 15:14, Jonas Gorski <jonas.gorski@gmail.com> wrote:
>>>> If that isn't enough you could also create a
>>>> KernelPackage/ssb/brcm47xx (see e.g. crypto-misc, which as a x86
>>>> variant, or crypto-sha512 which even has a x86_64 one). With some
>>>> oppropriate overrides.
>>>
>>> This also doesn't help me. I need two variants of b43 package, not one
>>> modified. It's because most mips74k devices can work with b43 with
>>> bcma only. There are only about 2 devices than need modified b43
>>> package with ssb support enabled.
>>> In other words I need exactly something like PROVIDES ;)
>>
>> So you want to build b43 twice for the same subtarget, once with bcma
>> only, and once with ssb support in addtion?
>
> So far I only started playing with this, but yes, that was my initial
> idea. I don't know if I'll implement it yet. Just fun project for now
> :)

Maybe it would make more sense to refactor the ssb and bcma specific
code paths into their own modules, so you wouldn't have a direct
dependency anymore, and instead b43-bcma-glue => { b43, bcma} and
b43-ssb-glue => { b43, ssb }.


Regards
Jonas
diff mbox

Patch

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index 017a94c622..a7ba590593 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -414,10 +414,11 @@  endef
  $(eval $(call KernelPackage,softdog))


-define KernelPackage/ssb
+define KernelPackage/ssb-v1
    SUBMENU:=$(OTHER_MENU)
    TITLE:=Silicon Sonics Backplane glue code
    DEPENDS:=@PCI_SUPPORT @!TARGET_brcm47xx @!TARGET_brcm63xx
+  PROVIDES:=kmod-ssb
    KCONFIG:=\
  	CONFIG_SSB \
  	CONFIG_SSB_B43_PCI_BRIDGE=y \
@@ -437,7 +438,7 @@  define KernelPackage/ssb/description
   Silicon Sonics Backplane glue code.
  endef

-$(eval $(call KernelPackage,ssb))
+$(eval $(call KernelPackage,ssb-v1))


  define KernelPackage/bcma
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index a5e56d9858..2cba074c81 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -501,7 +501,7 @@  config PACKAGE_B43_USE_BCMA
  		  This allows choosing buses that b43 should support.

  	config PACKAGE_B43_BUSES_BCMA_AND_SSB
-		depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
+		depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k
  		bool "BCMA and SSB"

  	config PACKAGE_B43_BUSES_BCMA
@@ -509,7 +509,7 @@  config PACKAGE_B43_USE_BCMA
  		bool "BCMA only"

  	config PACKAGE_B43_BUSES_SSB
-		depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
+		depends on !TARGET_brcm47xx_mips74k
  		bool "SSB only"

  	endchoice