1# FAQs 2 3## Common Build Problems and Solutions 4 5### "usr/sbin/ninja: invalid option -- w" 6 7- **Symptom**<br>The build fails, and "usr/sbin/ninja: invalid option -- w" is displayed. 8 9- **Possible Causes**<br>The Ninja version in use does not support the **--w** option. 10 11- **Solution**<br>Uninstall Ninja and GN, and [install Ninja and GN of the required version](../../device-dev/get-code/gettools-ide.md). 12 13### "/usr/bin/ld: cannot find -lncurses" 14 15- **Symptom**<br>The build fails, and "/usr/bin/ld: cannot find -lncurses" is displayed. 16 17- **Possible Causes**<br>The ncurses library is not available. 18 19- **Solution**<br> 20 21 ```shell 22 sudo apt-get install lib32ncurses5-dev 23 ``` 24 25### "line 77: mcopy: command not found" 26 27- **Symptom**<br>The build fails, and "line 77: mcopy: command not found" is displayed. 28 29- **Possible Causes**<br>mcopy is not available. 30 31- **Solution**<br> 32 33 ```shell 34 sudo apt-get install dosfstools mtools 35 ``` 36 37### "riscv32-unknown-elf-gcc: error trying to exec 'cc1': execvp: No such file or directory" 38 39- **Symptom**<br>The build fails, and "riscv32-unknown-elf-gcc: error trying to exec 'cc1': execvp: No such file or directory" is displayed. 40 41- **Possible Causes**<br>You do not have the permission to access files in the RISC-V compiler directory. 42 43- **Solution**<br>1. Run the following command to locate **gcc_riscv32**. 44 45 ```shell 46 which riscv32-unknown-elf-gcc 47 ``` 48 49 2. Run the **chmod** command to change the permission for the directory to **755**. 50 51### "No module named 'Crypto'" 52 53- **Symptom**<br>The build fails, and "No module named'Crypto'" is displayed. 54 55- **Possible Causes**<br>Crypto is not installed in Python3. 56 57- **Solution**<br> 58 59 1. Run the following command to query the Python version: 60 61 ```shell 62 python3 --version 63 ``` 64 65 2. Ensure that Python 3.9.2 or later is installed, and then run the following command to install PyCryptodome: 66 67 ```shell 68 sudo pip3 install pycryptodome 69 ``` 70 71### "xx.sh: xx unexpected operator" 72 73- **Symptom**<br>The build fails, and " xx.sh [: xx unexpected operator" is displayed. 74 75- **Possible Causes**<br>The build environment shell is not bash. 76 77- **Solution**<br> 78 79 ```shell 80 sudo rm -rf /bin/sh 81 sudo ln -s /bin/bash /bin/sh 82 ``` 83 84 85### "some services are not authenticated. Listed as follow" 86 87- **Symptom**<br>The build fails, and " some services are not authenticated. Listed as follow" is displayed. 88 89- **Possible Causes**<br>In the .cfg file of the processes listed in the error message, **uid** is set to **root** or **system**. However, these processes are not high-privilege processes defined by the product. 90 91- **Solution**<br> 92 93 Modify the process .cfg file to reduce the privilege level. Do not set **uid** to **root** or **system** unless necessary. 94 95 If a process must have the **root** or **system** privilege due to service requirements, modify the **high_privilege_process_list.json** file with the approval of the security experts. The **high_privilege_process_list.json** file is located in **vendor/***{company_name}/{product_name }***/security_config**. 96 97 For example, the file for rk3586 is **//vendor/hihope/rk3568/security_config/high_privilege_process_list.json**. 98 99 100### "Error: some services do not match with critical whitelist" 101 102- **Symptom**<br>The build fails, and "Error: some services do not match with critical whitelist" is displayed. 103 104- **Possible Causes**<br>In the .cfg file of the processes listed in the error message, the **critical** field is defined and enabled. However, the **critical** field is not allowed for the processes, or the **critical** setting does not match the settings in the whitelist. 105 106- **Solution**<br> 107 108 Remove the **critical** field or set the first bit of the **critical** field to **0** in the .cfg file of the processes. Do not enable the **critical** field unless necessary. 109 110 For details about how to use the **critical** field, see [Service Management](subsys-boot-init-service.md). If **critical** needs to be enabled for a process due to service requirements, modify the **//vendor/{company_name}/{product_name}/security_config/critical_reboot_process_list.json** file with the approval of the security experts. 111 112 For example, the critical_reboot process control whitelist of rk3586 is **//vendor/hihope/rk3568/security_config/critical_reboot_process_list.json**. 113