Skip to content

fix(server): robustly parse OS_ID from /etc/os-release#318787

Open
developers-universe-1 wants to merge 1 commit into
microsoft:mainfrom
developers-universe-1:fix/check-requirements-linux-os-id-parsing
Open

fix(server): robustly parse OS_ID from /etc/os-release#318787
developers-universe-1 wants to merge 1 commit into
microsoft:mainfrom
developers-universe-1:fix/check-requirements-linux-os-id-parsing

Conversation

@developers-universe-1

Copy link
Copy Markdown

Fixes #232159

The previous grep-based parser failed when ID was quoted, e.g.
ID=\"rocky\" on Rocky Linux 8.5, leaving OS_ID empty and causing
the script to exit with code 1.

Sourcing /etc/os-release in a subshell and echoing $ID handles
both quoted and unquoted values correctly. This approach also aligns
with the format specification for os-release files.

…rements-linux.sh

The previous grep-based parser failed when ID was quoted, e.g.
ID="rocky" on Rocky Linux 8.5, leaving OS_ID empty and causing
the script to exit with code 1.

Sourcing /etc/os-release in a subshell and echoing $ID handles
both quoted and unquoted values correctly.

Fixes microsoft#232159
Copilot AI review requested due to automatic review settings May 28, 2026 16:22

Copilot AI left a comment

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.

Copilot wasn't able to review any files in this pull request.

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.

Devcontainer setup ad-hoc parsing fails on Rocky 8.5

3 participants