Skip to content

Add MACHINE_NAME evn variable support#320

Open
Srinivas-Kandagatla wants to merge 2 commits intoqualcomm:developmentfrom
Srinivas-Kandagatla:development
Open

Add MACHINE_NAME evn variable support#320
Srinivas-Kandagatla wants to merge 2 commits intoqualcomm:developmentfrom
Srinivas-Kandagatla:development

Conversation

@Srinivas-Kandagatla
Copy link
Copy Markdown

Add MACHINE_NAME enviroment variable as fallback mechanism to detect
machine name, this should allow setups which will not have
access to /sys/firmware/ entries, example containers itself to be able
to use fastrpc libraries and dynamically get hold of hexagon binary
paths.

Apart from this change the file also has some LR chars, this pr converts them before adding the MACHINE_NAME support

Srinivas Kandagatla added 2 commits March 26, 2026 10:48
For some reason it looks like have commited fiels with CRLF
fix this by converting them into Unix format.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Add MACHINE_NAME enviroment variable as fallback mechanism to detect
machine name, this should allow setups which will not have
access to /sys/firmware/ entries, example containers itself to be able
to use fastrpc libraries and dynamically get hold of hexagon binary
paths.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
fclose(file);
parse_config_dir(machine_name);
} else {
char *env_value = getenv("MACHINE_NAME");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good to me, just 1 basic question. If the plan is to keep containers platform agnostic, how and when will the environment variable get set? Is it expected from the user to set the env before running their use-case?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users will be able to deploy containers like this as example, we could do exactly same in docker compose :
docker run -e MACHINE_NAME="$(tr -d '\0' < /sys/firmware/devicetree/base/model)" IMAGE
This is pertty much generic and will work for all the platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants