I am creating an embedded Linux application. I am managing all of my source files in Git, including the Linux Kernel source, root file system (rootfs) source, the roofs itself, my application source and all its dependent libraries. My rootfs is owned by root and forces me to use sudo whenever i am updating it. For starters, I suspect that i'm not doing this the right way. I am using Git flow and up until now i have been committing to the development branch. I have had issues with Git and the root owned roots and got around these by using sudo on the affected git commands. Again, I though that this must be incorrect, but I wasn't sure what else to do. I now want to merge the master and development branches. I did a checkout of the master branch and got lots of warnings such as:
warning: unable to rmdir libs/lib: Directory not empty
...
warning: unable to unlink /system/rootfs/bin/busybox: Permission denied
...
The first example is a Git module.
The second example is a root owned file in rootfs.
I then found instructions which suggested I should merge master into development. So I tried to do another checkout back to development. Using sudo, I got the following error:
error: The fowlloing untracked working tree files would be overwritten by checkout:
system/rootfs/bin/busybox
...
Aborting
My question is, firstly, how can I get back to my development branch. And secondly, what is the correct way to manage my rootfs in Git? Thanks.