Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit 8fbe002

Browse files
committed
Kernel: update to 5.10.47
1 parent e3b51af commit 8fbe002

9 files changed

+1656
-255083
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/patches/custom-drivers.patch
22
/releases
33
/linux-*
4+
.idea/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
Ubuntu/Mint/Debian kernel 5.6+ with Apple T2 patches built-in. This repo try to keep up with kernel new releases.
44

5-
We release 2 alternative kernels: **"mbp"** which includes all patches from [Aunali1's linux mbp arch](https://github.com/aunali1/linux-mbp-arch) which should work in mostly everywhere and an alternative release (**"mbp-alt"**) which do not include the patch 2001 (drm amd display force link-rate).
5+
The release kernel **"mbp"** includes all patches from [Aunali1's linux mbp arch](https://github.com/aunali1/linux-mbp-arch) which should work almost everywhere.
66

7-
**!! Warning:**
7+
**!! Warning:**
88

99
Starting from the kernel 5.8 the release naming were switch with respect to kernel 5.7: Before the "mbp" release did not include all the patches. **Now the "mbp" includes all patches** and the "mbp-alt" don't.
1010

build.sh

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ set -eu -o pipefail
44

55
## Update docker image tag, because kernel build is using `uname -r` when defining package version variable
66
# KERNEL_VERSION=$(curl -s https://www.kernel.org | grep '<strong>' | head -3 | tail -1 | cut -d'>' -f3 | cut -d'<' -f1)
7-
KERNEL_VERSION=5.9.7
7+
KERNEL_VERSION=5.10.47
88
#KERNEL_REPOSITORY=git://kernel.ubuntu.com/virgin/linux-stable.git
9-
KERNEL_REPOSITORY=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
9+
KERNEL_REPOSITORY=https://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack
1010
REPO_PATH=$(pwd)
1111
WORKING_PATH=/root/work
1212
KERNEL_PATH="${WORKING_PATH}/linux-kernel"
@@ -35,72 +35,75 @@ get_next_version () {
3535
### Clean up
3636
rm -rfv ./*.deb
3737

38-
mkdir "${WORKING_PATH}" && cd "${WORKING_PATH}"
39-
cp -rf "${REPO_PATH}"/{patches,templates} "${WORKING_PATH}"
38+
mkdir -p "${WORKING_PATH}" && cd "${WORKING_PATH}"
39+
mkdir -p "${WORKING_PATH}/patches"
40+
cp -rf "${REPO_PATH}"/templates "${WORKING_PATH}"
4041
rm -rf "${KERNEL_PATH}"
4142

42-
### Dependencies
43+
# Install Build Dependencies
4344
export DEBIAN_FRONTEND=noninteractive
44-
apt-get update
45-
apt-get install -y build-essential fakeroot libncurses-dev bison flex libssl-dev libelf-dev \
46-
openssl dkms libudev-dev libpci-dev libiberty-dev autoconf wget xz-utils git \
47-
bc rsync cpio dh-modaliases debhelper kernel-wedge curl
45+
apt-get update \
46+
&& apt-get upgrade -y \
47+
&& apt-get install -y --no-install-recommends \
48+
autoconf automake autopoint autotools-dev bsdmainutils debhelper dh-autoreconf git fakeroot\
49+
dh-strip-nondeterminism distro-info-data dwz file gettext gettext-base groff-base \
50+
intltool-debian libarchive-zip-perl libbsd0 libcroco3 libdebhelper-perl libelf1 libexpat1 \
51+
libfile-stripnondeterminism-perl libglib2.0-0 libicu66 libmagic-mgc libmagic1 libmpdec2 \
52+
libpipeline1 libpython3-stdlib libpython3.8-minimal libpython3.8-stdlib libsigsegv2 \
53+
libssl1.1 libsub-override-perl libtool libuchardet0 libxml2 \
54+
lsb-release m4 man-db mime-support po-debconf python-apt-common python3 python3-apt \
55+
python3-minimal python3.8 python3.8-minimal sbsigntool tzdata dctrl-tools kernel-wedge \
56+
libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev \
57+
libiberty-dev autoconf bc build-essential libusb-1.0-0-dev libhidapi-dev curl wget \
58+
cpio makedumpfile libcap-dev libnewt-dev libdw-dev rsync gnupg2 ca-certificates\
59+
libunwind8-dev liblzma-dev libaudit-dev uuid-dev libnuma-dev lz4 xmlto equivs \
60+
cmake pkg-config zstd
61+
62+
63+
# Build dwarves (depends on libbpf) tools using the latest ubuntu (impish) source packages
64+
mkdir /dwarves \
65+
&& cd /dwarves \
66+
&& echo "deb-src http://archive.ubuntu.com/ubuntu impish main universe" > /etc/apt/sources.list.d/impish-sources.list \
67+
&& chown _apt /dwarves \
68+
&& apt-get update \
69+
&& apt-get source libbpf \
70+
&& sdir=$(find . -name 'libbpf*' -type d) \
71+
&& cd $sdir \
72+
&& sed -i -re 's/debhelper-compat \(= 13\)/debhelper-compat \(= 12\)/' debian/control \
73+
&& dpkg-buildpackage \
74+
&& cd .. && dpkg -i libbpf-dev_*_amd64.deb libbpf0_*_amd64.deb \
75+
&& apt-get source dwarves-dfsg \
76+
&& sdir=$(find . -name 'dwarves*' -type d) \
77+
&& cd $sdir \
78+
&& sed -i -re 's/debhelper-compat \(= 13\)/debhelper-compat \(= 12\)/' debian/control \
79+
&& dpkg-buildpackage \
80+
&& cd .. && dpkg -i dwarves_*_amd64.deb \
81+
&& cd / && rm -rf /dwarves \
82+
&& apt-get remove --purge --auto-remove -y && rm -rf /var/lib/apt/lists/*
4883

4984
### get Kernel
50-
git clone --depth 1 --single-branch --branch "v${KERNEL_VERSION}" \
51-
"${KERNEL_REPOSITORY}" "${KERNEL_PATH}"
85+
git clone --depth 1 --single-branch --branch "cod/mainline/v${KERNEL_VERSION}" "${KERNEL_REPOSITORY}" "${KERNEL_PATH}"
5286
cd "${KERNEL_PATH}" || exit
5387

5488
#### Create patch file with custom drivers
5589
echo >&2 "===]> Info: Creating patch file... "
5690
KERNEL_VERSION="${KERNEL_VERSION}" WORKING_PATH="${WORKING_PATH}" "${REPO_PATH}/patch_driver.sh"
5791

58-
#### Apply patches
59-
cd "${KERNEL_PATH}" || exit
60-
61-
echo >&2 "===]> Info: Applying patches... "
62-
[ ! -d "${WORKING_PATH}/patches" ] && {
63-
echo 'Patches directory not found!'
64-
exit 1
65-
}
66-
67-
68-
while IFS= read -r file; do
69-
echo "==> Adding $file"
70-
patch -p1 <"$file"
71-
done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | grep -vE '[2]00[0-9]' | sort)
72-
73-
chmod a+x "${KERNEL_PATH}"/debian/rules
74-
chmod a+x "${KERNEL_PATH}"/debian/scripts/*
75-
chmod a+x "${KERNEL_PATH}"/debian/scripts/misc/*
76-
7792
echo >&2 "===]> Info: Bulding src... "
7893

7994
cd "${KERNEL_PATH}"
80-
make clean
81-
cp "${WORKING_PATH}/templates/default-config" "${KERNEL_PATH}/.config"
82-
make olddefconfig
83-
84-
# Get rid of the dirty tag
85-
echo "" >"${KERNEL_PATH}"/.scmversion
8695

87-
# Build Deb packages
88-
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp KDEB_PKGVERSION="$(make kernelversion)-$(get_next_version mbp-alt)"
96+
sed -i -re 's/dwarves/dwarves (>=1.17-1)/g' debian.master/control.stub.in
8997

90-
# Create alternative Kernel
91-
echo >&2 "===]> Info: Create alternative kernel ... "
92-
make distclean
9398
make clean
94-
while IFS= read -r file; do
95-
echo "==> Adding $file"
96-
patch -p1 <"$file"
97-
done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | grep -E '[2]00[0-9]' | sort)
9899
cp "${WORKING_PATH}/templates/default-config" "${KERNEL_PATH}/.config"
99100
make olddefconfig
101+
102+
# Get rid of the dirty tag
100103
echo "" >"${KERNEL_PATH}"/.scmversion
101104

102105
# Build Deb packages
103-
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp-alt KDEB_PKGVERSION="$(make kernelversion)-$(get_next_version mbp)"
106+
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp KDEB_PKGVERSION="${KERNEL_VERSION}-$(get_next_version mbp)"
104107

105108
#### Copy artifacts to shared volume
106109
echo >&2 "===]> Info: Copying debs and calculating SHA256 ... "

patch_driver.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ BUILD_PATH=/tmp/build-kernel
66

77
### Apple T2 drivers commit hashes
88
# Patches
9-
APPLE_SMC_DRIVER_GIT_URL=https://github.com/marcosfad/linux-mbp-arch.git
10-
APPLE_SMC_DRIVER_BRANCH_NAME=release/5.9
11-
APPLE_SMC_DRIVER_COMMIT_HASH=01519664be9474c1cf5b92e37bd87a8d98283915
9+
APPLE_SMC_DRIVER_GIT_URL=https://github.com/aunali1/linux-mbp-arch.git
10+
APPLE_SMC_DRIVER_BRANCH_NAME=master
11+
APPLE_SMC_DRIVER_COMMIT_HASH=1faa37d704798bc04104a88f620e4f55b3466de0
1212
## BCE
1313
#APPLE_BCE_DRIVER_GIT_URL=https://github.com/aunali1/mbp2018-bridge-drv.git
1414
#APPLE_BCE_DRIVER_BRANCH_NAME=aur

0 commit comments

Comments
 (0)