ni / nilrt

Tools to build NI Linux RT distribution.
MIT License
80 stars 69 forks source link

Build Evironment Error:return non zero exit status 9 #191

Closed ghost closed 1 year ago

ghost commented 2 years ago

I run the env file as root, and got the error like: INFO: Using /home/lab/Downloads/nilrt/nilrt/build as the OE build workspace. BB_NUMBER_THREADS=40 INFO: Using pyrex image: build-nilrt:hardknott useradd: user 'root' already exists Traceback (most recent call last): File "/usr/libexec/pyrex/entry.py", line 201, in <module> sys.exit(main()) File "/usr/libexec/pyrex/entry.py", line 105, in main subprocess.check_call( File "/usr/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['useradd', '--non-unique', '--uid', '0', '--gid', '0', '--groups', '0', '--home', '/root', '--no-create-home', '--shell', '/bin/sh', 'root']' returned non-zero exit status 9.

amstewart commented 2 years ago

Did you use the create-build-nilrt.sh script to generate the docker container that pyrex uses?

If so, did you do anything different from what is requested in the README?

amstewart commented 2 years ago

I'm going to close this issue, since there hasn't been any activity in a couple weeks. Let me know if you object.

SallyTYT commented 1 year ago

Did you use the create-build-nilrt.sh script to generate the docker container that pyrex uses?

If so, did you do anything different from what is requested in the README?

Hi @amstewart , I got this error too. I did use create-build-nilrt.sh script but still get this error. Do you have any other ideas about this issue? Thank you

mike-petersen-ni commented 1 year ago

@GccNoSharp or @SallyTYT:

Could you provide more information on the environment in which you are encountering this issue?
Let us know:

A working example In a VM running Ubuntu Desktop, version [22.04.02 LTS (Jammy Jellyfish)](https://releases.ubuntu.com/22.04.2/), running on a machine within the NI corporate network. From a clean install, these commands (mostly from the README) are sufficient to set up the system, enter the bitbake environment, and use it to build: 1. Install git: ```bash sudo apt-get install git ``` 2. Clone the repositories: ```bash git clone https://github.com/ni/nilrt.git cd nilrt git submodule init git submodule update --remote --checkout ``` 3. Install the Docker engine [as described by their documentation](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository): - Install Docker packages: ```bash sudo apt-get update sudo apt-get install ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` - Add user to docker group: ```bash sudo usermod -a -G docker $USER ``` 5. Reboot: ```bash reboot ``` 6. Return to the nilrt clone: ```bash cd nilrt ``` 7. Build the Docker container: ```bash ./docker/create-build-nilrt.sh ``` 8. Set up the bitbake environment: ```bash . ./ni-oe-init-build-env echo 'NILRT_MAIN_FEED_VERSION = "2023Q1"' >> ./conf/local.conf ``` 9. Use bitbake: ```bash bitbake python3 ```
SallyTYT commented 1 year ago

@mike-petersen-ni thank you for your reply. For your listed questions,

I will try with Ubuntu, thank you.

mike-petersen-ni commented 1 year ago

@SallyTYT I've tried a VM running a Minimal installation of CentOS 7.9.2009 (Core) and was able to successfully enter the environment and run a bitbake build. At a high level, the steps I took were:

Let us know if you have suggestions to improve clarity in our instructions, or if you continue to encounter the issue.

SallyTYT commented 1 year ago

@mike-petersen-ni It turns out that I was using the root user to execute all the commands, which led to the issue. I switched to a normal privileged user and added the user to the docker group, then it worked. Thank you very much!

mike-petersen-ni commented 1 year ago

I've been able to reproduce this issue by sourcing the ni-oe-init-build-env script as root. We'll look into improving the error reporting (AB#2350311). For now, it sounds like normal usage isn't causing problems; closing this item as resolved.