Skip to content

Conversation

hying-caritas
Copy link

From

https://www.freedesktop.org/software/systemd/man/latest/os-release.html

the format of /etc/os-release file is shell variable like to support sourced in a shell script. So, that is the best method to parse the file.

While the original method may include quote in the result variable, for example, for

$ cat /etc/os-release
...
ID="mydist"
...

we will get rootfs="mydist" with the original method, while we will get rootfs=mydist with shell source method.

So, use the shell source method to avoid the issue.

From

https://www.freedesktop.org/software/systemd/man/latest/os-release.html

the format of /etc/os-release file is shell variable like to support
sourced in a shell script.  So, that is the best method to parse the
file.

While the original method may include quote in the result variable,
for example, for

$ cat /etc/os-release
...
ID="mydist"
...

we will get rootfs="mydist" with the original method, while we will
get rootfs=mydist with shell source method.

So, use the shell source method to avoid the issue.

Signed-off-by: Huang Ying <ying.huang@linux.alibaba.com>
@rli9 rli9 merged commit 8ce2e30 into intel:master Jul 20, 2025
@rli9
Copy link

rli9 commented Jul 20, 2025

thanks for the patch

@hying-caritas hying-caritas deleted the fix_rootfs_run_local_monitor branch July 20, 2025 13:17
alexshi pushed a commit to alexshi/lkp-tests that referenced this pull request Aug 5, 2025
…ntel#524)

From

https://www.freedesktop.org/software/systemd/man/latest/os-release.html

the format of /etc/os-release file is shell variable like to support
sourced in a shell script.  So, that is the best method to parse the
file.

While the original method may include quote in the result variable,
for example, for

$ cat /etc/os-release
...
ID="mydist"
...

we will get rootfs="mydist" with the original method, while we will
get rootfs=mydist with shell source method.

So, use the shell source method to avoid the issue.

Signed-off-by: Huang Ying <ying.huang@linux.alibaba.com>
Co-authored-by: Huang Ying <ying.huang@linux.alibaba.com>
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