-
Notifications
You must be signed in to change notification settings - Fork 17
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
Changes needed to use crossbuilder on manjaro #59
Conversation
Hi @jezek, thanks for this! But please, split it into multiple commits, one per fix -- otherwise it makes it harder to review and to revert those bits that might turn out to be problematic. You can keep everything in the same branch, or create multiple PRs -- as you prefer (the latter will make it easier to immediately land the trivial fixes). |
I've split the previous commit with manjaro + other fixes into this PR, which is only changes needed to run on manjaro linux and into PR #60, which are some minor syntax, indent and bug fixes. Is it enough? |
- If no 'dpkg' command found, try to determine host architecture using other metod(s). - Don't check for 'dpkg-architecture' command at beginning. Run the command in container, if missing. - Don't check for 'dpkg-parsechangelog' command at beginning. Run the command in container or replace it by using grep+sed, if missing. - Run lxd daemon at startup, if not running. - Use current user/group id in lxd subuid/subgid setup & assurance. - If not 'apt' found, check for 'pacman' and use if present. - If container is missing network access, try to apply 'dhclient' hack. and then check again for network.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jezek, I left quite a few comments, but they are all minor; overall it looks very good, thanks!
crossbuilder
Outdated
fi | ||
sudo usermod --add-subuids "10000-75536" `whoami` | ||
sudo usermod --add-subuids "${USER_ID}-${USER_ID}" root | ||
sudo usermod --add-subuids "10000-75536" root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain why adding these ranges is needed? Is it so that if the owner of the files (outside the container) has a different ID than the user inside the container, the user inside the container will still be able to access these files?
If so, please add a comment to the code. And it's still not clear why this is done both for the current user and for root (the previous code was doing it for root only).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, the user part is not needed. It works without it.
Without the additional root part, the crossbuilder script ends with error when trying to install/configure container. After some search I found a tutorial which suggests adding the ranges. After adding the additional root ranges the container installs and the building script works.
Note, that I had a mistake in the ranges and added a range 10000, +65537, instead 100000, +65536 and it worked too. I've changed the ranges to reflect the arch manual page.
I really don't know why on ubuntu the additional ranges are not needed and on manjaro they are.
Here is a link to gist with crossbuilder output before the additional root subuid/subgid ranges and after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jezek! I'm terribly sorry for the delay, I hadn't time to try this in the last week. Now I did, and it seems to work fine :-)
other metod(s).
command in container, if missing.
command in container or replace it by using grep+sed, if missing.
and then check again for network.