forked from alexellis/actions-batch
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlinux-kernel.sh
More file actions
51 lines (39 loc) · 1.26 KB
/
linux-kernel.sh
File metadata and controls
51 lines (39 loc) · 1.26 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
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Build a minimal Linux kernel without modules.
set -e -x -o pipefail
# Example by Alex Ellis
export BRANCH=${BRANCH:-"v6.0"}
echo "Installing build dependencies"
time sudo apt update -qqqy && \
sudo apt-get install -qqqy \
git \
build-essential \
fakeroot \
libncurses5-dev \
libssl-dev \
ccache \
bison \
flex \
libelf-dev \
dwarves \
bc \
--no-install-recommends
echo "Cloning Linux Kernel branch $BRANCH"
time git clone https://github.com/torvalds/linux.git linux.git --depth=1 --branch $BRANCH && \
cd linux.git && \
scripts/config --disable SYSTEM_TRUSTED_KEYS && \
scripts/config --disable SYSTEM_REVOCATION_KEYS && \
make oldconfig
if [ "$(uname -m)" = "aarch64" ]; then
echo "Building for ARM64"
time make Image -j$(nproc) && mkdir -p ../uploads
# Save the resulting Kernel binary so that it's downloaded to the user's computer
cp ./arch/arm64/boot/Image ../uploads/
else
echo "Building for x86_64"
make -j$(nproc) vmlinux && mkdir -p ../uploads
# Save the resulting Kernel binary so that it's downloaded to the user's computer
cp vmlinux ../uploads/
fi
echo "Build complete, size of Kernel:"
du -h ../uploads/