Re: [yocto] building the kernel's usbipd daemon

2021-11-08 Thread Nicolas Jeker
On Fri, 2021-11-05 at 15:02 -0700, chuck kamas via
lists.yoctoproject.org wrote:
> Well it turns out that following the Perf recipe was not only a good 
> idea, but absolutely necessary. The perf recipe copies the code out of 
> the work-shared kernel directory into the perf build directory. This 
> avoids the error when bitbake thinks that the kernel code is not needed
> anymore and removes it.
> 
> 
> Please see my version of the USBIP recipe below.
> 
> 
> Question, how does one get this into the recipe database?
> 

I'm not sure where this belongs, but maybe you can try to submit it to
the meta-oe repository. Look at the readme[1] for instructions.

[1]: https://git.openembedded.org/meta-openembedded/tree/meta-oe/README

> 
> Again thanks for the help!
> 
> Chuck
> 
> > SUMMARY = "USBip part of Linux kernel built in tools"
> > DESCRIPTION = " USB/IP protocol allows to pass USB device from server
> > to \
> > client over the network. Server is a machine which provides (shares)
> > a \
> > USB device. Client is a machine which uses USB device provided by
> > server \
> > over the network. The USB device may be either physical device
> > connected \
> > to a server or software entity created on a server using USB gadget
> > subsystem."
> > 
> > LICENSE = "GPLv2"
> > LIC_FILES_CHKSUM = 
> > "file://${COMMON_LICENSE_DIR}/GPL-
> > 2.0;md5=801f80980d171dd6425610833a22dbe6"
> > DEPENDS = "virtual/kernel libtool udev"
> > PROVIDES = "virtual/usbip-tools"
> > 
> > inherit linux-kernel-base kernel-arch kernelsrc manpages
> > 
> > 
> > do_populate_lic[depends] += "virtual/kernel:do_patch"
> > do_configure[depends] += "virtual/kernel:do_shared_workdir"
> > 
> > EXTRA_OEMAKE = "\
> >     -C ${S}/tools/usb/usbip \
> >     O=${B} \
> >     CROSS_COMPILE=${TARGET_PREFIX} \
> >     CROSS=${TARGET_PREFIX} \
> >     CC="${CC}" \
> >     CCLD="${CC}" \
> >     LD="${LD}" \
> >     AR="${AR}" \
> >     ARCH="${ARCH}" \
> >     TMPDIR="${B}" \
> > "
> > 
> > EXTRA_OEMAKE += "\
> >     'DESTDIR=${D}' \
> >     KERNEL_SRC=${STAGING_KERNEL_DIR} \
> > "
> > 
> > do_configure[depends] += "virtual/kernel:do_shared_workdir"
> > 
> > inherit autotools gettext
> > 
> > # stolen from autotools.bbclass
> > 
> > CONFIGUREOPTS = " --build=${BUILD_SYS} \
> >           --host=${HOST_SYS} \
> >           --target=${TARGET_SYS} \
> >           --prefix=${prefix} \
> >           --exec_prefix=${exec_prefix} \
> >           --bindir=${bindir} \
> >           --sbindir=${sbindir} \
> >           --libexecdir=${libexecdir} \
> >           --datadir=${datadir} \
> >           --sysconfdir=${sysconfdir} \
> >           --sharedstatedir=${sharedstatedir} \
> >           --localstatedir=${localstatedir} \
> >           --libdir=${libdir} \
> >           --includedir=${includedir} \
> >           --oldincludedir=${oldincludedir} \
> >           --infodir=${infodir} \
> >           --mandir=${mandir} \
> >           --disable-silent-rules \
> >           ${CONFIGUREOPT_DEPTRACK} \
> >           ${@append_libtool_sysroot(d)} \
> > "
> > 
> > do_configure_prepend () {
> >     cd ${S}/tools/usb/usbip
> >     ./cleanup.sh
> >     ./autogen.sh
> >     ./configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
> > }
> > 
> > do_compile() {
> >     oe_runmake
> > }
> > 
> > do_install() {
> >     oe_runmake DESTDIR=${D} install
> > }
> > 
> > PACKAGE_ARCH = "${MACHINE_ARCH}"
> > 
> > python do_package_prepend() {
> >     d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0])
> > }
> > 
> > B = "${WORKDIR}/${BPN}-${PV}"
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#55271): https://lists.yoctoproject.org/g/yocto/message/55271
Mute This Topic: https://lists.yoctoproject.org/mt/86249103/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] building the kernel's usbipd daemon

