git: stand: Fix zf_open() by providing 'zalloc' and 'zfree' hooks

Aaron LI aly at crater.dragonflybsd.org
Tue Apr 7 09:27:54 PDT 2026


commit 353d27543a1d16f8eefdc38e985cde280a4e9008
Author: Aaron LI <aly at aaronly.me>
Date:   Wed Apr 8 00:05:02 2026 +0800

    stand: Fix zf_open() by providing 'zalloc' and 'zfree' hooks
    
    When Z_SOLO is defined, zlib is built for a standalone environment,
    where there is no host memory management, so the caller must provides
    the 'zalloc' and 'zfree' hooks.  Otherwise, inflateInit2() would return
    -2 (Z_STREAM_ERROR).
    
    This fixes the failure of booting into rescue mode because loader failed
    to decompress 'initrd.img.gz':
    ```
    zf_open: inflateInit returned -2 : (null)
    Unable to load /kernel/initrd.img
    ```

Summary of changes:
 stand/lib/gzipfs.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/353d27543a1d16f8eefdc38e985cde280a4e9008


-- 
DragonFly BSD source repository


More information about the Commits mailing list