gitqemuminix

How to change the source code of minix in a local repository


I've been wondering how to solve the following problem. I'm currently learning how to modify an OS's source code to my liking, working example being A.S.Tanenbaum's minix.

Say I run minix with qemu and I redirect the ssh port to localhost:10022 (using -net user,hostfwd=tcp::10022-:22), so that I can ssh -p 10022 user@localhost to connect to the system that runs on qemu.

Now, minix's source code is located in /usr/src. I want to have this code locally on my machine -- best in a git repository -- and be able to modify it and then push it and build on the virtual machine.

To summarize, I want:

I have tried making /usr/src into a git repository that I can clone to my local machine. However, apparently pushing to a non-bare repository is not advisable, and a bare git repository, which doesn't contain any uncommited files, doesn't seem like the way to go.

Also, I would prefer not to brute-force it by just pushing / pulling to another remote.

I would appreciate any hints on how to set up my repositories to create my desired workflow.


Solution

  • Host: just one non-bare repository (+ backups).

    VM: one bare and one non-bare repository in /usr/src.

    Initial setup: create a non-bare repository in /usr/src in VM. Add and commit everything. Clone the not-bare repo to a bare repository somewhere. Clone from bare repo at VM to not-bare at the host.

    Workflow: Edit sources at the host, add and commit. Push from host to the bare repo at VM. Pull from bare to not-bare at VM and compile.

    Pulling from bare to not-bare can be made automatically using "remote deploy" hook (post-receive or post-update).