This makes sure that the worktrees mounted into the SDK container
properly reference other worktrees, so they won't be treated by git as
stale and get cleaned up.
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
This is something I have done, because I needed it in early drafts of
the work. The work has evolved and the need disappeared, but maybe it
makes sense to keep it.
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
The library has the following functionality:
- Discover the git repository layout. This figures out where is the
main repository (whose `.git` entry is a directory and contains all
the git configuration and objects) and all its linked worktrees
(their `.git` entries are just files with a path to their respective
worktree metadata directory inside the main repo's `.git`). The
layout is basically two things: a path to the main repo and a map of
linked worktree name to the path of the linked worktree. Name of a
worktree is the `<name>` part in the path
`<main-repo>/.git/worktrees/<name>`.
- Map the discovered git repository layout into possible git
repository layout inside the SDK container. The worktrees (both main
one and linked ones) are put into a chosen base directory inside SDK
so the main worktree is in `<base>/main-repo`, while linked
worktrees are in `<base>/linked/<name>`. It's also possible to
override the path for any worktree to be put elsewhere (for example,
we may want to put the worktree being in current working directory
to `/mnt/host/source/src/scripts`, while the rest of the worktrees
go somewhere under `/mnt/host/all-worktrees/scripts` directory).
- Generate Docker volume options based on both git repository
layouts. It results in an array of strings in form of `"-v"
"<path-to-worktree:path-to-worktree-inside-SDK"` that can be passed
directly to docker/podman.
- Generate replacements based on git repository layout inside the SDK
container. Replacements is a bash file to be sourced. It defines a
map of file paths to the new contents that those files should
have. Currently the generated replacements are for `.git` files in
the linked worktrees and `gitdir` files inside main worktree's
`.git/worktrees/<name>` directories. Such replacement file should be
mounted inside the SDK container with -v option (just like the
worktrees).
- Map the replacements to a set of bind-mounts. This action should be
done inside the SDK container - it sources the replacements files,
creates temporary files with the contents being the values in the
map from the replacements file and bind-mounts them into the
locations being keys of the map.
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
After the update, the USE=mpfr got enabled by default, so now we need
to disable it explicitly. Gawk is a part of our initrd, which means
that mpfr gets pulled into it now, increasing the size of it by
another 2mb, which breaks Flatcar updates.
Gentoo dropped the 550 branch of the drivers, so we fail to build the
nvidia-drivers-550 sysexts. For now we temporarily bring it back here
while we figure out our policy for deprecating and dropping sysexts.