qLinux
… a distribution study


<< Prev
Inetutils

Next >>
Libelf from Elfutils


Kmod-29

Reference: 8.46. Kmod-29. Fix the build system:

patch -Np1 -i kmod-29-bld-20220206.patch

Apply a patch to fix the sources:

patch -Np1 -i kmod-29-src-20220420.patch

Build the package:

./configure --prefix=/qlnx \
            --sysconfdir=/qlnx/etc \
            --with-xz \
            --with-zstd \
            --with-zlib \
            --datarootdir=/qlnx/dat \
            --mandir=/qlnx/man \
            --includedir=/qlnx/inc
make

Fix content of man pages if desired1):

sed -i '/qlnx/!s|/lib/modules|/qlnx/lib/modules|g;
        s|/proc/modules|/qlnx/prc/modules|g' man/*.5 man/*.8
make install

Create symlinks for compatibility:

for f in depmod insmod modinfo modprobe rmmod; do
  ln -sfv kmod /qlnx/bin/$f
done

cp /qlnx/bin/kmod /qlnx/bin/lsmod
chmod 0744 /qlnx/bin/kmod

Only the  lsmod  command is allowed for ordinary users, thus we have to make a copy and not a link.

Later on, when we build the kernel, the modules will be installed in the non standard location  /qlnx/lib/modules . To prevent to give the path as an option to some kmod utilities always, we create some wrappers:

echo "#!/qlnx/bin/sh\nexec /qlnx/bin/depmod -b /qlnx $@"   >  /exec/depmod
echo "#!/qlnx/bin/sh\nexec /qlnx/bin/modinfo -b /qlnx $@"  >  /exec/modinfo
echo "#!/qlnx/bin/sh\nexec /qlnx/bin/modprobe -d /qlnx $@" > /exec/modprobe
chmod 0754 /exec/depmod /exec/modprobe

<< Prev
Inetutils

        

Next >>
Libelf from Elfutils

1)
doing this before causes m4 to rebuild the man pages from the xml sources which will fail in this state