-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_source
executable file
·32 lines (24 loc) · 1.01 KB
/
prepare_source
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
pkg=linux
version_orig=6.6.63
version="$version_orig-0"
(
kernel_repo=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
debian_repo=https://salsa.debian.org/kernel-team/linux.git
debian_ref="debian/6.6.15-2"
tmp_dir="$(mktemp -d)"
trap 'cd / && rm -rf "$tmp_dir"' EXIT
cd "$tmp_dir"
git clone --depth 1 --branch "$debian_ref" "$debian_repo" linux
cd linux
apt-get install --no-install-recommends -y python3-debian # needed for genorig
debian/bin/genorig.py --override-version "$version_orig" "$kernel_repo"
git clean -fdx
auto_decompress ../*.orig.tar.* | tee "$dir/orig.tar" | tar --extract --strip-components 1 --directory "$dir/src"
cp -r debian "$dir/src/"
)
rm -rf "$dir/src/debian/config"
cp -r config "$dir/src/debian/"
rm "$dir/src/debian/patches/debian/Revert-docs-kernel_feat.py-fix-potential-command-inj.patch"
sed -i '/debian\/Revert-docs-kernel_feat\.py-fix-potential-command-inj\.patch/d' "$dir/src/debian/patches/series"
apply_patches fixes_debian
import_upstream_patches