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

[Feature] Setup parent mount before pivot_root if on initramfs #1507

Closed
aconz2 opened this issue Jul 31, 2024 · 2 comments
Closed

[Feature] Setup parent mount before pivot_root if on initramfs #1507

aconz2 opened this issue Jul 31, 2024 · 2 comments

Comments

@aconz2
Copy link
Contributor

aconz2 commented Jul 31, 2024

I am using crun from initramfs and was running into pivot_root errors because the rootfs mount has no parent. I found a workaround in this comment which I'm reproducing below

unshare --mount
mount --rbind / /abc --mkdir
cd /abc
mount --move . /
chroot .
# bwrap will not get EINVAL from pivot_root() anymore

I've successfully used this (notes here).

I am wondering if you think this would be worthwhile to add as an option like --pivot-rootfs <dir> where it would do the above steps using the given <dir> to work from. I'm planning on writing a separate wrapper anyways but thought it might be useful to have builtin. I could work on putting together a PR too with some direction.

@giuseppe
Copy link
Member

giuseppe commented Aug 1, 2024

if you could open a PR, that would be great, so we can evaluate the complexity and if it is worth to add to crun itself

@aconz2
Copy link
Contributor Author

aconz2 commented Aug 7, 2024

verdict is doesn't make sense to include here, see #1508. I put a POC wrapper in a gist

@aconz2 aconz2 closed this as completed Aug 7, 2024
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

No branches or pull requests

2 participants