2021-11-05 Thread chuck kamas via lists.yoctoproject.org
Well it turns out that following the Perf recipe was not only a good 
idea, but absolutely necessary. The perf recipe copies the code out of 
the work-shared kernel directory into the perf build directory. This 
avoids the error when bitbake thinks that the kernel code is not needed 
anymore and removes it.



Please see my version of the USBIP recipe below.


Question, how does one get this into the recipe database?


Again thanks for the help!

Chuck


SUMMARY = "USBip part of Linux kernel built in tools"
DESCRIPTION = " USB/IP protocol allows to pass USB device from server to \
client over the network. Server is a machine which provides (shares) a \
USB device. Client is a machine which uses USB device provided by server \
over the network. The USB device may be either physical device connected \
to a server or software entity created on a server using USB gadget 
subsystem."


LICENSE = "GPLv2"
LIC_FILES_CHKSUM = 
"file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"

DEPENDS = "virtual/kernel libtool udev"
PROVIDES = "virtual/usbip-tools"

inherit linux-kernel-base kernel-arch kernelsrc manpages


do_populate_lic[depends] += "virtual/kernel:do_patch"
do_configure[depends] += "virtual/kernel:do_shared_workdir"

EXTRA_OEMAKE = "\
    -C ${S}/tools/usb/usbip \
    O=${B} \
    CROSS_COMPILE=${TARGET_PREFIX} \
    CROSS=${TARGET_PREFIX} \
    CC="${CC}" \
    CCLD="${CC}" \
    LD="${LD}" \
    AR="${AR}" \
    ARCH="${ARCH}" \
    TMPDIR="${B}" \
"

EXTRA_OEMAKE += "\
    'DESTDIR=${D}' \
    KERNEL_SRC=${STAGING_KERNEL_DIR} \
"

do_configure[depends] += "virtual/kernel:do_shared_workdir"

inherit autotools gettext

# stolen from autotools.bbclass

CONFIGUREOPTS = " --build=${BUILD_SYS} \
          --host=${HOST_SYS} \
          --target=${TARGET_SYS} \
          --prefix=${prefix} \
          --exec_prefix=${exec_prefix} \
          --bindir=${bindir} \
          --sbindir=${sbindir} \
          --libexecdir=${libexecdir} \
          --datadir=${datadir} \
          --sysconfdir=${sysconfdir} \
          --sharedstatedir=${sharedstatedir} \
          --localstatedir=${localstatedir} \
          --libdir=${libdir} \
          --includedir=${includedir} \
          --oldincludedir=${oldincludedir} \
          --infodir=${infodir} \
          --mandir=${mandir} \
          --disable-silent-rules \
          ${CONFIGUREOPT_DEPTRACK} \
          ${@append_libtool_sysroot(d)} \
"

do_configure_prepend () {
    cd ${S}/tools/usb/usbip
    ./cleanup.sh
    ./autogen.sh
    ./configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
}

do_compile() {
    oe_runmake
}

do_install() {
    oe_runmake DESTDIR=${D} install
}

PACKAGE_ARCH = "${MACHINE_ARCH}"

python do_package_prepend() {
    d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0])
}

B = "${WORKDIR}/${BPN}-${PV}"


SUMMARY = "USBip part of Linux kernel built in tools"
DESCRIPTION = " USB/IP protocol allows to pass USB device from server to \
client over the network. Server is a machine which provides (shares) a \
USB device. Client is a machine which uses USB device provided by server \
over the network. The USB device may be either physical device connected \
to a server or software entity created on a server using USB gadget subsystem."

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = 
"file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
DEPENDS = "virtual/kernel libtool udev"
PROVIDES = "virtual/usbip-tools"

