-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkernel-installation.sh
More file actions
executable file
·42 lines (37 loc) · 1.35 KB
/
kernel-installation.sh
File metadata and controls
executable file
·42 lines (37 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set -e
source /etc/os-release
if [ "${ID}" = "ubuntu" ] ; then
echo "Ubuntu - Install kernel"
# Download mainline kernel packages, kernel up to 5.13 available in ubuntu 20.04 and 22.04 have a broken NAT implementation.
cd /tmp
wget --no-directories \
--no-parent \
--accept-regex generic \
--recursive \
--execute robots=off \
https://kernel.ubuntu.com/mainline/${UBUNTU_MAINLINE_KERNEL_VERSION}/amd64/
apt-get install --yes \
/tmp/linux-image* \
/tmp/linux-modules* \
cpufrequtils \
intel-microcode
else
echo "Debian - Install kernel"
cat <<EOF > /etc/apt/sources.list
deb http://deb.debian.org/debian trixie main contrib non-free-firmware
deb http://deb.debian.org/debian trixie-updates main contrib non-free-firmware
deb http://security.debian.org/debian-security trixie-security main contrib non-free-firmware
EOF
apt update && apt install -y intel-microcode linux-image-${KERNEL_VERSION}-amd64 linux-cpupower
fi
# Remove WIFI, netronome, v4l and liquidio firmware to save ~300MB image size
rm -rf /usr/lib/firmware/*wifi* \
/usr/lib/firmware/amd* \
/usr/lib/firmware/liquidio \
/usr/lib/firmware/mrvl \
/usr/lib/firmware/netronome \
/usr/lib/firmware/qcom \
/usr/lib/firmware/v4l* \
/var/lib/apt/lists/* \
/tmp/*