Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initrdscripts: replace cut by awk for parsing lsblk in cryptsetup hook #3518

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

mtoman
Copy link
Contributor

@mtoman mtoman commented Sep 17, 2024

cut is sensitive to the amount of delimiter characters when parsing output, so e.g. an additional space between two elements causes every field shift by one index.

This patch replaces the use of cut by awk, which should be more robust.


Contributor checklist

Reviewer Guidelines

  • When submitting a review, please pick:
    • 'Approve' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved).
    • 'Request Changes' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc).
    • 'Comment' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment)

cut is sensitive to the amount of delimiter characters when parsing
output, so e.g. an additional space between two elements causes
every field shift by one index.

This patch replaces the use of cut by awk, which should be more robust.

Change-type: patch
Signed-off-by: Michal Toman <[email protected]>
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 14:27 — with GitHub Actions Inactive
Copy link

github-actions bot commented Sep 17, 2024

Website deployed to CF Pages, 👀 preview link https://bcd0ac81.balena-os.pages.dev

@mtoman mtoman temporarily deployed to balena-staging.com September 17, 2024 23:10 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com September 17, 2024 23:44 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com September 17, 2024 23:44 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com September 17, 2024 23:44 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com September 18, 2024 04:46 — with GitHub Actions Inactive
@flowzone-app flowzone-app bot merged commit 52be048 into master Sep 18, 2024
159 of 161 checks passed
@flowzone-app flowzone-app bot deleted the mtoman/cryptsetup-awk branch September 18, 2024 04:58
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