I have a carambola2 which I build FreeBSD using freebsd-wifi-build. The kernel fails to read the uboot environment, producing the following errors: argv is invalid envp is invalid I tracked this down to sys/mips/.atheros/ar71xx_machdep.c and the following code fragment: /* * Until some more sensible abstractions for uboot/redboot * environment handling, we have to make this a compile-time * hack. The existing code handles the uboot environment * very incorrectly so we should just ignore initialising * the relevant pointers. */ #ifndef AR71XX_ENV_UBOOT argc = a0; argv = (char**)a1; envp = (char**)a2; For the Carambola2, those registers are in fact accurate and should not be #ifdef'd out. However, the variables are in fact an array of strings of "name=value" not pairs of strings "name", "value", so to fix this for my own case I had to extend the code that parses them later in the file. Notwithstanding the comment regards 'more sensible abstractions', I have a patch that makes the variables work (for the carambola2, at least) https://github.com/pastcompute/freebsd/commit/9d06660cb53ff4c07048aaab0b086e612f5f155f However, I suspect you may wish to restrict this fix to _just_ the carambola2 board, lest it break other peoples systems. Any advice on how to filter a fragment of code to a specific kernel configuration would be appreciated, as I am mostly experienced with hacking other systems kernels...