From 9bda8b4955c635fe2fb9d2c934e0cbe42b401537 Mon Sep 17 00:00:00 2001 From: Aditya Date: Sat, 14 Jan 2023 22:07:25 +0530 Subject: [PATCH] Add 10.3 - Build kernel --- scripts/chapter10/10.3-kernel.sh | 37 ++++++++++++++++++++++++++++++++ scripts/main.sh | 12 +++++++++++ 2 files changed, 49 insertions(+) create mode 100644 scripts/chapter10/10.3-kernel.sh diff --git a/scripts/chapter10/10.3-kernel.sh b/scripts/chapter10/10.3-kernel.sh new file mode 100644 index 0000000..93cd7af --- /dev/null +++ b/scripts/chapter10/10.3-kernel.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +cd /sources +tar xf linux-5.19.2.tar.xz +cd linux-5.19.2 + +make mrproper + +make menuconfig + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make modules_install + +cp -iv System.map /boot/System.map-5.19.2 +cp -iv .config /boot/config-5.19.2 + +install -d /usr/share/doc/linux-5.19.2 +cp -r Documentation/* /usr/share/doc/linux-5.19.2 + +install -v -m755 -d /etc/modprobe.d +cat > /etc/modprobe.d/usb.conf << "EOF" +# Begin /etc/modprobe.d/usb.conf + +install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i ohci_hcd ; true +install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i uhci_hcd ; true + +# End /etc/modprobe.d/usb.conf +EOF + +cd /sources +rm -rf linux-5.19.2 diff --git a/scripts/main.sh b/scripts/main.sh index 4f63299..18e9057 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1560,3 +1560,15 @@ then stop_script "chapter10/10.2-fstab.sh" fi +# Chapter 10.3 +# ============ +echo "Building kernel" +su -c "bash $SCRIPT/chapter10/10.3-kernel.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter10/10.3-kernel.sh" +fi +