inherit linux-kernel-base kernel-arch kernelsrc manpages


do_populate_lic[depends] += "virtual/kernel:do_patch"
do_configure[depends] += "virtual/kernel:do_shared_workdir" 

EXTRA_OEMAKE = "\
-C ${S}/tools/usb/usbip \
O=${B} \
CROSS_COMPILE=${TARGET_PREFIX} \
CROSS=${TARGET_PREFIX} \
CC="${CC}" \
CCLD="${CC}" \
LD="${LD}" \
AR="${AR}" \
ARCH="${ARCH}" \
TMPDIR="${B}" \
"

EXTRA_OEMAKE += "\
'DESTDIR=${D}' \
KERNEL_SRC=${STAGING_KERNEL_DIR} \
"

do_configure[depends] += "virtual/kernel:do_shared_workdir"

inherit autotools gettext

# stolen from autotools.bbclass

CONFIGUREOPTS = " --build=${BUILD_SYS} \
  --host=${HOST_SYS} \
  --target=${TARGET_SYS} \
  --prefix=${prefix} \
  --exec_prefix=${exec_prefix} \
  --bindir=${bindir} \
  --sbindir=${sbindir} \
  --libexecdir=${libexecdir} \
  --datadir=${datadir} \
  --sysconfdir=${sysconfdir} \
  --sharedstatedir=${sharedstatedir} \
  --localstatedir=${localstatedir} \
  --libdir=${libdir} \
  --includedir=${includedir} \
  --oldincludedir=${oldincludedir} \
  --infodir=${infodir} \
  --mandir=${mandir} \
  --disable-silent-rules \
  ${CONFIGUREOPT_DEPTRACK} \
  ${@append_libtool_sysroot(d)} \
"

do_configure_prepend 

Re: [yocto] building the kernel's usbipd daemon

2021-10-12 Thread Bruce Ashfield
On Tue, Oct 12, 2021 at 12:33 AM chuck kamas via
lists.yoctoproject.org 
wrote:
>
> Thanks for the quick reply. I looked at the perf recipe, and its quite 
> involved. Is there a simpler recipie to use as a template? Perhaps one of 
> these?
>

My intent was just to show how you'd get the source from whatever
kernel you are building,

> meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb
>
> meta-openembedded/meta-oe/recipes-kernel/spidev-test/spidev-test.bb
>
> meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb
>
>
> all three of these appear to be basically the same very simple bb file.
>

Assuming that you don't need to patch the sources directly, any of
those would likely work ... depending on the dependencies and options
of what tool you are building.

Bruce

