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

fix(livenet): some fixes related to getting live image size (bsc#1235912) (SLE15-SP6:Update) #389

Conversation

aafeijoo-suse
Copy link
Collaborator

Some servers send `content-length` instead of `Content-Length`, so ignore the
case. E.g.:

```
> curl -sIL https://pkg.adfinis.com/opensuse/tumbleweed/iso/openSUSE-Tumbleweed-DVD-x86_64-Snapshot20240118-Media.iso
HTTP/2 200
server: nginx
date: Fri, 19 Jan 2024 16:29:54 GMT
content-type: application/octet-stream
content-length: 4643094528
last-modified: Fri, 19 Jan 2024 03:34:00 GMT
etag: "65a9eda8-114c00000"
accept-ranges: bytes
```
…essage

If `curl` fails to reach the URL of the live image, or if the header received
does not provide `Content-Length`, the error message displayed is misleading.

```
[    8.118432] dracut-initqueue[800]: /usr/sbin/livenetroot: line 21: / (1024 * 1024): syntax error: operand expected (error token is "/ (1024 * 1024)")
```

Therefore, split the calculation and provide proper error messages.

Reported-by: Knut Anderssen <[email protected]>

bsc#1235912
@aafeijoo-suse aafeijoo-suse requested a review from tblume as a code owner January 16, 2025 10:45
Copy link
Collaborator

@tblume tblume left a comment

Choose a reason for hiding this comment

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

Yeah, the second pr is not directly necessary to fix the bug.
Still, that feature is related and should be implemented IMHO.

Copy link

@LaszloGombos LaszloGombos left a comment

Choose a reason for hiding this comment

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

lgtm

@LaszloGombos
Copy link

lgtm

Sorry, did not mean to comment in this repo.

@aafeijoo-suse
Copy link
Collaborator Author

Yeah, the second pr is not directly necessary to fix the bug. Still, that feature is related and should be implemented IMHO.

Thanks Thomas. Just to clarify, by "implemented" do you mean "backported" to SP6?

@tblume
Copy link
Collaborator

tblume commented Jan 16, 2025

Thanks Thomas. Just to clarify, by "implemented" do you mean "backported" to SP6?

Yes, I mean backported.

@aafeijoo-suse
Copy link
Collaborator Author

Thanks Thomas. Just to clarify, by "implemented" do you mean "backported" to SP6?

Yes, I mean backported.

Ok, I'll start fixing the bug, the new feature has to go to factory first.

@aafeijoo-suse aafeijoo-suse merged commit 22e941b into openSUSE:SLE-15-SP6_Update Jan 16, 2025
1 of 2 checks passed
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.

3 participants