Best approach to modify driver in build system

Hello.

I'm learning to use the build system and I want to add a new driver for some hardware I designed. I can build my firmware correctly no problems, but since when I run make it downloads the source code for all the drivers from github/openwrt it just overwrites my changes.

When I run make clean all the packages and drivers etc are deleted of course, then i run make -j 8 V=s and all the driver code is downloaded. This overwrites my changes to the current driver I am using as my base for my own driver. I could make a patch file, but where would I put it? If I fork the openwrt git the source for the drivers do not exist there.

I'm puzzled and not great with git, but some pointers as to the best approach would be greatly appreciated.

Thank you

Wing Lok

1 Like

Thank you @frollic so I guess the process is:

  1. git clone
  2. git download to get the source onto my system
  3. modify the code and add my code
  4. use quilt to generate the patch
  5. git clean
  6. git download
  7. place my patch into the directory tree
  8. make

Did I miss anything?

Thank you for your help!

1 Like

@winglok I think your sequence is correct, however my approach would be to first clone the existing driver's git, make your changes there, then create your patch. Next add your new code and add that as a separate repo.

Since we don't know the specifics of your requirements, I take the approach to break things up into 2 parts which may be more manageable to troubleshoot.

1 Like

Thanks @crispyoz. Since @frollic showed me how to make a patch I like your idea to divide my work into two parts, much easier to find any errors. I always have so many errors, if I can divide by two it is much easier for me :rofl::rofl::rofl::rofl::rofl:

2 Likes

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