3.45. kmod-29

#!/bin/sh
# Copyright © 1999-2022 Gerard Beekmans
# Copyright © 2017-2022 Random Crew
# Distributed under the terms of MIT License.

Configuration

Only single version of LFS includes ssl support in config.

src_config()
{
    ssl_support=
    case ${LFS_VERSION} in
        11.1)
            ssl_support='--with-openssl'
        ;;
    esac

    ./configure \
        --prefix=${PREFIX} \
        --sysconfdir=/etc \
        ${ssl_support} \
        --with-xz \
        --with-zstd \
        --with-zlib
}

Compilation

src_compile()
{
    make ${MAKEOPTS}
}

Installation

src_install()
{
    make install ${MAKEOPTS} DESTDIR=${D}

    mkdir -p ${D}${PREFIX}/sbin
    for target in depmod insmod modinfo modprobe rmmod; do
        ln -sf ../bin/kmod ${D}${PREFIX}/sbin/$target
    done
    
    ln -sf kmod ${D}${PREFIX}/bin/lsmod
}

Build code

kmod.build

Other files

meta.txt
text

Links

url.lfs: https://linuxfromscratch.org/lfs/view/11.0/chapter08/kmod.html
url.lfs.stage1: