Bug 2658 - Create Kernel Device Driver SDK (host-side)
Summary: Create Kernel Device Driver SDK (host-side)
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium enhancement
Target Milestone: 2.4 M4
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 26 Sept 2017: RESOLVED
Depends on:
Blocks:
 
Reported: 2012-06-25 20:35 UTC by Khem Raj
Modified: 2017-09-25 15:45 UTC (History)
12 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2012-06-25 20:35:57 UTC
We have meta-toolchain which can produce toolchain SDK good for application development but not for external module or device driver development. We should create such a target.

I have some priliminary patches for it. I will submit them soon for comments.
Comment 1 Richard Purdie 2013-10-18 22:39:32 UTC
Khem, what happened to this?
Comment 2 João Henrique 2014-02-21 03:01:57 UTC
I would like to take it. Khem, could you provide your preliminary patches?

Thanks.
Comment 3 Khem Raj 2014-02-21 03:09:41 UTC
(In reply to comment #2)
> I would like to take it. Khem, could you provide your preliminary patches?

Joao,

I did not have any working patches. I added virtual/kernel to TARGET packages
for SDK but that was long time ago we did not have populate_sdk task back then
however, I quickly ran into problems where folks wanted to do much more than
external modules. So checking out a kernel source was an easier workflow
Comment 4 Darren Hart 2014-08-14 15:21:25 UTC
So currently, to build modules on the target, you need the sdk and the kernel-dev package. You also have to run make scripts in the kernel to build the target arch versions.

It isn't clear to me what exactly this bug is describing. Khem, can you provide any additional information? Is this still needed?
Comment 5 Khem Raj 2014-08-14 15:30:27 UTC
(In reply to comment #4)
> So currently, to build modules on the target, you need the sdk and the
> kernel-dev package. You also have to run make scripts in the kernel to build
> the target arch versions.
> 
> It isn't clear to me what exactly this bug is describing. Khem, can you
> provide any additional information? Is this still needed?

This feature request is not for on device SDK but for cross SDK which is essentially very much the SDK we have for app development in addition to it will have configured kernel sources as well so that developers can write out-of-kernel lkms in a cross build environment.
Comment 6 Darren Hart 2014-08-14 15:50:52 UTC
Thanks Khem, got it.
Comment 7 Darren Hart 2014-08-14 21:32:16 UTC
From someone else I spoke with looking to do a similar thing (build out of tree modules using the host SDK):

"
1. Installed the sdk from the script produced from % bitbake image-full -c populate_sdk
2. cd into the top level of the sdk and source the environment variables file
3. cd to sysroots/i586*/usr/src/kernel
4. run 'make scripts'
5. return to top level of sdk and add to environment variables file KERNELDIR to reference sysroots/i586*/usr/src/kernel

Now I can move to one of my kernel modules and run 'make' and it just works.

So, from a naïve perspective, having the make scripts occur as part of the install would be quite helpful. Having KERNELDIR set in the environment variables would also be helpful.
"
Comment 8 Saul Wold 2017-07-21 16:39:01 UTC
The current eSDK environment is able to build both kernels and out of tree modules, either directly or via devtool.  At this point, I think we need to improve the documentation of this functionality.

When using the eSDK with 2.4, we should now be able to use devtool to build a full kernel or a out of tree module without the additional steps that Darren mentions in comment #7. There are some examples in the Tips and Tricks section on the wiki.

We may need to add some use cases examples in Kernel Lab and Kernel Developer manual with links to/from the SDK manual.
Comment 9 Scott Rifenbark 2017-07-21 17:49:11 UTC
Yes - this is a missing piece in the current doc set.  I have an email out to Henry Bruce to close on a kernel development workflow that involves devtool.  This needs to be in place.

Scott
Comment 10 Henry Bruce 2017-07-21 20:09:39 UTC
Content is being created in Tips and Tricks article at https://wiki.yoctoproject.org/wiki/TipsAndTricks/KernelDevelopmentWithEsdk. I'll assign bug to me and then hand over to Scott when done.
Comment 11 Henry Bruce 2017-08-01 23:02:22 UTC
Handing over to Scott.
Comment 12 Scott Rifenbark 2017-08-09 22:09:14 UTC
I have scrubbed through the wiki page that Henry created (https://wiki.yoctoproject.org/wiki/TipsAndTricks/KernelDevelopmentWithEsdk).  I fixed some typos and added some clarifying notes that where things tripped me up a bit. 

My only question left with the wiki now is the placement of the layer creation step (meta-my-kernel).  I sent a separate email to Henry that asks for the some more information on just exactly where this part of the process is needed based on whether the user builds the *.sh file or downloads it.  

I will begin layering this wiki information into the manual set.

Scott
Comment 13 Scott Rifenbark 2017-09-07 23:28:46 UTC
I will move the creation of the layer step a bit in the wiki.  Once that is done I am calling it good on this bug.  The stuff in the kernel manual is going to be different than the wiki example.  Wiki uses real hardware and the kernel manual uses QEMU.

Scott
Comment 14 Scott Rifenbark 2017-09-07 23:36:57 UTC
So the "Create a Layer" section is now more appropriately located now.  I will put this in IN PROGRESS REVIEW should anyone like to look at the procedure again.  

scott
Comment 15 Scott Rifenbark 2017-09-25 15:45:40 UTC
No review comments so marking RESOLVED.  Setting doc flag to "done."