hi All,
I’ve been a user and light developer of OpenWRT for many years, but have begun
my first full blown project with OpenWRT a few months ago. I’m very comfortable
with the overall build process, patching, BSP specific files, etc. etc. but am
having a hard time grasping the overall workflow for adding a new package, or
in my current case an entirely new feed with several packages. I’ve read the
following and understand them fairly well:
http://wiki.openwrt.org/doc/devel/feeds
http://wiki.openwrt.org/doc/howto/build
http://wiki.openwrt.org/doc/devel/packages
http://wiki.openwrt.org/doc/packages
To me that covers the structure of Makefiles, how to add menuconfig options,
various ways to compile your package for debug, how to compile an individual
package apart from the rest of the distro, adding a new feed, etc.. the big
piece I’m missing is how you get from a generic source tar ball to a completed
package with patches for a given architecture. Let me first give an example of
the “typical” cross-compile procedure I’ve used with other projects:
* write makefile that tells system how to fetch and unpack source (or do this
yourself and commit the entire source to git/cvs/svn/whatever)
* if necessary run cross configure to generate makefile, then make
-> uh-oh; turns out the package is broken on this specific platform
-> this leads to fixes in 1 or more files which get set aside
and committed
-> all changes are inside of #ifdef’s for easier
reading later (same idea as patching, but patching is far superior)
-> this process is iterative. work through each issue until
it’s resolved.. could be 2 bugs in a package or 100
-> once complete commit the files and move on
* with compilation complete and code checked in all that’s left is to verify we
install onto the target in the right location and test
I don’t view this workflow as all that different from an OpenWRT package. The
primary difference is that rather than committing the code to my repo directly
with changes, the OpenWRT way is to diff (or use a tool like quilt) to generate
a diff of the delta between my source and the original source in the package.
Once complete, put in the patches dir of the package and each build will
fetch/unpack the original source, then apply my patch set.. couldn’t be easier!
What’s missing for me is where (or rather how) this iterative process of
building, editing, building, editing, building, testing, editing goes. It seems
insane to me that for each compilation failure you’d make a single patch and
move on to the next compilation failure but maybe that’s how it’s done, I’m
really just not sure.
Just for the sake of clarity I’ve hacked my way around in the kernel by doing
the following:
* create a fresh build area, build to completion
* add my new module source to the kernel build directory and update associated
makefiles (all south of build_dir)
* once I’ve got my specific module compiling I put the original vendor files in
the files-x.yz dir of the BSP dir and patches in patches-x.yz of the BSP dir
* this works because the kernel build dir does not get wiped out between make
iterations
For packages I’ve found that the source in build_dir gets wiped out between
make iterations so this process does not work. I’m sure there’s a missing wiki
page somewhere or simple footnote I’ve missed; if anyone can point me in the
right direction or possibly post a typical workflow w.r.t. package porting it
would be a huge relief to me and clear a lot of things up.
The core problem I need to solve is how to compile/test a package and make
change after change after change to it, then when it’s ready, create a patch
set. I have a feeling I’ve been doing things the hard way for a while and would
appreciate a push in the right direction. I love what OpenWRT is doing for the
community and an more than happy to contribute back; if this is something that
isn’t in a wiki and should be I’m more than happy to document it if someone can
help me get the procedure straight. Thanks for your time,
—
Chad Monroe_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel