From d3ec0c7ff1c46122cb6a45263a675f7044011982 Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 12 Jan 2023 14:19:36 +0530 Subject: [PATCH] Add 8.47 - Build kmod --- scripts/chapter8/8.47-kmod.sh | 36 +++++++++++++++++++++++++++++++++++ scripts/main.sh | 12 ++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 scripts/chapter8/8.47-kmod.sh diff --git a/scripts/chapter8/8.47-kmod.sh b/scripts/chapter8/8.47-kmod.sh new file mode 100644 index 0000000..ccd3b0f --- /dev/null +++ b/scripts/chapter8/8.47-kmod.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +cd /sources +tar xf kmod-30.tar.xz +cd kmod-30 + +./configure --prefix=/usr \ + --sysconfdir=/etc \ + --with-openssl \ + --with-xz \ + --with-zstd \ + --with-zlib + + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make install + +for target in depmod insmod modinfo modprobe rmmod; do + ln -sfv ../bin/kmod /usr/sbin/$target +done + +ln -sfv kmod /usr/bin/lsmod + +cd /sources +rm -rf kmod-30 diff --git a/scripts/main.sh b/scripts/main.sh index d9067f5..6fd40bc 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1103,3 +1103,15 @@ then exit 1 fi +# Chapter 8.47 +# ============ +echo "Building kmod" +su -c "bash $SCRIPT/chapter8/8.47-kmod.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter8/8.47-kmod.sh" +fi +