Why can not compile? At one time, I compiled the kernel on a PC with Xubuntu with x86 and only 1GB of RAM, though it took a long time to complete. If we talk about porting the firmware from one device to another, then your sequence is correct, you just need to choose the most identical "donor", choose the "donor" version of Android is the same as that of the drain, have tools for unpacking the core files and both firmware, basic understanding of smali (well, it comes during the process), as well as a program in which you can track logcat. The latter is a necessary thing, since the correction of errors when porting the firmware implies a "tinkering" in the kernel, framework, and substitution of files from the drain. I advise you to try to start porting MIUI first, the porting process is very accessible on one popular forum. In a number of problems, it is better to have JTAG with you just in case, since it is easy to “mimic” the phone with other radio modules and, sometimes, cores. Just remember that even the best port of the firmware will lose the firmware collected from the sources. Speaking of source codes: you can find the source codes (apparently kernels) for the G361H here: http://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=G361H