[POST-SCRIPTS][CORE] Update script sourcing and remove duplicate warnings
- It's now possible to run scripts that prints text to the terminal. Tested the post-scripts in Rockchip layer with an example of script that asks to accept the EULA. The script is:
#!/bin/sh
# Add variable to environment
export RK_TEST_ENV_VAR="SECO_RK_TEST_VAR"
# Ask for EULA acceptance
eula_text="END-USER LICENSE AGREEMENT (EULA)
Last Updated: $(date)
IMPORTANT: PLEASE READ THIS END-USER LICENSE AGREEMENT ('EULA') CAREFULLY BEFORE INSTALLING, USING, OR OTHERWISE ACCESSING THE SOFTWARE ('SOFTWARE').
BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE, YOU AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THESE TERMS, DO NOT INSTALL OR USE THE SOFTWARE.
1. DEFINITIONS
1.1. 'Software' refers to the computer programs, code, files, and documentation provided by the company or entity granting this license.
1.2. 'User' refers to the individual or organization using the Software.
1.3. 'Licensor' refers to the owner of the Software.
2. LICENSE GRANT
2.1. Subject to the terms and conditions of this Agreement, Licensor grants the User a non-exclusive, non-transferable, revocable license to install and use the Software.
2.2. The Software is licensed, not sold, and no ownership rights are transferred under this Agreement.
3. RESTRICTIONS
3.1. The User may not reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of the Software.
3.2. The User may not sublicense, rent, lease, or distribute the Software without explicit written permission from the Licensor.
3.3. The Software may only be used on the hardware or system specified by the Licensor in the documentation.
.......
By clicking 'Accept' or by using the Software, you agree to be bound by the terms and conditions of this Agreement.
End of EULA
"
echo "$eula_text" | less >&2
read -p "Do you accept the terms of the EULA? (yes/no) [yes]: " choice
choice=${choice:-yes}
if [[ "$choice" == "yes" ]]; then
echo "Thank you for accepting the EULA." >&2
else
echo "You did not accept the EULA. Exiting..." >&2
fi
The result is:
yoctouser@8277733f7b57:~/workdir$ . ./seco-setup.sh -c
WARNING: no CONFIG_CLOUD_ASTARTE-URL found in the configuration.
WARNING: no CONFIG_CLOUD_ASTARTE-REALM found in the configuration.
WARNING: no CONFIG_CLOUD_ASTARTE-PAIRING-TOKEN found in the configuration.
WARNING: no RAUC found in the configuration.
Welcome to SECO BSP
The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
Your build environment has been configured with:
MACHINE=seco-rk3399-c31
SDKMACHINE=i686
DISTRO=clea-os-fb
EULA=
No post-script has been found in the layer meta-seco-clea-os.
Executing post-script 0001-seco-rk-post-script.sh found in the layer meta-seco-rk
Do you accept the terms of the EULA? (yes/no) [yes]: yes
Thank you for accepting the EULA.
yoctouser@8277733f7b57:~/workdir/build_c31$
- Removed duplicated warnings.
VERSIONING Select one of the following version increments: Version bump type: [PATCH]