2.42. kmod-26

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

Configuration

src_config()
{
    ./configure \
        --prefix=${PREFIX} \
        --bindir=/bin \
        --sysconfdir=/etc \
        --with-rootlibdir=/lib \
        --with-xz \
        --with-zlib
}

Compilation

src_compile()
{
    make ${MAKEOPTS}
}

Installation

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

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

Build code

kmod.build

Other files

meta.txt

Links

url.lfs: https://linuxfromscratch.org/lfs/view/9.1/chapter06/kmod.html