All of lore.kernel.org
 help / color / mirror / Atom feed
* LINUX_VERSION issue in recipe
@ 2018-04-27 10:44 Damien LEFEVRE
  2018-04-27 21:34 ` Andre McCurdy
  0 siblings, 1 reply; 4+ messages in thread
From: Damien LEFEVRE @ 2018-04-27 10:44 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

Hi,

This must be a stupid basic question. I have the following recipe append:

keymaps_1.0.bbappend
-----------------------------------------------------------------------------
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append = " file://keymaps.service \
                   file://keymap.sh \
"

do_install_append() {
    install -d ${D}${sysconfdir}
    ln -sf /usr/share/keymaps/i386/qwerty/fi.map.gz
${D}${sysconfdir}/keymap-${LINUX_VERSION}.map.gz

    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/keymaps.service ${D}${systemd_system_unitdir}
}

FILES_${PN} += " ${sysconfdir}/* \
                 ${systemd_system_unitdir}/* \
"

inherit systemd
SYSTEMD_SERVICE_${PN} = "${PN}.service"
-----------------------------------------------------------------------------

The LINUX_VERSION is not expanded and the final symlink name becomes  /etc/
keymap-.map.gz.

What's correct way to get the linux version in the recipe files?

Thanks,
-Damien

[-- Attachment #2: Type: text/html, Size: 7155 bytes --]

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

* Re: LINUX_VERSION issue in recipe
  2018-04-27 10:44 LINUX_VERSION issue in recipe Damien LEFEVRE
@ 2018-04-27 21:34 ` Andre McCurdy
  2018-04-28  2:20   ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Andre McCurdy @ 2018-04-27 21:34 UTC (permalink / raw)
  To: Damien LEFEVRE; +Cc: Yocto discussion list

On Fri, Apr 27, 2018 at 3:44 AM, Damien LEFEVRE <lefevre.da@gmail.com> wrote:
> Hi,
>
> This must be a stupid basic question. I have the following recipe append:
>
> keymaps_1.0.bbappend
> -----------------------------------------------------------------------------
> FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
> SRC_URI_append = " file://keymaps.service \
>                    file://keymap.sh \
> "
>
> do_install_append() {
>     install -d ${D}${sysconfdir}
>     ln -sf /usr/share/keymaps/i386/qwerty/fi.map.gz
> ${D}${sysconfdir}/keymap-${LINUX_VERSION}.map.gz
>
>     install -d ${D}${systemd_system_unitdir}
>     install -m 0644 ${WORKDIR}/keymaps.service ${D}${systemd_system_unitdir}
> }
>
> FILES_${PN} += " ${sysconfdir}/* \
>                  ${systemd_system_unitdir}/* \
> "
>
> inherit systemd
> SYSTEMD_SERVICE_${PN} = "${PN}.service"
> -----------------------------------------------------------------------------
>
> The LINUX_VERSION is not expanded and the final symlink name becomes
> /etc/keymap-.map.gz.
>
> What's correct way to get the linux version in the recipe files?

In general, there isn't a correct way to do that. The LINUX_VERSION
variable is defined within the kernel recipe and other recipes won't
have access to it.

A core concept in OE is that recipes build independently of each
other. In this case, since the keymaps recipe has no direct dependency
on the kernel, you should not expect the keymaps recipe to be rebuilt
(or affected in any way) when the kernel or kernel version changes.

The keymaps init script ( meta/recipes-bsp/keymaps/files/keymap.sh )
detects the kernel version dynamically at runtime. If you need a
kernel version specific symlink in your target rootfs, maybe you could
create it at runtime from your keymaps service file?


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

