OpenWrt Forum Archive

Topic: [solved] question about creating/applying the kernel patch.

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have some questions about creating/applying the kernel patch.
I read the wiki article here.
I tried to make some kernel patch myself. here's what i did;

1. make target/linux/{clean,prepare} V=s QUILT=1
2. cd build_dir/the/path/to/my/kernel/
3. quilt push -a

File series fully applied, ends at patch xxxx-some-description.patch

4. quilt new 0223-test-kernel-patch.patch # this is the patch i want to create.
5. quilt edit xxxx.h # made some change
6. quilt diff # patch content displayed as i expected
7. quilt refresh

so far so good, now i can find my patch at:
build_dir/the/path/to/my/kernel/patches/0223-test-kernel-patch.patch

in the wiki page:

Moving the changes back over to the buildroot tree from the build tree is done with:
        make target/linux/update package/index V=s

what's "package/index" for?
anyway I did what wiki said, but the patch did not show up under target/linux folder.
did i make some mistakes here?

in the wiki, it also said

Patches should be named with the correct prefix, platform/000-abc.patch or generic/000-abc.patch. If not the update may not work correctly.

I don't understand it. all the existing patches are named like xxxx-some-description.patch .
how could i name my patch to indicate it belongs to a platform, or generic ?

(Last edited by nossiac on 31 Oct 2013, 08:11)

When you create a new kernel patch with "quilt new" you have to specify a subdir, e.g.

quilt new generic/900-local-modifications.patch

or

quilt new platform/990-add-new-board.patch

Haha! thanks, jow.

about this statement,

Moving the changes back over to the buildroot tree from the build tree is done with:
        make target/linux/update package/index V=sso if i got a patch

what's the proper way to move all patches from build_dir back to source_tree. copy it, or do as the wiki said?

"make target/linux/update" will work properly once you include the subdir in the quilt new command. The reason why it failed before is because your patch was neither in generic/ nor in platform/ so it was silently discarded.

@jow

yes. it works! thank you.
the whole openwrt thing is full of magic. digging, digging. digging.....

Hello!

I would like to patch Openwrt and followed these instructions but it didn't work for my case. I have an existing kernel patch downloaded from the internet (trusted and valid source) and I would like to try and apply it on Openwrt. My problem begins on step 4 of the above mentioned procedure. How can I add an already existing patch (I do not want to edit it, neither write is on myself) to the platform patches of Openwrt? The existist patch has the name xyzw-descrioption.patch. I suppose I have to use quilt new platform/xyzw-descrioption.patch but I do not know how should I proceed.  Any instructions would be useful. Thanks

tbird wrote:

How can I add an already existing patch (I do not want to edit it, neither write is on myself) to the platform patches of Openwrt? The existist patch has the name xyzw-descrioption.patch.

After you got the OpenWRT sources (e.g. with "git clone git://git.openwrt.org/14.07/openwrt.git") you just have to copy the patch into the right directory (e.g. "target/linux/ar71xx/patches-3.10/") and run then make.
Make will automatically apply all the patches in the directory.

The discussion might have continued from here.