2024-09-06 06:04 AM - last edited on 2024-09-06 07:14 AM by SofLit
Hello
I am new to this forum, so if I am at the wrong place, let me know.
How can this software: https://www.st.com/en/development-tools/stm32cubeclt.html be installed from a script? Namely into docker container?
I get the following error:
``` DISPLAY not set. Cannot display license. Aborting. ```
Thanks in advance.
Solved! Go to Solution.
2024-09-09 04:32 AM
Try setting this env:
LICENSE_ALREADY_ACCEPTED=1
It works for STM32CubeIDE.
2024-09-07 02:58 PM
What if you just install cubeclt on a normal linux machine with a display (yes, manually), then copy the stuff into container, post the result to your container server and be done with it?
2024-09-08 11:52 PM
Thanks for the suggestion. I will consider this.
I was wondering, though, if there is no way to do it automatically, as I would like to build the container automatically from a script as well. Is this really an edge-use-case? I would have thought, that the installer would provide a way to accept the license agreement from a script? I tried `echo y | install_script` and the like. It does not work.
If there is no way, where to post the feature request?
Thanks.
2024-09-09 03:23 AM
@SofLit could you look at this request? Is there a "legal" way to bypass the license annoyance for headless installation?
2024-09-09 03:50 AM
Hello @cla
First let me thank you for posting.
In fact, during the installation it's required that the license agreement is done manually by the user.
I will raise your request internally and give you updates as soon as I get them.
KR,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-09-09 04:32 AM
Try setting this env:
LICENSE_ALREADY_ACCEPTED=1
It works for STM32CubeIDE.
2024-09-10 06:11 AM
Final command:
```
unzip ./en.st-stm32cubeclt_1.16.0_xxxxx.sh.zip && \
chmod +x ./st-stm32cubeclt_1.16.0_xxxxx.sh && \
echo | sudo LICENSE_ALREADY_ACCEPTED=1 ./st-stm32cubeclt_1.16.0_xxxxx.sh
```
`echo` sends newline to accept default install directory (there might be a better approach, but this worked).
2024-12-18 01:31 PM
That's a good solution as well. Honestly, it's probably the cleaner solution.
I ended up just using an expect script to install on a devcontainer. Ensure you install procps-ng and expect before you run it if you do it this way. Then just remove the packages after it's installed. Here's the expect script.
#!/usr/bin/expect
# Path to your shell script
set script "/tmp/st-stm32cubeclt_1.17.0_23554_20241124_1810_amd64.sh"
# Start the script
spawn $script --nox11
# Automatically handle the --More-- paging prompt
expect {
-re "--More--" {
send "q"
exp_continue
}
-re {\[[NY]/[yn]\]}
{
send "y\n"
exp_continue
}
-re {STM32CubeCLT install dir\?}
{
send "/opt/st/stm32cubeclt_1.17.0\n"
exp_continue
}
}
# Wait for the script to finish
expect eof