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

Backport upstream fixes to 059 #308

Merged
merged 4 commits into from
Jan 22, 2024

Commits on Jan 22, 2024

  1. fix(dracut): correct regression with multiple rd.break= options

    Since the introduction of the `dracut-util` binary to parse kernel command line
    arguments, if the user inputs multiple `rd.break=` options, dracut only stops
    the boot process at the last one.
    
    ```
    [    0.985362] localhost dracut-cmdline[245]: /bin/dracut-cmdline@18(): info 'Using kernel command line parameters:' ' ... rd.debug rd.break=cmdline rd.break=pre-pivot'
    ...
    [    1.044979] localhost dracut-cmdline[245]: /bin/dracut-cmdline@48(): getarg rd.break=cmdline -d rdbreak=cmdline
    [    1.044979] localhost dracut-cmdline[245]: /lib/dracut-lib.sh@155(getarg): debug_off
    [    1.044979] localhost dracut-cmdline[245]: /lib/dracut-lib.sh@23(debug_off): set +x
    [    1.044979] localhost dracut-cmdline[245]: /lib/dracut-lib.sh@218(getarg): return 1
    ```
    
    For options that can be specified multiple times, `getargs` should be used
    instead.
    
    ```
    master> export CMDLINE="rd.break=cmdline rd.break=pre-udev rd.break=pre-pivot"
    master> ./dracut-getarg rd.break=cmdline
    master> echo $?
    1
    master> ./dracut-getarg rd.break=pre-udev
    master> echo $?
    1
    master> ./dracut-getarg rd.break=pre-pivot
    master> echo $?
    0
    master> ./dracut-getargs rd.break=cmdline
    cmdline
    master> echo $?
    0
    master> ./dracut-getargs rd.break=pre-udev
    pre-udev
    master> echo $?
    0
    master> ./dracut-getargs rd.break=pre-pivot
    pre-pivot
    master> echo $?
    0
    ```
    
    Fixes 501d82f
    aafeijoo-suse committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    3950f80 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    469faf7 View commit details
    Browse the repository at this point in the history
  3. fix(livenet): check also content-length from live image header

    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
    ```
    aafeijoo-suse committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    a572e23 View commit details
    Browse the repository at this point in the history
  4. fix(livenet): split imgsize calculation to avoid misleading error m…

    …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]>
    aafeijoo-suse committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    87c8f82 View commit details
    Browse the repository at this point in the history