Skip to content

Commit aec669f

Browse files
committed
Arch linux custom kernel build from upstream linux kernel source
Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
1 parent bb31a4a commit aec669f

File tree

1 file changed

+11
-26
lines changed

1 file changed

+11
-26
lines changed

ArchLinux_custom_kernel_build.sh

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
11
#!/usr/bin/env bash
2-
3-
# This script is to build custom arch linux kernel from upstream linux kernel
4-
# source
5-
6-
# Author: Bhaskar Chowdhury
7-
# Date: Tue 11 Mar 2025 03:47:05 AM IST
8-
# Email: unixbhaskar@gmail.com
9-
10-
# License (GPL v2.0)
11-
12-
# This program is free software: you can redistribute it and/or modify
13-
# it under the terms of the GNU General Public License as published by
14-
# the Free Software Foundation, either version 3 of the License, or
15-
# (at your option) any later version.
16-
#
17-
# This program is distributed in the hope that it will be useful,
18-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20-
# GNU General Public License for more details.
21-
22-
232
get_make=$(command -v make)
243
get_elapsed_time="/usr/bin/time -f"
254
untar_it="tar -xJvf"
265
get_it=$(command -v secure_kernel_tarball)
276
NOTIFY=$(command -v notify-send)
7+
NOCOLOR="\033[0m"
288
DT=$(date '+%d%m%Y')
299
build_dir="/home/bhaskar/custom_kernel_$(hostname)_$DT"
3010

@@ -64,7 +44,7 @@ cd linux-$kernel
6444

6545
sed -i '8d' scripts/package/PKGBUILD
6646
sed -i '8i _extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers}' scripts/package/PKGBUILD
67-
sed -i '114,125 s/^/#/' scripts/package/PKGBUILD
47+
sed -i '113,125 s/^/#/' scripts/package/PKGBUILD
6848

6949
# Creating a new checksum, because we have modified the PKGBUILD file
7050

@@ -87,9 +67,13 @@ grep DEBUG_INFO .config
8767
# Enable USB storage module for external HDD
8868
scripts/config --enable USB_STORAGE
8969

70+
# Enable crypto_lz4
71+
scripts/config --enable CRYPTO_LZ4
72+
9073
# Set the local version of the operating system name
9174
scripts/config --set-str LOCALVERSION "-Archlinux"
9275

76+
9377
#Make sure the flags symbols are set correctly with an updated value
9478
#$get_make ARCH=x86_64 olddefconfig
9579
yes '' | make localmodconfig
@@ -121,12 +105,13 @@ then
121105

122106
printf "\n Now install the generated headers,kernel and doc packages with pacman .. \n\n\n"
123107

108+
find . -name "linux-upstream*" -a ! -name "*.sig" -type f -exec sudo pacman -U --noconfirm {} \;
124109

125-
sudo pacman -U --noconfirm linux-upstream-$kernel_Archlinux-1-x86_64.pkg.tar.zst
110+
# sudo pacman -U --noconfirm linux-upstream-${kernel}_Archlinux-1-x86_64.pkg.tar.zst
126111

127-
sudo pacman -U --noconfirm linux-upstream-headers-$kernel_Archinux-1-x86_64.pkg.tar.zst
112+
# sudo pacman -U --noconfirm linux-upstream-headers-${kernel}_Archlinux-1-x86_64.pkg.tar.zst
128113

129-
sudo pacman -U --noconfirm linux-upstream-api-headers-$kernel_Archlinux-1-x86_64.pkg.tar.zst
114+
# sudo pacman -U --noconfirm linux-upstream-api-headers-${kernel}_Archlinux-1-x86_64.pkg.tar.zst
130115

131116
else
132117
echo Something went wrong, manually check.
@@ -140,7 +125,7 @@ read response
140125

141126
if [[ $response == "S" ]];then
142127
#Get the stable kernel from kernel.org
143-
kernel=$(curl -s https://www.kernel.org/ | grep -A1 'stable:' | grep -oP '(?<=strong>).*(?=</strong.*)' | grep 6.13)
128+
kernel=$(curl -s https://www.kernel.org/ | grep -A1 'stable:' | grep -oP '(?<=strong>).*(?=</strong.*)' | grep 6.14)
144129
elif [[ $response == "M" ]];then
145130
#Get the mainline kernel from kernel.org
146131
kernel=$(curl -s https://www.kernel.org/ | grep -A1 'mainline:' | grep -oP '(?<=strong>).*(?=</strong.*)')

0 commit comments

Comments
 (0)