-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-Multi-Stage
68 lines (64 loc) · 1.95 KB
/
Jenkinsfile-Multi-Stage
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
timestamps {
node () {
stage ('Downloading Kernel Source') {
sh """
cd /jenkins/kernel/
if [[ ! -e linux-4.19.2 ]]; then
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.19.2.tar.xz
tar -xf linux-4.19.2.tar.xz
fi
"""
}
stage ('Install build dependencies') {
sh """
cd /jenkins/kernel/linux-4.19.2
sudo yum install -y yum-utils rsync
sudo yum-builddep kernel.spec -y
sudo yum-builddep binkernel.spec -y
sudo yum-builddep kernel -y
"""
}
stage ('Apply patch to kernel source') {
sh """
cd /jenkins/kernel/linux-4.19.2
sudo patch -p1 -i "${env.WORKSPACE}@script/hp-acpi-hack.patch"
"""
}
stage ('Update .config') {
sh """
cd /jenkins/kernel/linux-4.19.2
if [[ ! -e /jenkins/kernel/linux-4.19.2/drivers/video/displaylink ]]; then
sudo mkdir /jenkins/kernel/linux-4.19.2/drivers/video/displaylink -p
fi
sudo cp -f "${env.WORKSPACE}@script/evdi_Kconfig" /jenkins/kernel/linux-4.19.2/drivers/video/displaylink/Kconfig
sudo cp -f "${env.WORKSPACE}@script/config" ./.config
sudo make olddefconfig
"""
}
stage ('Add Displaylink support') {
sh """
rm -Rf evdi
git clone https://github.com/DisplayLink/evdi.git
sudo rsync -a evdi/* /jenkins/kernel/linux-4.19.2/drivers/video/displaylink/
grep -q -F 'obj-\$(CONFIG_STM) += video/displaylink/' /jenkins/kernel/linux-4.19.2/drivers/Makefile || echo 'obj-\$(CONFIG_STM) += video/displaylink/' >> /jenkins/kernel/linux-4.19.2/drivers/Makefile
grep -q -F 'source "drivers/video/displaylink/Kconfig"' /jenkins/kernel/linux-4.19.2/drivers/Kconfig || echo 'source "drivers/video/displaylink/Kconfig"' >> /jenkins/kernel/linux-4.19.2/drivers/Kconfig
"""
}
stage ('Compile Kernel') {
sh """
cd /jenkins/kernel/linux-4.19.2
# sudo make binrpm-pkg -j 2
sudo make clean
sudo make rpm-pkg -j 2
"""
}
stage ('Cleanup') {
sh """
rm -Rf evdi
cd /jenkins/kernel/linux-4.19.2
sudo patch -p1 -i "${env.WORKSPACE}@script/hp-acpi-hack.patch" -R
# sudo make distclean
"""
}
}
}