>
> Chuck
>
>
> On 10/11/21 5:46 PM, Bruce Ashfield wrote:
>
> On Mon, Oct 11, 2021 at 6:16 PM chuck kamas via lists.yoctoproject.org
>  wrote:
>
> Hi all,
>
>
> I've googled most of the day, but to no avail. How does one compile and
> add to the image the daemon usbipd? Is there a bitbake file already for
> this? The code is part of the kernel found in the kernel tree:
>
> KERNEL_SRC_PATH/tools/usb/usbip/src
>
> and is invoked from the KERNEL_SRC_PATH/tools directory by calling
>
> make usb
>
>
> from:
> https://wiki.st.com/stm32mpu/wiki/How_to_build_Linux_kernel_user_space_tools
>
> PC $> cd /tools
> PC $> make 
>
>
> I would think that there is a preexisting recipe.
>
> There isn't one that I've ever heard of, and the layerindex
> (http://layers.openembedded.org/) confirms that nothing registered
> with it provides that recipe.
>
> So if you need it, you'd have to create a recipe .. and submit it to
> somewhere like meta-openembedded if appropriate.
>
> Have a look at the perf recipe for one of the ways we build tools out
> of the kernel source. Something similar will work in this case.
>
> Bruce
>
> thanks,
>
> Chuck
>
>
>
>
>
>
>
>
>
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#55037): https://lists.yoctoproject.org/g/yocto/message/55037
Mute This Topic: https://lists.yoctoproject.org/mt/86249103/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] building the kernel's usbipd daemon

2021-10-11 Thread chuck kamas via lists.yoctoproject.org
Thanks for the quick reply. I looked at the perf recipe, and its quite 
involved. Is there a simpler recipie to use as a template? Perhaps one 
of these?


meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb

meta-openembedded/meta-oe/recipes-kernel/spidev-test/spidev-test.bb

meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb


all three of these appear to be basically the same very simple bb file.


Chuck


On 10/11/21 5:46 PM, Bruce Ashfield wrote:

On Mon, Oct 11, 2021 at 6:16 PM chuck kamas via lists.yoctoproject.org
 wrote:

Hi all,


I've googled most of the day, but to no avail. How does one compile and
add to the image the daemon usbipd? Is there a bitbake file already for
this? The code is part of the kernel found in the kernel tree:

KERNEL_SRC_PATH/tools/usb/usbip/src

and is invoked from the KERNEL_SRC_PATH/tools directory by calling

make usb


from:
https://wiki.st.com/stm32mpu/wiki/How_to_build_Linux_kernel_user_space_tools

PC $> cd /tools
PC $> make 


I would think that there is a preexisting recipe.

There isn't one that I've ever heard of, and the layerindex
(http://layers.openembedded.org/) confirms that nothing registered
with it provides that recipe.

So if you need it, you'd have to create a recipe .. and submit it to
somewhere like meta-openembedded if appropriate.

Have a look at the perf recipe for one of the ways we build tools out
of the kernel source. Something similar will work in this case.

Bruce


thanks,

Chuck











-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#55027): https://lists.yoctoproject.org/g/yocto/message/55027
Mute This Topic: https://lists.yoctoproject.org/mt/86249103/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] building the kernel's usbipd daemon

2021-10-11 Thread Bruce Ashfield
On Mon, Oct 11, 2021 at 6:16 PM chuck kamas via lists.yoctoproject.org
 wrote:
>
> Hi all,
>
>
> I've googled most of the day, but to no avail. How does one compile and
> add to the image the daemon usbipd? Is there a bitbake file already for
> this? The code is part of the kernel found in the kernel tree:
>
> KERNEL_SRC_PATH/tools/usb/usbip/src
>
> and is invoked from the KERNEL_SRC_PATH/tools directory by calling
>
> make usb
>
>
> from:
> https://wiki.st.com/stm32mpu/wiki/How_to_build_Linux_kernel_user_space_tools
>
> PC $> cd /tools
> PC $> make 
>
>
> I would think that there is a preexisting recipe.

There isn't one that I've ever heard of, and the layerindex
(http://layers.openembedded.org/) confirms that nothing registered
with it provides that recipe.

So if you need it, you'd have to create a recipe .. and submit it to
somewhere like meta-openembedded if appropriate.

Have a look at the perf recipe for one of the ways we build tools out
of the kernel source. Something similar will work in this case.

Bruce

>
> thanks,
>
> Chuck
>
>
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#55024): https://lists.yoctoproject.org/g/yocto/message/55024
Mute This Topic: https://lists.yoctoproject.org/mt/86249103/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[yocto] building the kernel's usbipd daemon

2021-10-11 Thread chuck kamas via lists.yoctoproject.org

Hi all,


I've googled most of the day, but to no avail. How does one compile and 
add to the image the daemon usbipd? Is there a bitbake file already for 
this? The code is part of the kernel found in the kernel tree:


KERNEL_SRC_PATH/tools/usb/usbip/src

and is invoked from the KERNEL_SRC_PATH/tools directory by calling

make usb


from: 
https://wiki.st.com/stm32mpu/wiki/How_to_build_Linux_kernel_user_space_tools


PC $> cd /tools
PC $> make 


I would think that there is a preexisting recipe.

thanks,

Chuck



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#55020): https://lists.yoctoproject.org/g/yocto/message/55020
Mute This Topic: https://lists.yoctoproject.org/mt/86249103/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-