OpenWrt Forum Archive

Topic: I want to modify the kernel source then be able to create patches

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

I start with a fresh tree from trunk and follow the instructions here http://wiki.openwrt.org/doc/devel/patches

i do

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

the menuconfig opens.

i select bcm63xx for target system and save, kernel extracts, patches apply but then:

Now at patch platform/440-new_96348gw-11_leds.patch
touch "/home/ant/openwrt/trunk/build_dir/linux-brcm63xx/linux-2.6.35.9/.quilt_checked"
/home/ant/openwrt/trunk/scripts/kconfig.pl + /home/ant/openwrt/trunk/target/linux/generic/config-2.6.35 /home/ant/openwrt/trunk/target/linux/brcm63xx/config-2.6.35 > /home/ant/openwrt/trunk/build_dir/linux-brcm63xx/linux-2.6.35.9/.config.target
awk '/^(#[[:space:]]+)?CONFIG_KERNEL/{sub("CONFIG_KERNEL_","CONFIG_");print}' /home/ant/openwrt/trunk/.config >> /home/ant/openwrt/trunk/build_dir/linux-brcm63xx/linux-2.6.35.9/.config.target
echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> /home/ant/openwrt/trunk/build_dir/linux-brcm63xx/linux-2.6.35.9/.config.target
echo "# CONFIG_KALLSYMS_ALL is not set" >> /home/ant/openwrt/trunk/build_dir/linux-brcm63xx/linux-2.6.35.9/.config.target
echo "# CONFIG_KPROBES is not set" >> /home/ant/openwrt/trunk/build_dir/linux-brcm63xx/linux-2.6.35.9/.config.target
/home/ant/openwrt/trunk/staging_dir/host/bin/sed -i -e 's,.*CONFIG_AEABI.*,# CONFIG_AEABI is not set,' /home/ant/openwrt/trunk/build_dir/linux-brcm63xx/linux-2.6.35.9/.config.target
bash: /home/ant/openwrt/trunk/staging_dir/host/bin/sed: No such file or directory
make[3]: *** [/home/ant/openwrt/trunk/build_dir/linux-brcm63xx/linux-2.6.35.9/.configured] Error 127
make[3]: Leaving directory `/home/ant/openwrt/trunk/target/linux/brcm63xx'
make[2]: *** [prepare] Error 2
make[2]: Leaving directory `/home/ant/openwrt/trunk/target/linux'
make[1]: *** [target/linux/prepare] Error 2
make[1]: Leaving directory `/home/ant/openwrt/trunk'
make: *** [target/linux/prepare] Error 2

/home/ant/openwrt/trunk/staging_dir/host/bin/sed is missing. I assume it has to be built or can i link it to my systems sed?  Is this a bug or am i not doing it right?
I have used quilt to make an openwrt patch before only difference is that i was experimenting, basically build test modify so i never tried to start from a proper clean tree.

Are you attempting to build a new kernel patch ?
this is mywork flow.

1. I build normal openwrt image for vmware.
2. then I go to build_dir look there for kernel folder.
3. I open it in understand (its one reverse engineering tool I like) its commercial but trial license too should work fine. There are couple more of tools I use..
4. I edit code directly the the build dir tree.............. recompile without doing make clean
5. advantage is.. patches are applies only when the package is extracted from kernel source  so.. i can get some speed bum while simulation full compile without actually doing one.
6. I take this image and run it on vmware box...... test everything I feel I should,,
7. when am satisfied  I extract  a new copy of fresh kernel and diff it with modified code.
8. now I  have a patch set which I can place in appropriate target directories.

hope whatever I said was helpful.

What i did was basically the way that the documentation says to do it but, what you said

1. I build normal openwrt image for vmware.

Build an image first -> modify code -> make patch -> rebuild. Difference is its for a bcm6348 but thats the only way i can get it to work.

The discussion might have continued from here.