halmartin / meraki-builder

Scripts and tools to assemble firmware images for various Meraki MS switches and MX routers
GNU General Public License v3.0
76 stars 16 forks source link

Build Documentation #7

Open randlor opened 4 years ago

randlor commented 4 years ago

Whilst the current build documentation provides a good high level overview of the build process, there would be some benefit to expanding on it to encourage community uptake in the project.

Detailing prerequisites and procedures for building the following:

It would be helpful to highlight what each phase produces, and how the output is then used in the next phase in a step-by-step manner.

Happy to do this, and expand on the current build scripts to automate the process further where possible also.

halmartin commented 4 years ago

Sure, I should note though that "stage2" make script is completely irrelevant for postmerkOS. It only applies if you are interested in disassembling or rebuilding the Meraki stock firmware.

The "OpenWrt" toolchain from Meraki is only important if you want to rebuild the kernel. I'll see if I can integrate building the kernel into buildroot, as that would eliminate the need to build yet another toolchain. It's probably best to shove as much as possible into buildroot, since it's a well maintained project and building is roughly as simple as make menuconfig and then make


But perhaps I'm just proving your point that it's too confusing to know what you need to do to build :D

randlor commented 4 years ago

Ah ha, now you've explained it that makes sense! I took the documented steps on the front page all too literally. :) Buildroot -> Stage 1 -> Stage 2... probably explains why I wasn't having a lot of success in getting the images to the correct size!

Getting everything into buildroot would certainly be great, and very much appreciated. Thanks again for your efforts! :)

halmartin commented 4 years ago

@randlor I've done some testing and it seems like it should be possible and relatively simple to build the kernel using the buildroot toolchain. I've opened #8 to track this effort.

halmartin commented 3 years ago

Since u-boot supports the luton26 and mainline Linux support will come soon™ I have created a post-image script that buildroot executes to create a flashable image. For anyone interested, you can find the post-image script here.

This technically works now, if you use u-boot and buildroot to compile the kernel, but there are some issues with this (e.g. I'm still working out the correct device tree for u-boot and for some reason that I have not debugged, buildroot built kernels do not boot).

It does mean in the future that you can just run make in buildroot and at the end you'll have a flashable image in output/images