After a month of trials, I finally built a stable custom Android rom for my old device. I now even tried applying backported security patches. All is good.