Organizing patches/build artifacts against multiple trees

jim.cromie at jim.cromie at
Wed Apr 26 11:46:13 EDT 2023

On Sun, Feb 19, 2023 at 8:21 PM Sarah Langstrom
<sarahklangstrom at> wrote:
> For developers that find themselves with multiple in progress
> patchsets against multiple trees, how do you organize them locally? I
> add each tree as a remote and use git-worktree for multiple streams of
> development.

I use worktrees as well. they all use the same repo, so its gotta save space.
I tend to reuse them too, and rarely need make clean between swaps.

[jimc at frodo f2]$ git worktree list
/home/jimc/projects/lx/linux.git  457391b03803 [master]
/home/jimc/projects/lx/wk-next    75eada68d460 [kmemleak-format-tweaks]
/home/jimc/projects/lx/wk-ref     89b88285f7ba [diet-x1b]
/home/jimc/projects/lx/wk-rpi     b762dfa091f8 [maph]
/home/jimc/projects/lx/wk-suren   8660484ed1cf [modules-next]
/home/jimc/projects/lx/wk-test    b61bb42d2cdc [dd-fix-1d]

FWIW, I have ./builds/* folders, each with a .config file and a 2 line makefile:

# Automatically generated by /home/jimc/projects/lx/wk-rpi/Makefile: don't edit
include /home/jimc/projects/lx/wk-rpi/Makefile

> I wish I had a little working area to go along with each
> tree/tracking branch where I could store patches and configs related
> to that tree without committing them, but still be able to back them
> up when I push the trees to my backup NAS. I am starting to lose track
> of which patchsets worked against which tree and which commit by
> sticking them all in one ~/patches dir.

have you seen git stash ?
it will do at least some of what you want.

> Another issue I have is that I put files to build a small initramfs
> inside of linux/usr and a Makefile of my own to build the initramfs
> and start up qemu. Again, I want to use git to store it with my
> branches on my NAS, but I don't want to check it in. Does anyone else
> have tips for dealing with adding personal scaffolding like this
> without having it get accidentally lost? Right now they are just
> untracked files that I sometimes delete by mistake.

I use virtme to do my testing.
It exposes your host machine inside a qemu vm,
so the env & tools in the vm are the same binaries that youre used to using.
Ive had to do ZERO messing with the qemu details
Id never even used qemu until virtme,
and other than some fiddling with its many --options
(some are pass thru to qemu)
it just works.

specifically, it does guest-tools setup, maybe its simple to reuse that..

virtme.guesttools 975097856 485798144 486818176  50% /run/virtme/guesttools
virtme.initmount0 975097856 485798144 486818176  50% /root

As to personal scaffolding, test scripts etc,
I keep them in the parent directory of all the worktrees,
and the vm's get it as the HOME dir via --cwd=../../..

[jimc at frodo f2]$ krun
vm --show-command --show-boot-console --kdir . --mods=auto --kopt
nokaslr --rwdir=/root=/home/jimc/projects/lx/boots-dump/v6.3-7-gb762dfa091f8
--cwd=../../.. --kopt dynamic_debug.verbose=3 --qemu-opts -m 2G --smp

then I can just source the shell tools I want

[   21.770154] virtme-init: udev is done
virtme-init: console is ttyS0
bash-5.2# . test-funcs.rc

> Thanks,
> Sarah
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at

More information about the Kernelnewbies mailing list