radxa-repo / rbuild

Radxa Image Builder (Maintenance mode)
https://radxa-repo.github.io/rbuild/
GNU General Public License v3.0
53 stars 44 forks source link

`--root-override` missing from usage output #13

Closed gsingh93 closed 1 year ago

gsingh93 commented 1 year ago

The output of ./rbuild --help doesn't show the --root-override flag. I was confused as I was trying to use --native-build which requires sudo, but the script doesn't let you run with sudo by default. I figured out this command existed by reading the source, but it should be added to the usage output.

RadxaYuntian commented 1 year ago

In general running everything as root is bad practice. For rbuild specifically it caused file permission issues that makes the development not as smooth. I had to diagnose one of my colleague's system and the problem was indeed caused by running the script with sudo. So it is banned, and we provided container runtime setup guide to allow execution of the script without sudo, as docker was the main reason people use sudo in the first place.

However, building as root was necessary to for our GitHub workflow, and I think the usage is beyond --native-build. Since I was already bitten by sudo-happy people, I keep this flag internal to avoid more unnecessary support issues.

I'll double check if this flag can be merged with --native-build.

gsingh93 commented 1 year ago

Thanks! I also prefer to not need to use sudo, but in this case it was necessary to get around this error:

2023/04/21 22:46:10 fakemachine not supported, running on the host!
2023/04/21 22:46:10 Action `Set up on-disk layout` failed at stage PreNoMachine, error: Failed to setup loop device

Do you have another suggestion for how to deal with this without sudo?

RadxaYuntian commented 1 year ago

From that error message you actually have to use with sudo. I'll merge those 2 options in one later.

RadxaYuntian commented 1 year ago

Fixed in a695c01353140d32fe2ecb6d59a15792a5301f0e.