How to create and apply a kernel patch for OpenWrt 18?

I am trying to write a new patch for the 4.14 kernel in OpenWRT using quilt and the instructions here.

I use the following process.

  1. make target/linux/{clean,prepare} V=s QUILT=1

  2. cd build_dir/target-*/linux-*/linux-4.14*

  3. quilt new generic/000-patch-name.patch

  4. quilt edit <files>

  5. quilt series to confirm that my patch is there.

  6. cd into the top level directory.

  7. make target/linux/{clean,prepare} V=s QUILT=1

In step 7, I have also tried it without the QUILT= option which shows me all the patches applied but mine is not there.

Is there anything I'm missing to apply my patch.

Any help would be appreciated.

You forgot quilt refresh after step 4 and make target/linux/update after step 6.

1 Like


I think that has worked.

I cannot seem to find my patch being applied in the command line output, but I can see it when I do quilt series after step 7 and it is in the patches directory.

Hello, and then how did you apply the patch?

I did the same thing on points, added steps that Jow indicated.

The patch is in the quilt series

Physically on the disk, he appeared in :

/build_dir/target-/linux-ar71xx -/linux-4.9.119/patches/generic



but if run make -j8 V=s

after assembly in the catalog build_dir/target-/linux-/backports-2017-11-01 unchanged file

After step 7, run make target/linux/{compile,install} QUILT=1 V=s to compile the kernel which will add your patches.

Then after that is when you can compile everything using make -j8 V=s.

I did everything again and after step 7 I added
make target / linux / {compile, install} QUILT = 1 V = s


make -j8 V = s

The result is the same

And how to understand that the patch has been applied? Maybe all is well...

Hi ! Thank you very mach! Everything worked out. I will write here, suddenly someone will help.

make package/kernel/mac80211/{clean,prepare} V=s QUILT=1

cd build_dir/target-mips_24kc_musl/linux-ar71xx_generic/backports-2017-11-01/

quilt series

quilt push -a

quilt new 401-fix_jump.patch

quilt edit drivers/net/wireless/ath/ath9k/init.c

quilt refresh

cd ../../../../

make package/kernel/mac80211/update V=s

make package/kernel/mac80211/{clean,compile} package/index V=s

make -j8 V=s


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.