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

cleanup secureboot #97

Merged
merged 9 commits into from
Sep 16, 2024
Merged

cleanup secureboot #97

merged 9 commits into from
Sep 16, 2024

Conversation

nkraetzschmar
Copy link
Contributor

  • deprecate secureboot and make_repart_* support from builder (move into feature image scripts)
  • this simplifies the build process by moving more design decisions into the feature configs

done
done

# printf 'DEBUG: [%s] %s -> %s\n' "$0" "$*" "${extensions[*]}" >&2
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this in the future? Otherwise I would remove this.

done

if [ -z "$script" ]; then
printf 'no image or convert script found to build %s\n' "${extension#.}"
exit 1
fi

# printf 'DEBUG: [%s] %s -> %s %s\n' "$0" "$*" "$script" "$input" >&2
Copy link
Contributor

Choose a reason for hiding this comment

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

done
done

if [ "${#artifacts[@]}" = 3 ] && [ -n "$(./parse_features --feature-dir "features" --cname "$cname" platforms)" ]; then
artifacts+=(".build/$cname-$COMMIT.raw")
fi

# printf 'DEBUG: [%s] %s -> %s\n' "$0" "$*" "${artifacts[*]}" >&2
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@Akendo Akendo left a comment

Choose a reason for hiding this comment

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

Please consider the commends I did.

@nkraetzschmar
Copy link
Contributor Author

applied comments and merged in latest changes from main

@@ -11,8 +11,8 @@ artifacts=(".build/$cname-$COMMIT.tar" ".build/$cname-$COMMIT.release" ".build/$

for feature in "${features[@]}"; do
for i in "features/$feature/"{image,convert}.*; do
extension="$(grep -E -o '(\.[a-z][a-zA-Z0-9\-_]*)*$' <<< "$i")"
artifacts+=(".build/$cname-$COMMIT$extension")
Copy link
Contributor

Choose a reason for hiding this comment

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

When I see this right, we have this part of the code duplicated within this project? Not only is this code difficult to read/understand for someone who doesn't know the regex by hard. It also adds the issue that it is challenging to maintain.

Please put it into a function that can be called with some documentation to it. Since you've changed the extension that is included, this should be part of the documentation as well. I couldn't tell why we suddenly needed the tilde.

@@ -7,8 +7,9 @@ extensions=(release manifest raw)

for feature in "features/"*; do
for i in "$feature/"{image,convert}.*; do
extension="$(grep -E -o '(\.[a-z][a-zA-Z0-9\-_]*)*$' <<< "$i")"
extensions+=("${extension:1}")
extension="$(grep -E -o '(\.[a-z][a-zA-Z0-9\-_~]*)*$' <<< "$i")"
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

As we talked about this. Please write down what this grep does and why it's necessary. Lastly, write down where the same function is used as well.

@@ -11,8 +11,8 @@ artifacts=(".build/$cname-$COMMIT.tar" ".build/$cname-$COMMIT.release" ".build/$

for feature in "${features[@]}"; do
for i in "features/$feature/"{image,convert}.*; do
extension="$(grep -E -o '(\.[a-z][a-zA-Z0-9\-_]*)*$' <<< "$i")"
artifacts+=(".build/$cname-$COMMIT$extension")
extension="$(grep -E -o '(\.[a-z][a-zA-Z0-9\-_~]*)*$' <<< "$i")"
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I think the usage of here-string should be stated, not everyone is familiar with this concept of bash. Someone could misread this and only thing of << instead of three. Maybe we could make this a bit more obviously?

Copy link
Contributor

@Akendo Akendo left a comment

Choose a reason for hiding this comment

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

Please the comments I did. In general, we have to add some more documentation and make the code more maintainable. I would to see this for the files that are changed in this PR.

Copy link
Contributor

@Akendo Akendo left a comment

Choose a reason for hiding this comment

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

LGTM

@nkraetzschmar nkraetzschmar merged commit b560928 into main Sep 16, 2024
2 of 3 checks passed
@nkraetzschmar nkraetzschmar deleted the cleanup/secureboot branch September 16, 2024 11:28
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