* How do I patch the kernel before it is built? @ 2012-01-31 16:45 autif khan 2012-01-31 16:51 ` Joshua Lock 2012-01-31 16:51 ` Bruce Ashfield 0 siblings, 2 replies; 17+ messages in thread From: autif khan @ 2012-01-31 16:45 UTC (permalink / raw) To: yocto I could not find a way to patch the kernel source before its is built. I promise to update the Yocto wiki's How do I section when I have a working solution for the following :-) Here is what I am trying to do: 1) Patch the kernel (add VID/PID to hid_ignore_list in drivers/hid/hid-core.c and also to add the VID/PID to .h file) 2) Build the kernel - no change here - standard kernel build 3) Build a kernel module I have a meta layer where I am keeping my changes. I am guessing that I need to: a) write a bbappend file to accomplish #1 b) write a recipe to accomplish #3 I have written recipes before, but just for libraries and autotools based applications. Not for a kernel module. If there is a recipe out there for some other module, I would be happy to steal from it. Please advise how I can go about patching the kernel and if there is a recipe for a kernel module - please point me to it. Thank you Autif ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-01-31 16:45 How do I patch the kernel before it is built? autif khan @ 2012-01-31 16:51 ` Joshua Lock 2012-01-31 16:51 ` Bruce Ashfield 1 sibling, 0 replies; 17+ messages in thread From: Joshua Lock @ 2012-01-31 16:51 UTC (permalink / raw) To: yocto On 31/01/12 08:45, autif khan wrote: > I could not find a way to patch the kernel source before its is built. > > I promise to update the Yocto wiki's How do I section when I have a > working solution for the following :-) > > Here is what I am trying to do: > > 1) Patch the kernel (add VID/PID to hid_ignore_list in > drivers/hid/hid-core.c and also to add the VID/PID to .h file) We have some documentation which covers this: http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#dev-manual-kernel-appendix I'm not sure if it answers all of your questions, but hopefully it gets you closer. Cheers, Joshua -- Joshua Lock Yocto Project "Johannes factotum" Intel Open Source Technology Centre ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-01-31 16:45 How do I patch the kernel before it is built? autif khan 2012-01-31 16:51 ` Joshua Lock @ 2012-01-31 16:51 ` Bruce Ashfield 2012-01-31 16:54 ` Darren Hart 1 sibling, 1 reply; 17+ messages in thread From: Bruce Ashfield @ 2012-01-31 16:51 UTC (permalink / raw) To: autif khan; +Cc: yocto, Darren Hart On 12-01-31 11:45 AM, autif khan wrote: > I could not find a way to patch the kernel source before its is built. > > I promise to update the Yocto wiki's How do I section when I have a > working solution for the following :-) This should be covered in the existing documentation and also the more general bitbake/oe-core docs. > > Here is what I am trying to do: > > 1) Patch the kernel (add VID/PID to hid_ignore_list in > drivers/hid/hid-core.c and also to add the VID/PID to .h file) > 2) Build the kernel - no change here - standard kernel build > 3) Build a kernel module > > I have a meta layer where I am keeping my changes. I am guessing that I need to: > > a) write a bbappend file to accomplish #1 > b) write a recipe to accomplish #3 > > I have written recipes before, but just for libraries and autotools > based applications. Not for a kernel module. If there is a recipe out > there for some other module, I would be happy to steal from it. > > Please advise how I can go about patching the kernel and if there is a It's just like any other package. If your changes are simple, then generating patches and putting them on the SRC_URI via a bbappend in your layer is all you need. If you have complex changes, there are options to manage them via git or via feature descriptions. > recipe for a kernel module - please point me to it. Darren validated and updated the kernel module example, so he'd probably got this closer at hand than I do. Cheers, Bruce > > Thank you > > Autif > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-01-31 16:51 ` Bruce Ashfield @ 2012-01-31 16:54 ` Darren Hart 2012-02-06 19:35 ` autif khan 2012-02-08 15:31 ` autif khan 0 siblings, 2 replies; 17+ messages in thread From: Darren Hart @ 2012-01-31 16:54 UTC (permalink / raw) To: Bruce Ashfield; +Cc: yocto On 01/31/2012 08:51 AM, Bruce Ashfield wrote: > On 12-01-31 11:45 AM, autif khan wrote: >> I could not find a way to patch the kernel source before its is built. >> >> I promise to update the Yocto wiki's How do I section when I have a >> working solution for the following :-) > > This should be covered in the existing documentation and also the > more general bitbake/oe-core docs. > >> >> Here is what I am trying to do: >> >> 1) Patch the kernel (add VID/PID to hid_ignore_list in >> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >> 2) Build the kernel - no change here - standard kernel build >> 3) Build a kernel module >> >> I have a meta layer where I am keeping my changes. I am guessing that I need to: >> >> a) write a bbappend file to accomplish #1 >> b) write a recipe to accomplish #3 >> >> I have written recipes before, but just for libraries and autotools >> based applications. Not for a kernel module. If there is a recipe out >> there for some other module, I would be happy to steal from it. >> >> Please advise how I can go about patching the kernel and if there is a > > It's just like any other package. If your changes are simple, then > generating patches and putting them on the SRC_URI via a bbappend in > your layer is all you need. If you have complex changes, there are options > to manage them via git or via feature descriptions. > >> recipe for a kernel module - please point me to it. > > Darren validated and updated the kernel module example, so he'd probably > got this closer at hand than I do. See the hello-mod example under meta/recipes-kernel/hello-mod -- Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-01-31 16:54 ` Darren Hart @ 2012-02-06 19:35 ` autif khan 2012-02-06 19:39 ` Bruce Ashfield 2012-02-06 19:46 ` Bruce Ashfield 2012-02-08 15:31 ` autif khan 1 sibling, 2 replies; 17+ messages in thread From: autif khan @ 2012-02-06 19:35 UTC (permalink / raw) To: Darren Hart; +Cc: yocto >>> I could not find a way to patch the kernel source before its is built. >>> >>> I promise to update the Yocto wiki's How do I section when I have a >>> working solution for the following :-) >> >> This should be covered in the existing documentation and also the >> more general bitbake/oe-core docs. >> >>> >>> Here is what I am trying to do: >>> >>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>> 2) Build the kernel - no change here - standard kernel build >>> 3) Build a kernel module >>> >>> I have a meta layer where I am keeping my changes. I am guessing that I need to: >>> >>> a) write a bbappend file to accomplish #1 >>> b) write a recipe to accomplish #3 >>> >>> I have written recipes before, but just for libraries and autotools >>> based applications. Not for a kernel module. If there is a recipe out >>> there for some other module, I would be happy to steal from it. >>> >>> Please advise how I can go about patching the kernel and if there is a >> >> It's just like any other package. If your changes are simple, then >> generating patches and putting them on the SRC_URI via a bbappend in >> your layer is all you need. If you have complex changes, there are options >> to manage them via git or via feature descriptions. I tried this - attached at the end of this email are my bbappend file and my patches, when the recipe is bitbaked, it does not actually apply the patch. On a similar note - there seems to be a file in meta/recipes-kernel/linux/linux-yocto called tools-perf-no-scripting.patch However, it does not seem to be used anywhere - is this just crud or I am missing something? I was hoping to cheat off of the recipe that uses it. >>> recipe for a kernel module - please point me to it. >> >> Darren validated and updated the kernel module example, so he'd probably >> got this closer at hand than I do. > > See the hello-mod example under meta/recipes-kernel/hello-mod Thank you for this recipe - it seems like this is exactly what I was looking for. I will cheat off of this as soon as I can patch my kernel. R E C I P E autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat linux-yocto_3.0.bbappend FILESEXTRAPATHS_prepend := "${THISDIR}:" SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ file://linux/drivers/hid/hid-ids.h.diff " PR = "r3" autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ P A T C H autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ cat hid-core.c.diff --- linux.orig/drivers/hid/hid-core.c 2012-01-31 16:44:44.152001877 -0500 +++ linux/drivers/hid/hid-core.c 2012-01-31 16:46:34.608001870 -0500 @@ -1839,6 +1839,8 @@ { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) }, { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) }, { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_PIXCIR, USB_DEVICE_ID_PIXCIR) }, { } }; autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ cat hid-ids.h.diff--- linux.orig/drivers/hid/hid-ids.h 2012-01-31 16:44:55.432001877 -0500 +++ linux/drivers/hid/hid-ids.h 2012-01-31 16:47:36.624001858 -0500 @@ -671,4 +671,7 @@ #define USB_VENDOR_ID_ZYDACRON 0x13EC #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 +#define USB_VENDOR_ID_PIXCIR 0x040b +#define USB_DEVICE_ID_PIXCIR 0x2000 + #endif autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-06 19:35 ` autif khan @ 2012-02-06 19:39 ` Bruce Ashfield 2012-02-06 19:46 ` Bruce Ashfield 1 sibling, 0 replies; 17+ messages in thread From: Bruce Ashfield @ 2012-02-06 19:39 UTC (permalink / raw) To: autif khan; +Cc: yocto, Darren Hart On Mon, Feb 6, 2012 at 2:35 PM, autif khan <autif.mlist@gmail.com> wrote: >>>> I could not find a way to patch the kernel source before its is built. >>>> >>>> I promise to update the Yocto wiki's How do I section when I have a >>>> working solution for the following :-) >>> >>> This should be covered in the existing documentation and also the >>> more general bitbake/oe-core docs. >>> >>>> >>>> Here is what I am trying to do: >>>> >>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>> 2) Build the kernel - no change here - standard kernel build >>>> 3) Build a kernel module >>>> >>>> I have a meta layer where I am keeping my changes. I am guessing that I need to: >>>> >>>> a) write a bbappend file to accomplish #1 >>>> b) write a recipe to accomplish #3 >>>> >>>> I have written recipes before, but just for libraries and autotools >>>> based applications. Not for a kernel module. If there is a recipe out >>>> there for some other module, I would be happy to steal from it. >>>> >>>> Please advise how I can go about patching the kernel and if there is a >>> >>> It's just like any other package. If your changes are simple, then >>> generating patches and putting them on the SRC_URI via a bbappend in >>> your layer is all you need. If you have complex changes, there are options >>> to manage them via git or via feature descriptions. > > I tried this - attached at the end of this email are my bbappend file > and my patches, when the recipe is bitbaked, it does not actually > apply the patch. > > On a similar note - there seems to be a file in > meta/recipes-kernel/linux/linux-yocto called > tools-perf-no-scripting.patch > > However, it does not seem to be used anywhere - is this just crud or I > am missing something? I was hoping to cheat off of the recipe that > uses it. cruft. But again, there's no cheating that should be required. This is done all day every day and it typically just works. What branch are you using ? I can run a test with your patch, but can you resent it non-inlined, since I have to cut and past it from the inline'd email, which means I need to reformat it, and chances are it won't apply. Cheers, Bruce > >>>> recipe for a kernel module - please point me to it. >>> >>> Darren validated and updated the kernel module example, so he'd probably >>> got this closer at hand than I do. >> >> See the hello-mod example under meta/recipes-kernel/hello-mod > > Thank you for this recipe - it seems like this is exactly what I was > looking for. I will cheat off of this as soon as I can patch my > kernel. > > > R E C I P E > > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat > linux-yocto_3.0.bbappend > FILESEXTRAPATHS_prepend := "${THISDIR}:" > SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ > file://linux/drivers/hid/hid-ids.h.diff " > PR = "r3" > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ > > P A T C H > > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ > cat hid-core.c.diff > --- linux.orig/drivers/hid/hid-core.c 2012-01-31 16:44:44.152001877 -0500 > +++ linux/drivers/hid/hid-core.c 2012-01-31 16:46:34.608001870 -0500 > @@ -1839,6 +1839,8 @@ > { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) }, > { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) }, > { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, > + { HID_USB_DEVICE(USB_VENDOR_ID_PIXCIR, USB_DEVICE_ID_PIXCIR) }, > { } > }; > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ > cat hid-ids.h.diff--- linux.orig/drivers/hid/hid-ids.h 2012-01-31 > 16:44:55.432001877 -0500 > +++ linux/drivers/hid/hid-ids.h 2012-01-31 16:47:36.624001858 -0500 > @@ -671,4 +671,7 @@ > #define USB_VENDOR_ID_ZYDACRON 0x13EC > #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 > > +#define USB_VENDOR_ID_PIXCIR 0x040b > +#define USB_DEVICE_ID_PIXCIR 0x2000 > + > #endif > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-06 19:35 ` autif khan 2012-02-06 19:39 ` Bruce Ashfield @ 2012-02-06 19:46 ` Bruce Ashfield 2012-02-06 20:18 ` autif khan 1 sibling, 1 reply; 17+ messages in thread From: Bruce Ashfield @ 2012-02-06 19:46 UTC (permalink / raw) To: autif khan; +Cc: yocto, Darren Hart On Mon, Feb 6, 2012 at 2:35 PM, autif khan <autif.mlist@gmail.com> wrote: >>>> I could not find a way to patch the kernel source before its is built. >>>> >>>> I promise to update the Yocto wiki's How do I section when I have a >>>> working solution for the following :-) >>> >>> This should be covered in the existing documentation and also the >>> more general bitbake/oe-core docs. >>> >>>> >>>> Here is what I am trying to do: >>>> >>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>> 2) Build the kernel - no change here - standard kernel build >>>> 3) Build a kernel module >>>> >>>> I have a meta layer where I am keeping my changes. I am guessing that I need to: >>>> >>>> a) write a bbappend file to accomplish #1 >>>> b) write a recipe to accomplish #3 >>>> >>>> I have written recipes before, but just for libraries and autotools >>>> based applications. Not for a kernel module. If there is a recipe out >>>> there for some other module, I would be happy to steal from it. >>>> >>>> Please advise how I can go about patching the kernel and if there is a >>> >>> It's just like any other package. If your changes are simple, then >>> generating patches and putting them on the SRC_URI via a bbappend in >>> your layer is all you need. If you have complex changes, there are options >>> to manage them via git or via feature descriptions. > > I tried this - attached at the end of this email are my bbappend file > and my patches, when the recipe is bitbaked, it does not actually > apply the patch. > > On a similar note - there seems to be a file in > meta/recipes-kernel/linux/linux-yocto called > tools-perf-no-scripting.patch > > However, it does not seem to be used anywhere - is this just crud or I > am missing something? I was hoping to cheat off of the recipe that > uses it. > >>>> recipe for a kernel module - please point me to it. >>> >>> Darren validated and updated the kernel module example, so he'd probably >>> got this closer at hand than I do. >> >> See the hello-mod example under meta/recipes-kernel/hello-mod > > Thank you for this recipe - it seems like this is exactly what I was > looking for. I will cheat off of this as soon as I can patch my > kernel. > > > R E C I P E > > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat > linux-yocto_3.0.bbappend > FILESEXTRAPATHS_prepend := "${THISDIR}:" > SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ > file://linux/drivers/hid/hid-ids.h.diff " > PR = "r3" > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ > > P A T C H > > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ Taking a look at this (while I was cutting and pasting), this should be in in the a 'linux-yocto' subdirectory if you want bitbake to pickup the patch and make it available to the linux-yocto recipe. i.e. ~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux-yocto/drivers/hid And don't use 'linux-yocto' in your file:// reference on the SRC_URI, that part is automatic. (and yes, I see 'edison' was the branch now) Cheers, Bruce > cat hid-core.c.diff > --- linux.orig/drivers/hid/hid-core.c 2012-01-31 16:44:44.152001877 -0500 > +++ linux/drivers/hid/hid-core.c 2012-01-31 16:46:34.608001870 -0500 > @@ -1839,6 +1839,8 @@ > { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) }, > { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) }, > { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, > + { HID_USB_DEVICE(USB_VENDOR_ID_PIXCIR, USB_DEVICE_ID_PIXCIR) }, > { } > }; > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ > cat hid-ids.h.diff--- linux.orig/drivers/hid/hid-ids.h 2012-01-31 > 16:44:55.432001877 -0500 > +++ linux/drivers/hid/hid-ids.h 2012-01-31 16:47:36.624001858 -0500 > @@ -671,4 +671,7 @@ > #define USB_VENDOR_ID_ZYDACRON 0x13EC > #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 > > +#define USB_VENDOR_ID_PIXCIR 0x040b > +#define USB_DEVICE_ID_PIXCIR 0x2000 > + > #endif > autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-06 19:46 ` Bruce Ashfield @ 2012-02-06 20:18 ` autif khan 2012-02-06 20:24 ` Bruce Ashfield 0 siblings, 1 reply; 17+ messages in thread From: autif khan @ 2012-02-06 20:18 UTC (permalink / raw) To: Bruce Ashfield; +Cc: yocto, Darren Hart [-- Attachment #1: Type: text/plain, Size: 6112 bytes --] >>>>> I could not find a way to patch the kernel source before its is built. >>>>> >>>>> I promise to update the Yocto wiki's How do I section when I have a >>>>> working solution for the following :-) >>>> >>>> This should be covered in the existing documentation and also the >>>> more general bitbake/oe-core docs. >>>> >>>>> >>>>> Here is what I am trying to do: >>>>> >>>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>>> 2) Build the kernel - no change here - standard kernel build >>>>> 3) Build a kernel module >>>>> >>>>> I have a meta layer where I am keeping my changes. I am guessing that I need to: >>>>> >>>>> a) write a bbappend file to accomplish #1 >>>>> b) write a recipe to accomplish #3 >>>>> >>>>> I have written recipes before, but just for libraries and autotools >>>>> based applications. Not for a kernel module. If there is a recipe out >>>>> there for some other module, I would be happy to steal from it. >>>>> >>>>> Please advise how I can go about patching the kernel and if there is a >>>> >>>> It's just like any other package. If your changes are simple, then >>>> generating patches and putting them on the SRC_URI via a bbappend in >>>> your layer is all you need. If you have complex changes, there are options >>>> to manage them via git or via feature descriptions. >> >> I tried this - attached at the end of this email are my bbappend file >> and my patches, when the recipe is bitbaked, it does not actually >> apply the patch. >> >> On a similar note - there seems to be a file in >> meta/recipes-kernel/linux/linux-yocto called >> tools-perf-no-scripting.patch >> >> However, it does not seem to be used anywhere - is this just crud or I >> am missing something? I was hoping to cheat off of the recipe that >> uses it. >> >>>>> recipe for a kernel module - please point me to it. >>>> >>>> Darren validated and updated the kernel module example, so he'd probably >>>> got this closer at hand than I do. >>> >>> See the hello-mod example under meta/recipes-kernel/hello-mod >> >> Thank you for this recipe - it seems like this is exactly what I was >> looking for. I will cheat off of this as soon as I can patch my >> kernel. >> >> >> R E C I P E >> >> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat >> linux-yocto_3.0.bbappend >> FILESEXTRAPATHS_prepend := "${THISDIR}:" >> SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ >> file://linux/drivers/hid/hid-ids.h.diff " >> PR = "r3" >> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >> >> P A T C H >> >> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ > > Taking a look at this (while I was cutting and pasting), this should > be in in the > a 'linux-yocto' subdirectory if you want bitbake to pickup the patch and make it > available to the linux-yocto recipe. > > i.e. ~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux-yocto/drivers/hid > > And don't use 'linux-yocto' in your file:// reference on the SRC_URI, > that part is > automatic. I tried this just now - here is what happens: Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is file://drivers/hid/file.diff Result: Fetcher failure for URL: 'file://drivers/hid/hid-core.c.diff Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is file://linux-yocto/drivers/hid/file.diff Result - my diff files are copied in a directory called linux-yocto in tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3 These patches are not applied in tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3/linux Here is what the work directory looks like autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ ls git license-destdir linux linux-crownbay-standard-build linux-yocto temp autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ I have attached the original set of files as a tar gzip. > (and yes, I see 'edison' was the branch now) Yes, I am using Yocto 1.0 - very soon I will migrate to M2 - pending tasks at hand :-) > Cheers, > > Bruce > >> cat hid-core.c.diff >> --- linux.orig/drivers/hid/hid-core.c 2012-01-31 16:44:44.152001877 -0500 >> +++ linux/drivers/hid/hid-core.c 2012-01-31 16:46:34.608001870 -0500 >> @@ -1839,6 +1839,8 @@ >> { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) }, >> { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) }, >> { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, >> + { HID_USB_DEVICE(USB_VENDOR_ID_PIXCIR, USB_DEVICE_ID_PIXCIR) }, >> { } >> }; >> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >> cat hid-ids.h.diff--- linux.orig/drivers/hid/hid-ids.h 2012-01-31 >> 16:44:55.432001877 -0500 >> +++ linux/drivers/hid/hid-ids.h 2012-01-31 16:47:36.624001858 -0500 >> @@ -671,4 +671,7 @@ >> #define USB_VENDOR_ID_ZYDACRON 0x13EC >> #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 >> >> +#define USB_VENDOR_ID_PIXCIR 0x040b >> +#define USB_DEVICE_ID_PIXCIR 0x2000 >> + >> #endif >> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >> _______________________________________________ >> yocto mailing list >> yocto@yoctoproject.org >> https://lists.yoctoproject.org/listinfo/yocto > > > > -- > "Thou shalt not follow the NULL pointer, for chaos and madness await > thee at its end" [-- Attachment #2: linux.tar.gz --] [-- Type: application/x-gzip, Size: 708 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-06 20:18 ` autif khan @ 2012-02-06 20:24 ` Bruce Ashfield 2012-02-06 21:43 ` autif khan 0 siblings, 1 reply; 17+ messages in thread From: Bruce Ashfield @ 2012-02-06 20:24 UTC (permalink / raw) To: autif khan; +Cc: yocto, Darren Hart On 12-02-06 03:18 PM, autif khan wrote: >>>>>> I could not find a way to patch the kernel source before its is built. >>>>>> >>>>>> I promise to update the Yocto wiki's How do I section when I have a >>>>>> working solution for the following :-) >>>>> >>>>> This should be covered in the existing documentation and also the >>>>> more general bitbake/oe-core docs. >>>>> >>>>>> >>>>>> Here is what I am trying to do: >>>>>> >>>>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>>>> 2) Build the kernel - no change here - standard kernel build >>>>>> 3) Build a kernel module >>>>>> >>>>>> I have a meta layer where I am keeping my changes. I am guessing that I need to: >>>>>> >>>>>> a) write a bbappend file to accomplish #1 >>>>>> b) write a recipe to accomplish #3 >>>>>> >>>>>> I have written recipes before, but just for libraries and autotools >>>>>> based applications. Not for a kernel module. If there is a recipe out >>>>>> there for some other module, I would be happy to steal from it. >>>>>> >>>>>> Please advise how I can go about patching the kernel and if there is a >>>>> >>>>> It's just like any other package. If your changes are simple, then >>>>> generating patches and putting them on the SRC_URI via a bbappend in >>>>> your layer is all you need. If you have complex changes, there are options >>>>> to manage them via git or via feature descriptions. >>> >>> I tried this - attached at the end of this email are my bbappend file >>> and my patches, when the recipe is bitbaked, it does not actually >>> apply the patch. >>> >>> On a similar note - there seems to be a file in >>> meta/recipes-kernel/linux/linux-yocto called >>> tools-perf-no-scripting.patch >>> >>> However, it does not seem to be used anywhere - is this just crud or I >>> am missing something? I was hoping to cheat off of the recipe that >>> uses it. >>> >>>>>> recipe for a kernel module - please point me to it. >>>>> >>>>> Darren validated and updated the kernel module example, so he'd probably >>>>> got this closer at hand than I do. >>>> >>>> See the hello-mod example under meta/recipes-kernel/hello-mod >>> >>> Thank you for this recipe - it seems like this is exactly what I was >>> looking for. I will cheat off of this as soon as I can patch my >>> kernel. >>> >>> >>> R E C I P E >>> >>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat >>> linux-yocto_3.0.bbappend >>> FILESEXTRAPATHS_prepend := "${THISDIR}:" >>> SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ >>> file://linux/drivers/hid/hid-ids.h.diff " >>> PR = "r3" >>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >>> >>> P A T C H >>> >>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >> >> Taking a look at this (while I was cutting and pasting), this should >> be in in the >> a 'linux-yocto' subdirectory if you want bitbake to pickup the patch and make it >> available to the linux-yocto recipe. >> >> i.e. ~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux-yocto/drivers/hid >> >> And don't use 'linux-yocto' in your file:// reference on the SRC_URI, >> that part is >> automatic. > > I tried this just now - here is what happens: > > Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is > file://drivers/hid/file.diff > Result: Fetcher failure for URL: 'file://drivers/hid/hid-core.c.diff If you get a fetcher failire, you have it in the wrong place. Note: this has nothing to do with the kernel and is a general bitbake/oe-core question. > > Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is > file://linux-yocto/drivers/hid/file.diff Interesting. I've never had to specify linux-yocto in my SRC_URIs, so something strange it going on here. Does anyone else have ideas here ? > Result - my diff files are copied in a directory called linux-yocto in > tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3 > > These patches are not applied in > tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3/linux > > Here is what the work directory looks like > > autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ > ls > git license-destdir linux linux-crownbay-standard-build linux-yocto temp > autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ > > > I have attached the original set of files as a tar gzip. I'll take them for a spin. > >> (and yes, I see 'edison' was the branch now) > > Yes, I am using Yocto 1.0 - very soon I will migrate to M2 - pending > tasks at hand :-) I'll have to dig up a 1.0 tree, since I don't have anything of that vintage available to me. But I know that patched worked then, and am absolutely sure that it works in 1.1 and master. Cheers, Bruce > >> Cheers, >> >> Bruce >> >>> cat hid-core.c.diff >>> --- linux.orig/drivers/hid/hid-core.c 2012-01-31 16:44:44.152001877 -0500 >>> +++ linux/drivers/hid/hid-core.c 2012-01-31 16:46:34.608001870 -0500 >>> @@ -1839,6 +1839,8 @@ >>> { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) }, >>> { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) }, >>> { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, >>> + { HID_USB_DEVICE(USB_VENDOR_ID_PIXCIR, USB_DEVICE_ID_PIXCIR) }, >>> { } >>> }; >>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>> cat hid-ids.h.diff--- linux.orig/drivers/hid/hid-ids.h 2012-01-31 >>> 16:44:55.432001877 -0500 >>> +++ linux/drivers/hid/hid-ids.h 2012-01-31 16:47:36.624001858 -0500 >>> @@ -671,4 +671,7 @@ >>> #define USB_VENDOR_ID_ZYDACRON 0x13EC >>> #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 >>> >>> +#define USB_VENDOR_ID_PIXCIR 0x040b >>> +#define USB_DEVICE_ID_PIXCIR 0x2000 >>> + >>> #endif >>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>> _______________________________________________ >>> yocto mailing list >>> yocto@yoctoproject.org >>> https://lists.yoctoproject.org/listinfo/yocto >> >> >> >> -- >> "Thou shalt not follow the NULL pointer, for chaos and madness await >> thee at its end" >> >> >> _______________________________________________ >> yocto mailing list >> yocto@yoctoproject.org >> https://lists.yoctoproject.org/listinfo/yocto ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-06 20:24 ` Bruce Ashfield @ 2012-02-06 21:43 ` autif khan 2012-02-06 21:58 ` Bruce Ashfield 0 siblings, 1 reply; 17+ messages in thread From: autif khan @ 2012-02-06 21:43 UTC (permalink / raw) To: Bruce Ashfield; +Cc: yocto, Darren Hart >>>>>>> I could not find a way to patch the kernel source before its is >>>>>>> built. >>>>>>> >>>>>>> I promise to update the Yocto wiki's How do I section when I have a >>>>>>> working solution for the following :-) >>>>>> >>>>>> >>>>>> This should be covered in the existing documentation and also the >>>>>> more general bitbake/oe-core docs. >>>>>> >>>>>>> >>>>>>> Here is what I am trying to do: >>>>>>> >>>>>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>>>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>>>>> 2) Build the kernel - no change here - standard kernel build >>>>>>> 3) Build a kernel module >>>>>>> >>>>>>> I have a meta layer where I am keeping my changes. I am guessing that >>>>>>> I need to: >>>>>>> >>>>>>> a) write a bbappend file to accomplish #1 >>>>>>> b) write a recipe to accomplish #3 >>>>>>> >>>>>>> I have written recipes before, but just for libraries and autotools >>>>>>> based applications. Not for a kernel module. If there is a recipe out >>>>>>> there for some other module, I would be happy to steal from it. >>>>>>> >>>>>>> Please advise how I can go about patching the kernel and if there is >>>>>>> a >>>>>> >>>>>> >>>>>> It's just like any other package. If your changes are simple, then >>>>>> generating patches and putting them on the SRC_URI via a bbappend in >>>>>> your layer is all you need. If you have complex changes, there are >>>>>> options >>>>>> to manage them via git or via feature descriptions. >>>> >>>> >>>> I tried this - attached at the end of this email are my bbappend file >>>> and my patches, when the recipe is bitbaked, it does not actually >>>> apply the patch. >>>> >>>> On a similar note - there seems to be a file in >>>> meta/recipes-kernel/linux/linux-yocto called >>>> tools-perf-no-scripting.patch >>>> >>>> However, it does not seem to be used anywhere - is this just crud or I >>>> am missing something? I was hoping to cheat off of the recipe that >>>> uses it. >>>> >>>>>>> recipe for a kernel module - please point me to it. >>>>>> >>>>>> >>>>>> Darren validated and updated the kernel module example, so he'd >>>>>> probably >>>>>> got this closer at hand than I do. >>>>> >>>>> >>>>> See the hello-mod example under meta/recipes-kernel/hello-mod >>>> >>>> >>>> Thank you for this recipe - it seems like this is exactly what I was >>>> looking for. I will cheat off of this as soon as I can patch my >>>> kernel. >>>> >>>> >>>> R E C I P E >>>> >>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat >>>> linux-yocto_3.0.bbappend >>>> FILESEXTRAPATHS_prepend := "${THISDIR}:" >>>> SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ >>>> file://linux/drivers/hid/hid-ids.h.diff " >>>> PR = "r3" >>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >>>> >>>> P A T C H >>>> >>>> >>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>> >>> >>> Taking a look at this (while I was cutting and pasting), this should >>> be in in the >>> a 'linux-yocto' subdirectory if you want bitbake to pickup the patch and >>> make it >>> available to the linux-yocto recipe. >>> >>> i.e. >>> ~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux-yocto/drivers/hid >>> >>> And don't use 'linux-yocto' in your file:// reference on the SRC_URI, >>> that part is >>> automatic. >> >> >> I tried this just now - here is what happens: >> >> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >> file://drivers/hid/file.diff >> Result: Fetcher failure for URL: 'file://drivers/hid/hid-core.c.diff > > > If you get a fetcher failire, you have it in the wrong place. > > Note: this has nothing to do with the kernel and is a general > bitbake/oe-core question. > > >> >> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >> file://linux-yocto/drivers/hid/file.diff > > > Interesting. I've never had to specify linux-yocto in my SRC_URIs, > so something strange it going on here. > > Does anyone else have ideas here ? > > > >> Result - my diff files are copied in a directory called linux-yocto in >> >> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3 >> >> These patches are not applied in >> >> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3/linux >> >> Here is what the work directory looks like >> >> >> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >> ls >> git license-destdir linux linux-crownbay-standard-build linux-yocto >> temp >> >> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >> >> >> I have attached the original set of files as a tar gzip. > > > I'll take them for a spin. > > >> >>> (and yes, I see 'edison' was the branch now) >> >> >> Yes, I am using Yocto 1.0 - very soon I will migrate to M2 - pending >> tasks at hand :-) > > > I'll have to dig up a 1.0 tree, since I don't have anything of that > vintage available to me. > > But I know that patched worked then, and am absolutely sure that it > works in 1.1 and master. OK, I switched to M2 release and now, I have a different error: Case - diff files are in recipes/linux/linux-yocto, SRC_URI is file://drivers/hid/hid-core.c.diff Result - ERROR: Function 'Fetcher failure for URL: 'file://drivers/hid/hid-core.c.diff'. Unable to fetch URL file://drivers/hid/hid-core.c.diff from any source.' failed Did, I misunderstood you when you said that I should rename the files dir to linux-yocto - the name of the recipe and remove it from the SRC_URI? Will keep investigating and experimenting. > Cheers, > > Bruce > > >> >>> Cheers, >>> >>> Bruce >>> >>>> cat hid-core.c.diff >>>> --- linux.orig/drivers/hid/hid-core.c 2012-01-31 16:44:44.152001877 >>>> -0500 >>>> +++ linux/drivers/hid/hid-core.c 2012-01-31 16:46:34.608001870 >>>> -0500 >>>> @@ -1839,6 +1839,8 @@ >>>> { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, >>>> USB_DEVICE_ID_1_PHIDGETSERVO_20) }, >>>> { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, >>>> USB_DEVICE_ID_8_8_4_IF_KIT) }, >>>> { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, >>>> USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, >>>> + { HID_USB_DEVICE(USB_VENDOR_ID_PIXCIR, USB_DEVICE_ID_PIXCIR) }, >>>> { } >>>> }; >>>> >>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>> >>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>> cat hid-ids.h.diff--- linux.orig/drivers/hid/hid-ids.h 2012-01-31 >>>> 16:44:55.432001877 -0500 >>>> +++ linux/drivers/hid/hid-ids.h 2012-01-31 16:47:36.624001858 -0500 >>>> @@ -671,4 +671,7 @@ >>>> #define USB_VENDOR_ID_ZYDACRON 0x13EC >>>> #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 >>>> >>>> +#define USB_VENDOR_ID_PIXCIR 0x040b >>>> +#define USB_DEVICE_ID_PIXCIR 0x2000 >>>> + >>>> #endif >>>> >>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>> _______________________________________________ >>>> yocto mailing list >>>> yocto@yoctoproject.org >>>> https://lists.yoctoproject.org/listinfo/yocto >>> >>> >>> >>> >>> -- >>> "Thou shalt not follow the NULL pointer, for chaos and madness await >>> thee at its end" >>> >>> >>> _______________________________________________ >>> yocto mailing list >>> yocto@yoctoproject.org >>> https://lists.yoctoproject.org/listinfo/yocto > > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-06 21:43 ` autif khan @ 2012-02-06 21:58 ` Bruce Ashfield 2012-02-06 22:10 ` autif khan 0 siblings, 1 reply; 17+ messages in thread From: Bruce Ashfield @ 2012-02-06 21:58 UTC (permalink / raw) To: autif khan; +Cc: yocto, Darren Hart On 12-02-06 04:43 PM, autif khan wrote: >>>>>>>> I could not find a way to patch the kernel source before its is >>>>>>>> built. >>>>>>>> >>>>>>>> I promise to update the Yocto wiki's How do I section when I have a >>>>>>>> working solution for the following :-) >>>>>>> >>>>>>> >>>>>>> This should be covered in the existing documentation and also the >>>>>>> more general bitbake/oe-core docs. >>>>>>> >>>>>>>> >>>>>>>> Here is what I am trying to do: >>>>>>>> >>>>>>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>>>>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>>>>>> 2) Build the kernel - no change here - standard kernel build >>>>>>>> 3) Build a kernel module >>>>>>>> >>>>>>>> I have a meta layer where I am keeping my changes. I am guessing that >>>>>>>> I need to: >>>>>>>> >>>>>>>> a) write a bbappend file to accomplish #1 >>>>>>>> b) write a recipe to accomplish #3 >>>>>>>> >>>>>>>> I have written recipes before, but just for libraries and autotools >>>>>>>> based applications. Not for a kernel module. If there is a recipe out >>>>>>>> there for some other module, I would be happy to steal from it. >>>>>>>> >>>>>>>> Please advise how I can go about patching the kernel and if there is >>>>>>>> a >>>>>>> >>>>>>> >>>>>>> It's just like any other package. If your changes are simple, then >>>>>>> generating patches and putting them on the SRC_URI via a bbappend in >>>>>>> your layer is all you need. If you have complex changes, there are >>>>>>> options >>>>>>> to manage them via git or via feature descriptions. >>>>> >>>>> >>>>> I tried this - attached at the end of this email are my bbappend file >>>>> and my patches, when the recipe is bitbaked, it does not actually >>>>> apply the patch. >>>>> >>>>> On a similar note - there seems to be a file in >>>>> meta/recipes-kernel/linux/linux-yocto called >>>>> tools-perf-no-scripting.patch >>>>> >>>>> However, it does not seem to be used anywhere - is this just crud or I >>>>> am missing something? I was hoping to cheat off of the recipe that >>>>> uses it. >>>>> >>>>>>>> recipe for a kernel module - please point me to it. >>>>>>> >>>>>>> >>>>>>> Darren validated and updated the kernel module example, so he'd >>>>>>> probably >>>>>>> got this closer at hand than I do. >>>>>> >>>>>> >>>>>> See the hello-mod example under meta/recipes-kernel/hello-mod >>>>> >>>>> >>>>> Thank you for this recipe - it seems like this is exactly what I was >>>>> looking for. I will cheat off of this as soon as I can patch my >>>>> kernel. >>>>> >>>>> >>>>> R E C I P E >>>>> >>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat >>>>> linux-yocto_3.0.bbappend >>>>> FILESEXTRAPATHS_prepend := "${THISDIR}:" >>>>> SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ >>>>> file://linux/drivers/hid/hid-ids.h.diff " >>>>> PR = "r3" >>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >>>>> >>>>> P A T C H >>>>> >>>>> >>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>> >>>> >>>> Taking a look at this (while I was cutting and pasting), this should >>>> be in in the >>>> a 'linux-yocto' subdirectory if you want bitbake to pickup the patch and >>>> make it >>>> available to the linux-yocto recipe. >>>> >>>> i.e. >>>> ~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux-yocto/drivers/hid >>>> >>>> And don't use 'linux-yocto' in your file:// reference on the SRC_URI, >>>> that part is >>>> automatic. >>> >>> >>> I tried this just now - here is what happens: >>> >>> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >>> file://drivers/hid/file.diff >>> Result: Fetcher failure for URL: 'file://drivers/hid/hid-core.c.diff >> >> >> If you get a fetcher failire, you have it in the wrong place. >> >> Note: this has nothing to do with the kernel and is a general >> bitbake/oe-core question. >> >> >>> >>> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >>> file://linux-yocto/drivers/hid/file.diff >> >> >> Interesting. I've never had to specify linux-yocto in my SRC_URIs, >> so something strange it going on here. >> >> Does anyone else have ideas here ? >> >> >> >>> Result - my diff files are copied in a directory called linux-yocto in >>> >>> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3 >>> >>> These patches are not applied in >>> >>> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3/linux >>> >>> Here is what the work directory looks like >>> >>> >>> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >>> ls >>> git license-destdir linux linux-crownbay-standard-build linux-yocto >>> temp >>> >>> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >>> >>> >>> I have attached the original set of files as a tar gzip. >> >> >> I'll take them for a spin. >> >> >>> >>>> (and yes, I see 'edison' was the branch now) >>> >>> >>> Yes, I am using Yocto 1.0 - very soon I will migrate to M2 - pending >>> tasks at hand :-) >> >> >> I'll have to dig up a 1.0 tree, since I don't have anything of that >> vintage available to me. >> >> But I know that patched worked then, and am absolutely sure that it >> works in 1.1 and master. > > OK, I switched to M2 release and now, I have a different error: > > Case - diff files are in recipes/linux/linux-yocto, SRC_URI is > file://drivers/hid/hid-core.c.diff > Result - ERROR: Function 'Fetcher failure for URL: > 'file://drivers/hid/hid-core.c.diff'. Unable to fetch URL > file://drivers/hid/hid-core.c.diff from any source.' failed > > > Did, I misunderstood you when you said that I should rename the files > dir to linux-yocto - the name of the recipe and remove it from the > SRC_URI? Every build that I do with my meta-kernel-dev has some out of tree patches. It's a form of continual regression testing that I do out of habit. My bbappend looks like this: SRC_URI = "git://${KSRC_linux_yocto};protocol=file;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta \ file://make.patch \ file://subdir/make2.patch \ file://subdir/make3.patch" > pwd /home/bruce/yocto/poky-extras/meta-kernel-dev/recipes-kernel/linux > tree linux-yocto linux-yocto ├── make.patch └── subdir ├── make2.patch └── make3.patch These are always applied to my build. Cheers, Bruce > > Will keep investigating and experimenting. > >> Cheers, >> >> Bruce >> >> >>> >>>> Cheers, >>>> >>>> Bruce >>>> >>>>> cat hid-core.c.diff >>>>> --- linux.orig/drivers/hid/hid-core.c 2012-01-31 16:44:44.152001877 >>>>> -0500 >>>>> +++ linux/drivers/hid/hid-core.c 2012-01-31 16:46:34.608001870 >>>>> -0500 >>>>> @@ -1839,6 +1839,8 @@ >>>>> { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, >>>>> USB_DEVICE_ID_1_PHIDGETSERVO_20) }, >>>>> { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, >>>>> USB_DEVICE_ID_8_8_4_IF_KIT) }, >>>>> { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, >>>>> USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, >>>>> + { HID_USB_DEVICE(USB_VENDOR_ID_PIXCIR, USB_DEVICE_ID_PIXCIR) }, >>>>> { } >>>>> }; >>>>> >>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>>> >>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>>> cat hid-ids.h.diff--- linux.orig/drivers/hid/hid-ids.h 2012-01-31 >>>>> 16:44:55.432001877 -0500 >>>>> +++ linux/drivers/hid/hid-ids.h 2012-01-31 16:47:36.624001858 -0500 >>>>> @@ -671,4 +671,7 @@ >>>>> #define USB_VENDOR_ID_ZYDACRON 0x13EC >>>>> #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 >>>>> >>>>> +#define USB_VENDOR_ID_PIXCIR 0x040b >>>>> +#define USB_DEVICE_ID_PIXCIR 0x2000 >>>>> + >>>>> #endif >>>>> >>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>>> _______________________________________________ >>>>> yocto mailing list >>>>> yocto@yoctoproject.org >>>>> https://lists.yoctoproject.org/listinfo/yocto >>>> >>>> >>>> >>>> >>>> -- >>>> "Thou shalt not follow the NULL pointer, for chaos and madness await >>>> thee at its end" >>>> >>>> >>>> _______________________________________________ >>>> yocto mailing list >>>> yocto@yoctoproject.org >>>> https://lists.yoctoproject.org/listinfo/yocto >> >> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-06 21:58 ` Bruce Ashfield @ 2012-02-06 22:10 ` autif khan 2012-02-07 1:20 ` Bruce Ashfield 0 siblings, 1 reply; 17+ messages in thread From: autif khan @ 2012-02-06 22:10 UTC (permalink / raw) To: Bruce Ashfield; +Cc: yocto, Darren Hart [-- Attachment #1: Type: text/plain, Size: 7649 bytes --] \>>>>>>>>> I could not find a way to patch the kernel source before its is >>>>>>>>> built. >>>>>>>>> >>>>>>>>> I promise to update the Yocto wiki's How do I section when I have a >>>>>>>>> working solution for the following :-) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> This should be covered in the existing documentation and also the >>>>>>>> more general bitbake/oe-core docs. >>>>>>>> >>>>>>>>> >>>>>>>>> Here is what I am trying to do: >>>>>>>>> >>>>>>>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>>>>>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>>>>>>> 2) Build the kernel - no change here - standard kernel build >>>>>>>>> 3) Build a kernel module >>>>>>>>> >>>>>>>>> I have a meta layer where I am keeping my changes. I am guessing >>>>>>>>> that >>>>>>>>> I need to: >>>>>>>>> >>>>>>>>> a) write a bbappend file to accomplish #1 >>>>>>>>> b) write a recipe to accomplish #3 >>>>>>>>> >>>>>>>>> I have written recipes before, but just for libraries and autotools >>>>>>>>> based applications. Not for a kernel module. If there is a recipe >>>>>>>>> out >>>>>>>>> there for some other module, I would be happy to steal from it. >>>>>>>>> >>>>>>>>> Please advise how I can go about patching the kernel and if there >>>>>>>>> is >>>>>>>>> a >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> It's just like any other package. If your changes are simple, then >>>>>>>> generating patches and putting them on the SRC_URI via a bbappend in >>>>>>>> your layer is all you need. If you have complex changes, there are >>>>>>>> options >>>>>>>> to manage them via git or via feature descriptions. >>>>>> >>>>>> >>>>>> >>>>>> I tried this - attached at the end of this email are my bbappend file >>>>>> and my patches, when the recipe is bitbaked, it does not actually >>>>>> apply the patch. >>>>>> >>>>>> On a similar note - there seems to be a file in >>>>>> meta/recipes-kernel/linux/linux-yocto called >>>>>> tools-perf-no-scripting.patch >>>>>> >>>>>> However, it does not seem to be used anywhere - is this just crud or I >>>>>> am missing something? I was hoping to cheat off of the recipe that >>>>>> uses it. >>>>>> >>>>>>>>> recipe for a kernel module - please point me to it. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Darren validated and updated the kernel module example, so he'd >>>>>>>> probably >>>>>>>> got this closer at hand than I do. >>>>>>> >>>>>>> >>>>>>> >>>>>>> See the hello-mod example under meta/recipes-kernel/hello-mod >>>>>> >>>>>> >>>>>> >>>>>> Thank you for this recipe - it seems like this is exactly what I was >>>>>> looking for. I will cheat off of this as soon as I can patch my >>>>>> kernel. >>>>>> >>>>>> >>>>>> R E C I P E >>>>>> >>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat >>>>>> linux-yocto_3.0.bbappend >>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}:" >>>>>> SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ >>>>>> file://linux/drivers/hid/hid-ids.h.diff " >>>>>> PR = "r3" >>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >>>>>> >>>>>> P A T C H >>>>>> >>>>>> >>>>>> >>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>>> >>>>> >>>>> >>>>> Taking a look at this (while I was cutting and pasting), this should >>>>> be in in the >>>>> a 'linux-yocto' subdirectory if you want bitbake to pickup the patch >>>>> and >>>>> make it >>>>> available to the linux-yocto recipe. >>>>> >>>>> i.e. >>>>> >>>>> ~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux-yocto/drivers/hid >>>>> >>>>> And don't use 'linux-yocto' in your file:// reference on the SRC_URI, >>>>> that part is >>>>> automatic. >>>> >>>> >>>> >>>> I tried this just now - here is what happens: >>>> >>>> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >>>> file://drivers/hid/file.diff >>>> Result: Fetcher failure for URL: 'file://drivers/hid/hid-core.c.diff >>> >>> >>> >>> If you get a fetcher failire, you have it in the wrong place. >>> >>> Note: this has nothing to do with the kernel and is a general >>> bitbake/oe-core question. >>> >>> >>>> >>>> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >>>> file://linux-yocto/drivers/hid/file.diff >>> >>> >>> >>> Interesting. I've never had to specify linux-yocto in my SRC_URIs, >>> so something strange it going on here. >>> >>> Does anyone else have ideas here ? >>> >>> >>> >>>> Result - my diff files are copied in a directory called linux-yocto in >>>> >>>> >>>> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3 >>>> >>>> These patches are not applied in >>>> >>>> >>>> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3/linux >>>> >>>> Here is what the work directory looks like >>>> >>>> >>>> >>>> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >>>> ls >>>> git license-destdir linux linux-crownbay-standard-build linux-yocto >>>> temp >>>> >>>> >>>> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >>>> >>>> >>>> I have attached the original set of files as a tar gzip. >>> >>> >>> >>> I'll take them for a spin. >>> >>> >>>> >>>>> (and yes, I see 'edison' was the branch now) >>>> >>>> >>>> >>>> Yes, I am using Yocto 1.0 - very soon I will migrate to M2 - pending >>>> tasks at hand :-) >>> >>> >>> >>> I'll have to dig up a 1.0 tree, since I don't have anything of that >>> vintage available to me. >>> >>> But I know that patched worked then, and am absolutely sure that it >>> works in 1.1 and master. >> >> >> OK, I switched to M2 release and now, I have a different error: >> >> Case - diff files are in recipes/linux/linux-yocto, SRC_URI is >> file://drivers/hid/hid-core.c.diff >> Result - ERROR: Function 'Fetcher failure for URL: >> 'file://drivers/hid/hid-core.c.diff'. Unable to fetch URL >> file://drivers/hid/hid-core.c.diff from any source.' failed >> >> >> Did, I misunderstood you when you said that I should rename the files >> dir to linux-yocto - the name of the recipe and remove it from the >> SRC_URI? > > > Every build that I do with my meta-kernel-dev has some out of tree > patches. It's a form of continual regression testing that I do out > of habit. > > My bbappend looks like this: > > SRC_URI = > "git://${KSRC_linux_yocto};protocol=file;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta > \ > file://make.patch \ > file://subdir/make2.patch \ > file://subdir/make3.patch" > > >> pwd > /home/bruce/yocto/poky-extras/meta-kernel-dev/recipes-kernel/linux >> tree linux-yocto > linux-yocto > ├── make.patch > └── subdir > ├── make2.patch > └── make3.patch > > These are always applied to my build. > > Cheers, > > Bruce > I will try that next. However, it seems like something is wrong with my setup may be. I was reading the log.do_patch file and it seems like bitbake is mixing my build and recipes directory. The recipe and logs are attached in this email. Once again, I have switched to M2 now. This is no longer with Yocto 1.0. [-- Attachment #2: cant_patch_kernel.tar.gz --] [-- Type: application/x-gzip, Size: 6763 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-06 22:10 ` autif khan @ 2012-02-07 1:20 ` Bruce Ashfield 2012-02-07 1:28 ` Bruce Ashfield 0 siblings, 1 reply; 17+ messages in thread From: Bruce Ashfield @ 2012-02-07 1:20 UTC (permalink / raw) To: autif khan; +Cc: yocto, Darren Hart On 12-02-06 5:10 PM, autif khan wrote: > \>>>>>>>>> I could not find a way to patch the kernel source before its is >>>>>>>>>> built. >>>>>>>>>> >>>>>>>>>> I promise to update the Yocto wiki's How do I section when I have a >>>>>>>>>> working solution for the following :-) >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> This should be covered in the existing documentation and also the >>>>>>>>> more general bitbake/oe-core docs. >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Here is what I am trying to do: >>>>>>>>>> >>>>>>>>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>>>>>>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>>>>>>>> 2) Build the kernel - no change here - standard kernel build >>>>>>>>>> 3) Build a kernel module >>>>>>>>>> >>>>>>>>>> I have a meta layer where I am keeping my changes. I am guessing >>>>>>>>>> that >>>>>>>>>> I need to: >>>>>>>>>> >>>>>>>>>> a) write a bbappend file to accomplish #1 >>>>>>>>>> b) write a recipe to accomplish #3 >>>>>>>>>> >>>>>>>>>> I have written recipes before, but just for libraries and autotools >>>>>>>>>> based applications. Not for a kernel module. If there is a recipe >>>>>>>>>> out >>>>>>>>>> there for some other module, I would be happy to steal from it. >>>>>>>>>> >>>>>>>>>> Please advise how I can go about patching the kernel and if there >>>>>>>>>> is >>>>>>>>>> a >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> It's just like any other package. If your changes are simple, then >>>>>>>>> generating patches and putting them on the SRC_URI via a bbappend in >>>>>>>>> your layer is all you need. If you have complex changes, there are >>>>>>>>> options >>>>>>>>> to manage them via git or via feature descriptions. >>>>>>> >>>>>>> >>>>>>> >>>>>>> I tried this - attached at the end of this email are my bbappend file >>>>>>> and my patches, when the recipe is bitbaked, it does not actually >>>>>>> apply the patch. >>>>>>> >>>>>>> On a similar note - there seems to be a file in >>>>>>> meta/recipes-kernel/linux/linux-yocto called >>>>>>> tools-perf-no-scripting.patch >>>>>>> >>>>>>> However, it does not seem to be used anywhere - is this just crud or I >>>>>>> am missing something? I was hoping to cheat off of the recipe that >>>>>>> uses it. >>>>>>> >>>>>>>>>> recipe for a kernel module - please point me to it. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Darren validated and updated the kernel module example, so he'd >>>>>>>>> probably >>>>>>>>> got this closer at hand than I do. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> See the hello-mod example under meta/recipes-kernel/hello-mod >>>>>>> >>>>>>> >>>>>>> >>>>>>> Thank you for this recipe - it seems like this is exactly what I was >>>>>>> looking for. I will cheat off of this as soon as I can patch my >>>>>>> kernel. >>>>>>> >>>>>>> >>>>>>> R E C I P E >>>>>>> >>>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ cat >>>>>>> linux-yocto_3.0.bbappend >>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}:" >>>>>>> SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ >>>>>>> file://linux/drivers/hid/hid-ids.h.diff " >>>>>>> PR = "r3" >>>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >>>>>>> >>>>>>> P A T C H >>>>>>> >>>>>>> >>>>>>> >>>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>>>> >>>>>> >>>>>> >>>>>> Taking a look at this (while I was cutting and pasting), this should >>>>>> be in in the >>>>>> a 'linux-yocto' subdirectory if you want bitbake to pickup the patch >>>>>> and >>>>>> make it >>>>>> available to the linux-yocto recipe. >>>>>> >>>>>> i.e. >>>>>> >>>>>> ~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux-yocto/drivers/hid >>>>>> >>>>>> And don't use 'linux-yocto' in your file:// reference on the SRC_URI, >>>>>> that part is >>>>>> automatic. >>>>> >>>>> >>>>> >>>>> I tried this just now - here is what happens: >>>>> >>>>> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >>>>> file://drivers/hid/file.diff >>>>> Result: Fetcher failure for URL: 'file://drivers/hid/hid-core.c.diff >>>> >>>> >>>> >>>> If you get a fetcher failire, you have it in the wrong place. >>>> >>>> Note: this has nothing to do with the kernel and is a general >>>> bitbake/oe-core question. >>>> >>>> >>>>> >>>>> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >>>>> file://linux-yocto/drivers/hid/file.diff >>>> >>>> >>>> >>>> Interesting. I've never had to specify linux-yocto in my SRC_URIs, >>>> so something strange it going on here. >>>> >>>> Does anyone else have ideas here ? >>>> >>>> >>>> >>>>> Result - my diff files are copied in a directory called linux-yocto in >>>>> >>>>> >>>>> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3 >>>>> >>>>> These patches are not applied in >>>>> >>>>> >>>>> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3/linux >>>>> >>>>> Here is what the work directory looks like >>>>> >>>>> >>>>> >>>>> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >>>>> ls >>>>> git license-destdir linux linux-crownbay-standard-build linux-yocto >>>>> temp >>>>> >>>>> >>>>> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >>>>> >>>>> >>>>> I have attached the original set of files as a tar gzip. >>>> >>>> >>>> >>>> I'll take them for a spin. >>>> >>>> >>>>> >>>>>> (and yes, I see 'edison' was the branch now) >>>>> >>>>> >>>>> >>>>> Yes, I am using Yocto 1.0 - very soon I will migrate to M2 - pending >>>>> tasks at hand :-) >>>> >>>> >>>> >>>> I'll have to dig up a 1.0 tree, since I don't have anything of that >>>> vintage available to me. >>>> >>>> But I know that patched worked then, and am absolutely sure that it >>>> works in 1.1 and master. >>> >>> >>> OK, I switched to M2 release and now, I have a different error: >>> >>> Case - diff files are in recipes/linux/linux-yocto, SRC_URI is >>> file://drivers/hid/hid-core.c.diff >>> Result - ERROR: Function 'Fetcher failure for URL: >>> 'file://drivers/hid/hid-core.c.diff'. Unable to fetch URL >>> file://drivers/hid/hid-core.c.diff from any source.' failed >>> >>> >>> Did, I misunderstood you when you said that I should rename the files >>> dir to linux-yocto - the name of the recipe and remove it from the >>> SRC_URI? >> >> >> Every build that I do with my meta-kernel-dev has some out of tree >> patches. It's a form of continual regression testing that I do out >> of habit. >> >> My bbappend looks like this: >> >> SRC_URI = >> "git://${KSRC_linux_yocto};protocol=file;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta >> \ >> file://make.patch \ >> file://subdir/make2.patch \ >> file://subdir/make3.patch" >> >> >>> pwd >> /home/bruce/yocto/poky-extras/meta-kernel-dev/recipes-kernel/linux >>> tree linux-yocto >> linux-yocto >> ├── make.patch >> └── subdir >> ├── make2.patch >> └── make3.patch >> >> These are always applied to my build. >> >> Cheers, >> >> Bruce >> > > I will try that next. However, it seems like something is wrong with > my setup may be. > > I was reading the log.do_patch file and it seems like bitbake is > mixing my build and recipes directory. Thanks! I'll run some tests here and see what I can find. Cheers, Bruce > > The recipe and logs are attached in this email. Once again, I have > switched to M2 now. This is no longer with Yocto 1.0. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-07 1:20 ` Bruce Ashfield @ 2012-02-07 1:28 ` Bruce Ashfield 2012-02-07 19:01 ` autif khan 0 siblings, 1 reply; 17+ messages in thread From: Bruce Ashfield @ 2012-02-07 1:28 UTC (permalink / raw) To: autif khan; +Cc: yocto, Darren Hart On 12-02-06 8:20 PM, Bruce Ashfield wrote: > On 12-02-06 5:10 PM, autif khan wrote: >> \>>>>>>>>> I could not find a way to patch the kernel source before >> its is >>>>>>>>>>> built. >>>>>>>>>>> >>>>>>>>>>> I promise to update the Yocto wiki's How do I section when I >>>>>>>>>>> have a >>>>>>>>>>> working solution for the following :-) >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> This should be covered in the existing documentation and also the >>>>>>>>>> more general bitbake/oe-core docs. >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Here is what I am trying to do: >>>>>>>>>>> >>>>>>>>>>> 1) Patch the kernel (add VID/PID to hid_ignore_list in >>>>>>>>>>> drivers/hid/hid-core.c and also to add the VID/PID to .h file) >>>>>>>>>>> 2) Build the kernel - no change here - standard kernel build >>>>>>>>>>> 3) Build a kernel module >>>>>>>>>>> >>>>>>>>>>> I have a meta layer where I am keeping my changes. I am guessing >>>>>>>>>>> that >>>>>>>>>>> I need to: >>>>>>>>>>> >>>>>>>>>>> a) write a bbappend file to accomplish #1 >>>>>>>>>>> b) write a recipe to accomplish #3 >>>>>>>>>>> >>>>>>>>>>> I have written recipes before, but just for libraries and >>>>>>>>>>> autotools >>>>>>>>>>> based applications. Not for a kernel module. If there is a >>>>>>>>>>> recipe >>>>>>>>>>> out >>>>>>>>>>> there for some other module, I would be happy to steal from it. >>>>>>>>>>> >>>>>>>>>>> Please advise how I can go about patching the kernel and if >>>>>>>>>>> there >>>>>>>>>>> is >>>>>>>>>>> a >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> It's just like any other package. If your changes are simple, >>>>>>>>>> then >>>>>>>>>> generating patches and putting them on the SRC_URI via a >>>>>>>>>> bbappend in >>>>>>>>>> your layer is all you need. If you have complex changes, there >>>>>>>>>> are >>>>>>>>>> options >>>>>>>>>> to manage them via git or via feature descriptions. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> I tried this - attached at the end of this email are my bbappend >>>>>>>> file >>>>>>>> and my patches, when the recipe is bitbaked, it does not actually >>>>>>>> apply the patch. >>>>>>>> >>>>>>>> On a similar note - there seems to be a file in >>>>>>>> meta/recipes-kernel/linux/linux-yocto called >>>>>>>> tools-perf-no-scripting.patch >>>>>>>> >>>>>>>> However, it does not seem to be used anywhere - is this just >>>>>>>> crud or I >>>>>>>> am missing something? I was hoping to cheat off of the recipe that >>>>>>>> uses it. >>>>>>>> >>>>>>>>>>> recipe for a kernel module - please point me to it. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Darren validated and updated the kernel module example, so he'd >>>>>>>>>> probably >>>>>>>>>> got this closer at hand than I do. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> See the hello-mod example under meta/recipes-kernel/hello-mod >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Thank you for this recipe - it seems like this is exactly what I >>>>>>>> was >>>>>>>> looking for. I will cheat off of this as soon as I can patch my >>>>>>>> kernel. >>>>>>>> >>>>>>>> >>>>>>>> R E C I P E >>>>>>>> >>>>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >>>>>>>> cat >>>>>>>> linux-yocto_3.0.bbappend >>>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}:" >>>>>>>> SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ >>>>>>>> file://linux/drivers/hid/hid-ids.h.diff " >>>>>>>> PR = "r3" >>>>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >>>>>>>> >>>>>>>> P A T C H >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux/drivers/hid$ >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Taking a look at this (while I was cutting and pasting), this should >>>>>>> be in in the >>>>>>> a 'linux-yocto' subdirectory if you want bitbake to pickup the patch >>>>>>> and >>>>>>> make it >>>>>>> available to the linux-yocto recipe. >>>>>>> >>>>>>> i.e. >>>>>>> >>>>>>> ~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux/linux-yocto/drivers/hid >>>>>>> >>>>>>> >>>>>>> And don't use 'linux-yocto' in your file:// reference on the >>>>>>> SRC_URI, >>>>>>> that part is >>>>>>> automatic. >>>>>> >>>>>> >>>>>> >>>>>> I tried this just now - here is what happens: >>>>>> >>>>>> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >>>>>> file://drivers/hid/file.diff >>>>>> Result: Fetcher failure for URL: 'file://drivers/hid/hid-core.c.diff >>>>> >>>>> >>>>> >>>>> If you get a fetcher failire, you have it in the wrong place. >>>>> >>>>> Note: this has nothing to do with the kernel and is a general >>>>> bitbake/oe-core question. >>>>> >>>>> >>>>>> >>>>>> Case - patch is in linux/linux-yocto/drivers/hid, SRC_URI ref is >>>>>> file://linux-yocto/drivers/hid/file.diff >>>>> >>>>> >>>>> >>>>> Interesting. I've never had to specify linux-yocto in my SRC_URIs, >>>>> so something strange it going on here. >>>>> >>>>> Does anyone else have ideas here ? >>>>> >>>>> >>>>> >>>>>> Result - my diff files are copied in a directory called >>>>>> linux-yocto in >>>>>> >>>>>> >>>>>> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3 >>>>>> >>>>>> >>>>>> These patches are not applied in >>>>>> >>>>>> >>>>>> tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3/linux >>>>>> >>>>>> >>>>>> Here is what the work directory looks like >>>>>> >>>>>> >>>>>> >>>>>> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >>>>>> >>>>>> ls >>>>>> git license-destdir linux linux-crownbay-standard-build linux-yocto >>>>>> temp >>>>>> >>>>>> >>>>>> autif@fpbm:~/ssd/minimal/tmp/work/crownbay-poky-linux/linux-yocto-3.0.4+git1+d05450e4aef02c1b7137398ab3a9f8f96da74f52_1+2247da9131ea7e46ed4766a69bb1353dba22f873-r3$ >>>>>> >>>>>> >>>>>> >>>>>> I have attached the original set of files as a tar gzip. >>>>> >>>>> >>>>> >>>>> I'll take them for a spin. >>>>> >>>>> >>>>>> >>>>>>> (and yes, I see 'edison' was the branch now) >>>>>> >>>>>> >>>>>> >>>>>> Yes, I am using Yocto 1.0 - very soon I will migrate to M2 - pending >>>>>> tasks at hand :-) >>>>> >>>>> >>>>> >>>>> I'll have to dig up a 1.0 tree, since I don't have anything of that >>>>> vintage available to me. >>>>> >>>>> But I know that patched worked then, and am absolutely sure that it >>>>> works in 1.1 and master. >>>> >>>> >>>> OK, I switched to M2 release and now, I have a different error: >>>> >>>> Case - diff files are in recipes/linux/linux-yocto, SRC_URI is >>>> file://drivers/hid/hid-core.c.diff >>>> Result - ERROR: Function 'Fetcher failure for URL: >>>> 'file://drivers/hid/hid-core.c.diff'. Unable to fetch URL >>>> file://drivers/hid/hid-core.c.diff from any source.' failed >>>> >>>> >>>> Did, I misunderstood you when you said that I should rename the files >>>> dir to linux-yocto - the name of the recipe and remove it from the >>>> SRC_URI? >>> >>> >>> Every build that I do with my meta-kernel-dev has some out of tree >>> patches. It's a form of continual regression testing that I do out >>> of habit. >>> >>> My bbappend looks like this: >>> >>> SRC_URI = >>> "git://${KSRC_linux_yocto};protocol=file;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta >>> >>> \ >>> file://make.patch \ >>> file://subdir/make2.patch \ >>> file://subdir/make3.patch" >>> >>> >>>> pwd >>> /home/bruce/yocto/poky-extras/meta-kernel-dev/recipes-kernel/linux >>>> tree linux-yocto >>> linux-yocto >>> ├── make.patch >>> └── subdir >>> ├── make2.patch >>> └── make3.patch >>> >>> These are always applied to my build. >>> >>> Cheers, >>> >>> Bruce >>> >> >> I will try that next. However, it seems like something is wrong with >> my setup may be. >> >> I was reading the log.do_patch file and it seems like bitbake is >> mixing my build and recipes directory. > > Thanks! I'll run some tests here and see what I can find. A quick look at the patches themselves shows them to not be valid kernel patches. The files don't have the right sub-path, so there's no way you'll ever patch the kernel with these changes. My suggestion is to make the changes, commit them to your local tree (with a commit header) and then git format-patch them out. Use that patch in your bbappend. i.e. you have: --- hid-ids.h.orig 2012-02-06 16:54:56.056357248 -0500 +++ hid-ids.h 2012-02-06 16:55:15.888365151 -0500 that needs to be something like: --- a/drivers/hid/hid-ids.h.orig 2012-02-06 16:54:56.056357248 -0500 +++ b/drivers/hid/hid-ids.h 2012-02-06 16:55:15.888365151 -0500 before it every will have a chance to work. To make the patches attempt to apply .. and fail, I did added this to my linux-yocto_3.0.bbappend: + +SRC_URI += " file://drivers/hid/hid-core.c.diff \ + file://drivers/hid/hid-ids.h.diff" and put the patches in: > tree linux-yocto linux-yocto ├── drivers │ └── hid │ ├── hid-core.c.diff │ └── hid-ids.h.diff Cheers, Bruce > > Cheers, > > Bruce > >> >> The recipe and logs are attached in this email. Once again, I have >> switched to M2 now. This is no longer with Yocto 1.0. > > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-07 1:28 ` Bruce Ashfield @ 2012-02-07 19:01 ` autif khan 0 siblings, 0 replies; 17+ messages in thread From: autif khan @ 2012-02-07 19:01 UTC (permalink / raw) To: Bruce Ashfield; +Cc: yocto, Darren Hart >>>>>>>>> R E C I P E >>>>>>>>> >>>>>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ >>>>>>>>> cat >>>>>>>>> linux-yocto_3.0.bbappend >>>>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}:" >>>>>>>>> SRC_URI += " file://linux/drivers/hid/hid-core.c.diff \ >>>>>>>>> file://linux/drivers/hid/hid-ids.h.diff " >>>>>>>>> PR = "r3" >>>>>>>>> autif@fpbm:~/data/yocto/poky-edison-6.0/meta-koko/recipes/linux$ Fond the bug - it was a problem in the recipe FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" I was missing the ${PN} at the end. Bruce - Thank you for all the help :-) ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-01-31 16:54 ` Darren Hart 2012-02-06 19:35 ` autif khan @ 2012-02-08 15:31 ` autif khan 2012-02-09 14:39 ` Darren Hart 1 sibling, 1 reply; 17+ messages in thread From: autif khan @ 2012-02-08 15:31 UTC (permalink / raw) To: Darren Hart; +Cc: yocto >>> I have a meta layer where I am keeping my changes. I am guessing that I need to: >>> >>> a) write a bbappend file to accomplish #1 >>> b) write a recipe to accomplish #3 >>> >>> I have written recipes before, but just for libraries and autotools >>> based applications. Not for a kernel module. If there is a recipe out >>> there for some other module, I would be happy to steal from it. >>> >>> Please advise how I can go about patching the kernel and if there is a >> >> It's just like any other package. If your changes are simple, then >> generating patches and putting them on the SRC_URI via a bbappend in >> your layer is all you need. If you have complex changes, there are options >> to manage them via git or via feature descriptions. >> >>> recipe for a kernel module - please point me to it. >> >> Darren validated and updated the kernel module example, so he'd probably >> got this closer at hand than I do. > > See the hello-mod example under meta/recipes-kernel/hello-mod Now, I want to load my module at startup. The preferred way to load my module at startup would be by to place a file called hello-mod in /etc/modutils Is this correct? Is there a recipe already that does this? I see this line in kernel.bbclass - module_autoload_ipv6 = "ipv6" So will appending module_autoload_hello-mod = "hello-mod" to this class achieve this? I know how to append a recipe, but how do I append a class? When I boot my device it seems like minix and ipv6 modules are loaded, but I can not follow how they are loaded. Seems like ipv6 is in /etc/modutils, but minix is not. minix is in /etc/filesystems - but I am not sure what role that file plays Last but, not the least - was this documented somewhere and I just could not/did not find it? Should I add this to the "How do I ..." section of the wiki? Thanks Autif ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: How do I patch the kernel before it is built? 2012-02-08 15:31 ` autif khan @ 2012-02-09 14:39 ` Darren Hart 0 siblings, 0 replies; 17+ messages in thread From: Darren Hart @ 2012-02-09 14:39 UTC (permalink / raw) To: autif khan; +Cc: yocto Autif, All good questions. I'm traveling right now and don't know the answers off the top of my head. I'd try module_autoload and see if that does what you want. I'll be back briefly next week and then off to ELC. I should be able to assist next week though if you don't resolve this on your own. I don't believe this is documented. We need to resolve that. The "how do I" is a reasonable start, but ultimately it needs to be in some combination of the BSP Guide, the Kernel Arch manual, and the Developers Manual. -- Darren On 02/08/2012 07:31 AM, autif khan wrote: >>>> I have a meta layer where I am keeping my changes. I am guessing that I need to: >>>> >>>> a) write a bbappend file to accomplish #1 >>>> b) write a recipe to accomplish #3 >>>> >>>> I have written recipes before, but just for libraries and autotools >>>> based applications. Not for a kernel module. If there is a recipe out >>>> there for some other module, I would be happy to steal from it. >>>> >>>> Please advise how I can go about patching the kernel and if there is a >>> >>> It's just like any other package. If your changes are simple, then >>> generating patches and putting them on the SRC_URI via a bbappend in >>> your layer is all you need. If you have complex changes, there are options >>> to manage them via git or via feature descriptions. >>> >>>> recipe for a kernel module - please point me to it. >>> >>> Darren validated and updated the kernel module example, so he'd probably >>> got this closer at hand than I do. >> >> See the hello-mod example under meta/recipes-kernel/hello-mod > > Now, I want to load my module at startup. > > The preferred way to load my module at startup would be by to place a > file called hello-mod in /etc/modutils > > Is this correct? > > Is there a recipe already that does this? > > I see this line in kernel.bbclass - module_autoload_ipv6 = "ipv6" > > So will appending module_autoload_hello-mod = "hello-mod" to this > class achieve this? I know how to append a recipe, but how do I append > a class? > > When I boot my device it seems like minix and ipv6 modules are loaded, > but I can not follow how they are loaded. > > Seems like ipv6 is in /etc/modutils, but minix is not. > > minix is in /etc/filesystems - but I am not sure what role that file plays > > Last but, not the least - was this documented somewhere and I just > could not/did not find it? Should I add this to the "How do I ..." > section of the wiki? > > Thanks > > Autif -- Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2012-02-09 14:40 UTC | newest] Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-01-31 16:45 How do I patch the kernel before it is built? autif khan 2012-01-31 16:51 ` Joshua Lock 2012-01-31 16:51 ` Bruce Ashfield 2012-01-31 16:54 ` Darren Hart 2012-02-06 19:35 ` autif khan 2012-02-06 19:39 ` Bruce Ashfield 2012-02-06 19:46 ` Bruce Ashfield 2012-02-06 20:18 ` autif khan 2012-02-06 20:24 ` Bruce Ashfield 2012-02-06 21:43 ` autif khan 2012-02-06 21:58 ` Bruce Ashfield 2012-02-06 22:10 ` autif khan 2012-02-07 1:20 ` Bruce Ashfield 2012-02-07 1:28 ` Bruce Ashfield 2012-02-07 19:01 ` autif khan 2012-02-08 15:31 ` autif khan 2012-02-09 14:39 ` Darren Hart
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.