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

Allow the user to use wrap as part of the bootstrap process #479

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

MaxHearnden
Copy link
Contributor

This adds support for wrap in three situations:

  1. Using rootfs.py -w
  2. In a prepared environment containing distfiles, seed and steps (as sub directories)
  3. In a clone of the whole git repository with distfiles (Although it does overwrite tracked files within the git repository)

For 2 and 3, wrap can be used by copying seed/after-wrap.kaem to seed/stage0-posix/after.kaem (symlinking works as well) and running bootstrap-seeds/POSIX/${ARCH}/kaem-optional-seed from within the seed/stage0-posix directory

This replaces #339

The lib directory for python modules conflicted with the symlinks for a
merged usr so this moves the directory out of the way
@Googulator
Copy link
Collaborator

I suggest adding a GitHub CI workflow using the -w option.

Also, mind the Python linter.

@MaxHearnden
Copy link
Contributor Author

Done, just waiting for the CI to finish

@fosslinux
Copy link
Owner

If you're comfortable with it, could you use a matrix for the Github workflow, instead of copy-pasting the workflow file? https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow

If you're not comfortable I can do that.

@MaxHearnden
Copy link
Contributor Author

I've added a test matrix, would you like me to use separate step 1 and step 2 artifacts for bwrap and wrap.

@Googulator
Copy link
Collaborator

Yes, that would be preferable.

@MaxHearnden
Copy link
Contributor Author

It now uses separate artifacts

Copy link
Owner

@fosslinux fosslinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! There's a few structural things that I'd like to see changed a bit, they go against convention that we've been using. Particularly, we try to make the bootstrap flow as mode-agnostic as possible, and simply wrap anything specific to one mode in an if block, but the way it's currently structured is difficult to follow.

Comment on lines +149 to +153
if wrap:
shutil.copy2(os.path.join(seed_dir, 'after-wrap.kaem'),
os.path.join(self.target_dir, 'after.kaem'))
shutil.copy2(os.path.join(seed_dir, 'after.kaem'),
os.path.join(self.target_dir, 'after-wrapped.kaem'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to try to avoid having conditional logic in generator.py. Is there some reason this needs to be here, and can't occur within the live-bootstrap environment?

Ie, there would be conditional logic in after.kaem for wrap mode, by adding in some kind of WRAP=True into bootstrap.cfg, rather than replacing the kaem files like this.

catm seed-full.kaem /steps/bootstrap.cfg /steps/env seed.kaem
if catm seed-full.kaem /steps/bootstrap.cfg /steps/env seed.kaem; then
else
replace --file /steps/env --output /steps/env --match-on /external/distfiles --replace-with /distfiles
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is /distfiles being reintroduced?

seed/wrap-bootstrap.cfg Show resolved Hide resolved
Comment on lines +9 to +12
if [ -d "/${d}" ] && ! [ -L "/${d}" ]; then
# Move the non symlink directory out of the way
mv "/${d}" "/${d}-saved"
fi
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reading the commit description where this was introduced but still cannot figure out why this was added.

If I'm understanding the commit, my best guess is because the entire git repository is being copied into target, but I'm not sure why that is desirable either (not a supported running method)

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.

3 participants