Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace sources rpms with kernel.git #99

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from

Conversation

vmezzela
Copy link
Collaborator

This pull request modify klp-build so that the extractions relies on the kernel.git repository instead of the sources rpms.
Each source is no longer downloaded and extracted. Instead a worktree checked out to the respective git tag is created in place of the old source.

This means:

  1. klp-build no longer downloads the sources rpm for all supported codestreams. In this way, setting up the tool for the first time is less time/disk-space consuming .
  2. it only allocates a worktree when a specific source is needed for the extraction. The drawback is that when the extraction hits a codestream that doesn't have yet a worktree checked out, it'll take some time to create it.
  3. to cleanup space, the command klp-build clean-sources will remove all the worktrees. This is useful when there are old trees that we no longer support.

Possible issues:
If for any reason when the worktree creation is interrupted, there might be problem of integrity with the kernel sources. It is recommended to run klp-build clean-sources and before the next extraction.

With this PR, a new entry in the config is required, kernel_dir, which contains the path to the git kernel repository (expanded tree).

To test the PR it's better to use a new data_dir to make sure we're not using old data.

Signed-off-by: Vincenzo MEZZELA <[email protected]>
This new kernel tree module is required to replace the source rpms. In
this way, klp-build can no longer download the sources and can allocate
a worktree on demand when needed.

This reduces heavily the amount of disk space used by klp-build.

Signed-off-by: Vincenzo MEZZELA <[email protected]>
The sources rpm are now replaced by the kernel tree worktree on demand.

Signed-off-by: Vincenzo MEZZELA <[email protected]>
Calling get_src_dir from setup makes kernel_tree initializing the kernel
worktree just to check for the presence of one file. Instead, we can
just query git to check this for us, avoid numerous kernel worktree
check out.

Signed-off-by: Vincenzo MEZZELA <[email protected]>
@vmezzela vmezzela requested a review from fgyanz March 20, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant