marlin-build icon indicating copy to clipboard operation
marlin-build copied to clipboard

Advanced configuration within src/

Open frealmyr opened this issue 4 years ago • 9 comments

In some cases you might want to change the variables not covered by .h configuration files alone, and you need to make changes inside the MarlinFirmware/Marlin/src folder.

The script currently have no logic for replacing files inside sub-folders.

frealmyr avatar Oct 30 '20 21:10 frealmyr

It would be amazing if we could use some kind of patching system for this. That way, we could make a repo which has a selection of different mods, and the user can pick and choose which they want, and the script applies them by patching after the git pull.

Not sure if I'm explaining this well...

ghost avatar Dec 12 '20 09:12 ghost

A repository is a good idea, but sounds like a lot of work to make it possible 😅

However, a solution could be a list of files with corresponding rules that can be applied using sed. Then we could apply a set of patches even if using the MarlinFirmware/Marlin repository and different tags. 🤔

frealmyr avatar Jan 30 '21 21:01 frealmyr

That sounds good to me!

ghost avatar Jan 31 '21 02:01 ghost

Advanced configuration can be solved by forking the marlin repository, making the desired changes and then use the repo override variable introduced in #12

I still like the idea for a solution with sed for simple tweaks, like changing a PIN to something else.

frealmyr avatar Mar 10 '21 08:03 frealmyr

Right, that's what I'm doing now... Trouble is that it requires a separate branch for each feature combo you may want to include.

One example would be let's say I want to compare Linear Advance and S-Curves (mutually exclusive options in marlin) so now I require two separate branches... Not too bad, but now let's say I introduce another feature I'd like to compare in combination with these two, like say different PID tunings and how they interact with the above... Now I need four....You can see how this grows pretty awkward pretty fast. I've got a set of about 8 of those so I'm up to 2^8 branches hahaha

ghost avatar Mar 10 '21 12:03 ghost

Right, that's what I'm doing now... Trouble is that it requires a separate branch for each feature combo you may want to include.

One example would be let's say I want to compare Linear Advance and S-Curves (mutually exclusive options in marlin) so now I require two separate branches... Not too bad, but now let's say I introduce another feature I'd like to compare in combination with these two, like say different PID tunings and how they interact with the above... Now I need four....You can see how this grows pretty awkward pretty fast. I've got a set of about 8 of those so I'm up to 2^8 branches hahaha

I see, haven't considered using it in such a way.

I only have one printer, so in such cases i would temporary create a bunch of firmware's locally using docker-compose. Mounting the MarlinFirmware folder to /home/platformio/Marlin as a volume should do the trick.

frealmyr avatar Mar 11 '21 10:03 frealmyr

Thanks for the tip, I'll give that a try shortly. My extruder decided that it was time for a break, so I'll let you know how I fare when the thing is back in action.

ghost avatar Mar 11 '21 13:03 ghost

I think it would be awesome to be able to supply recursive file overrides from the Firmware/Configuration/ folder. For example, I have an issue with the default pins defined for my board and have to manually override that. To do that with the marlin-build I end up having to maintain a complete fork of Marlin and supply that to the builder. Would be great if I could just save my pins file in Firmware/Configuration/src/pins/rambo/ and have it move that file into the equivalent folder within the Marlin downloaded source. To me this seems like it would be easier than dealing with any sed commands, but I'm not an advanced linux user like some of you I'm sure.

Thanks again for this wonderful project, it really is a great tool.

jneilliii avatar May 03 '21 05:05 jneilliii

You might want to look into the patch command

mike-onehub avatar Jun 09 '21 02:06 mike-onehub