git: stand/boot: Fix rel_rootpath() to avoid duplicate "/boot" prefix

Aaron LI aly at crater.dragonflybsd.org
Sun Feb 16 21:10:43 PST 2025


commit e6595d94a170aa2f1c4b4b3ffae00601847078cb
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Feb 17 12:54:52 2025 +0800

    stand/boot: Fix rel_rootpath() to avoid duplicate "/boot" prefix
    
    When the /boot is on the root filesystem instead of being a separate
    filesystem (e.g., the ISO/IMG installation media), the loader was
    setting DirBase to be "/boot/<kernelname>", which already had the
    "/boot" prefix.  And then rel_rootpath() would return
    "/boot/boot/kernel/kernel" for the default kernel (i.e., name "kernel"
    and boot file "kernel").
    
    In that case, loadfile() would set "kernelname=/boot/boot/kernel/kernel"
    and derive "exported_module_path=/boot/boot/kernel;/boot/modules.local".
    Then boot() would move "exported_module_path" to "module_path", which
    finally be the value of "kern.module_path" sysctl.  As a result,
    kldload(8) would fail to load a module without specifying its full path.
    
    This patch fixes the above issue.
    
    Suggested-by: swildner

Summary of changes:
 stand/boot/common/rel_open.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e6595d94a170aa2f1c4b4b3ffae00601847078cb


-- 
DragonFly BSD source repository


More information about the Commits mailing list