Maybe this: when your custome firmware firsttime boot and mout overlay filesystem, if it finds hostname is GL-S1300 which is a sigature of factory firmare, then execute ‘firstboot -y’ to remove overlay old files.
Very likely.