* Re: LINUX_VERSION issue in recipe
  2018-04-27 21:34 ` Andre McCurdy
@ 2018-04-28  2:20   ` Bruce Ashfield
  2018-04-28 11:11     ` Damien LEFEVRE
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Ashfield @ 2018-04-28  2:20 UTC (permalink / raw)
  To: Andre McCurdy, Damien LEFEVRE; +Cc: Yocto discussion list



On 4/27/2018 5:34 PM, Andre McCurdy wrote:
> On Fri, Apr 27, 2018 at 3:44 AM, Damien LEFEVRE <lefevre.da@gmail.com> wrote:
>> Hi,
>>
>> This must be a stupid basic question. I have the following recipe append:
>>
>> keymaps_1.0.bbappend
>> -----------------------------------------------------------------------------
>> FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
>> SRC_URI_append = " file://keymaps.service \
>>                     file://keymap.sh \
>> "
>>
>> do_install_append() {
>>      install -d ${D}${sysconfdir}
>>      ln -sf /usr/share/keymaps/i386/qwerty/fi.map.gz
>> ${D}${sysconfdir}/keymap-${LINUX_VERSION}.map.gz
>>
>>      install -d ${D}${systemd_system_unitdir}
>>      install -m 0644 ${WORKDIR}/keymaps.service ${D}${systemd_system_unitdir}
>> }
>>
>> FILES_${PN} += " ${sysconfdir}/* \
>>                   ${systemd_system_unitdir}/* \
>> "
>>
>> inherit systemd
>> SYSTEMD_SERVICE_${PN} = "${PN}.service"
>> -----------------------------------------------------------------------------
>>
>> The LINUX_VERSION is not expanded and the final symlink name becomes
>> /etc/keymap-.map.gz.
>>
>> What's correct way to get the linux version in the recipe files?
> 
> In general, there isn't a correct way to do that. The LINUX_VERSION
> variable is defined within the kernel recipe and other recipes won't
> have access to it.
> 
> A core concept in OE is that recipes build independently of each
> other. In this case, since the keymaps recipe has no direct dependency
> on the kernel, you should not expect the keymaps recipe to be rebuilt
> (or affected in any way) when the kernel or kernel version changes.

Yep. Unless you inherit the kernel build classes there's no
easy way to do this. But if the kernel classes are inherited,
then some of the variables like KERNEL_VERSION become available
to use .. but of course, you've just tightly coupled things to
the kernel.

Cheers,

Bruce

> 
> The keymaps init script ( meta/recipes-bsp/keymaps/files/keymap.sh )
> detects the kernel version dynamically at runtime. If you need a
> kernel version specific symlink in your target rootfs, maybe you could
> create it at runtime from your keymaps service file?
> 


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

* Re: LINUX_VERSION issue in recipe
  2018-04-28  2:20   ` Bruce Ashfield
@ 2018-04-28 11:11     ` Damien LEFEVRE
  0 siblings, 0 replies; 4+ messages in thread
From: Damien LEFEVRE @ 2018-04-28 11:11 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 2787 bytes --]

 OK, thanks for the clarification guys!

I think I'll just overwrite the keymaps recipe script to get rid of the
kernel version and continue from here =)

Cheers,
-Damien


On Sat, Apr 28, 2018 at 5:20 AM, Bruce Ashfield <
bruce.ashfield@windriver.com> wrote:

>
>
> On 4/27/2018 5:34 PM, Andre McCurdy wrote:
>
>> On Fri, Apr 27, 2018 at 3:44 AM, Damien LEFEVRE <lefevre.da@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> This must be a stupid basic question. I have the following recipe append:
>>>
>>> keymaps_1.0.bbappend
>>> ------------------------------------------------------------
>>> -----------------
>>> FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
>>> SRC_URI_append = " file://keymaps.service \
>>>                     file://keymap.sh \
>>> "
>>>
>>> do_install_append() {
>>>      install -d ${D}${sysconfdir}
>>>      ln -sf /usr/share/keymaps/i386/qwerty/fi.map.gz
>>> ${D}${sysconfdir}/keymap-${LINUX_VERSION}.map.gz
>>>
>>>      install -d ${D}${systemd_system_unitdir}
>>>      install -m 0644 ${WORKDIR}/keymaps.service
>>> ${D}${systemd_system_unitdir}
>>> }
>>>
>>> FILES_${PN} += " ${sysconfdir}/* \
>>>                   ${systemd_system_unitdir}/* \
>>> "
>>>
>>> inherit systemd
>>> SYSTEMD_SERVICE_${PN} = "${PN}.service"
>>> ------------------------------------------------------------
>>> -----------------
>>>
>>> The LINUX_VERSION is not expanded and the final symlink name becomes
>>> /etc/keymap-.map.gz.
>>>
>>> What's correct way to get the linux version in the recipe files?
>>>
>>
>> In general, there isn't a correct way to do that. The LINUX_VERSION
>> variable is defined within the kernel recipe and other recipes won't
>> have access to it.
>>
>> A core concept in OE is that recipes build independently of each
>> other. In this case, since the keymaps recipe has no direct dependency
>> on the kernel, you should not expect the keymaps recipe to be rebuilt
>> (or affected in any way) when the kernel or kernel version changes.
>>
>
> Yep. Unless you inherit the kernel build classes there's no
> easy way to do this. But if the kernel classes are inherited,
> then some of the variables like KERNEL_VERSION become available
> to use .. but of course, you've just tightly coupled things to
> the kernel.
>
> Cheers,
>
> Bruce
>
>
>
>> The keymaps init script ( meta/recipes-bsp/keymaps/files/keymap.sh )
>> detects the kernel version dynamically at runtime. If you need a
>> kernel version specific symlink in your target rootfs, maybe you could
>> create it at runtime from your keymaps service file?
>>
>>


-- 
___________________________

        LEFEVRE Damien
        lefevre.da@gmail.com
        http://www.lfdm.net
  ___________________________

[-- Attachment #2: Type: text/html, Size: 6817 bytes --]

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

end of thread, other threads:[~2018-04-28 11:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27 10:44 LINUX_VERSION issue in recipe Damien LEFEVRE
2018-04-27 21:34 ` Andre McCurdy
2018-04-28  2:20   ` Bruce Ashfield
2018-04-28 11:11     ` Damien LEFEVRE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.