A few months ago I began looking into what options are there for opensource or "flexible" switching needs. I found about these keywords:
1. ONIE - https://opencomputeproject.github.io/onie/
2. SONiC - https://sonicfoundation.dev/
3. DentOS - https://dent.dev/
The first keyword leads us