From 277b4d013233255879ded454d99c2a3a84e468aa Mon Sep 17 00:00:00 2001 From: mikeeq Date: Tue, 3 Dec 2019 02:17:03 +0100 Subject: [PATCH 01/20] Add depends on in kconfig --- templates/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Kconfig b/templates/Kconfig index 0a38368..d29c6a7 100644 --- a/templates/Kconfig +++ b/templates/Kconfig @@ -1,4 +1,4 @@ config TEST_DRIVER + depends on X86_64 tristate "TEST_DRIVER" default y - From 2a3e3d1c15f2413135a6b4635d710d71d3486ca1 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Tue, 3 Dec 2019 10:23:42 +0100 Subject: [PATCH 02/20] Testing adding custom drivers to build --- patch_driver.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patch_driver.sh b/patch_driver.sh index d76fd52..6001b6c 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -28,6 +28,7 @@ rm -rf .git cd .. cp -rfv ${REPO_PWD}/../templates/Kconfig bce/Kconfig sed -i "s/TEST_DRIVER/BCE_DRIVER/g" bce/Kconfig +sed "s/obj-m/obj-$(CONFIG_BCE)/g" bce/Makefile ### apple-ib git clone --single-branch --branch ${APPLE_IB_DRIVER_BRANCH_NAME} https://github.com/roadrunner2/macbook12-spi-driver.git touchbar @@ -37,6 +38,7 @@ rm -rf .git cd .. cp -rfv ${REPO_PWD}/../templates/Kconfig touchbar/Kconfig sed -i "s/TEST_DRIVER/TOUCHBAR_DRIVER/g" touchbar/Kconfig +sed "s/obj-m/obj-$(CONFIG_TOUCHBAR)/g" touchbar/Makefile echo 'obj-$(CONFIG_BCE) += bce/' >> ./Makefile echo 'obj-$(CONFIG_TOUCHBAR) += touchbar/' >> ./Makefile @@ -53,3 +55,5 @@ do echo 'CONFIG_BCE_DRIVER=y' >> $config_file echo 'CONFIG_TOUCHBAR_DRIVER=y' >> $config_file done + +echo -e "bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> mod-extra.list From 4204ad1162c293d9c72982bfc68ca6940293288a Mon Sep 17 00:00:00 2001 From: mikeeq Date: Tue, 3 Dec 2019 10:24:38 +0100 Subject: [PATCH 03/20] Testing adding custom drivers to build v2 --- patch_driver.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patch_driver.sh b/patch_driver.sh index 6001b6c..981e127 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -28,7 +28,7 @@ rm -rf .git cd .. cp -rfv ${REPO_PWD}/../templates/Kconfig bce/Kconfig sed -i "s/TEST_DRIVER/BCE_DRIVER/g" bce/Kconfig -sed "s/obj-m/obj-$(CONFIG_BCE)/g" bce/Makefile +sed -i "s/obj-m/obj-$(CONFIG_BCE)/g" bce/Makefile ### apple-ib git clone --single-branch --branch ${APPLE_IB_DRIVER_BRANCH_NAME} https://github.com/roadrunner2/macbook12-spi-driver.git touchbar @@ -38,7 +38,7 @@ rm -rf .git cd .. cp -rfv ${REPO_PWD}/../templates/Kconfig touchbar/Kconfig sed -i "s/TEST_DRIVER/TOUCHBAR_DRIVER/g" touchbar/Kconfig -sed "s/obj-m/obj-$(CONFIG_TOUCHBAR)/g" touchbar/Makefile +sed -i "s/obj-m/obj-$(CONFIG_TOUCHBAR)/g" touchbar/Makefile echo 'obj-$(CONFIG_BCE) += bce/' >> ./Makefile echo 'obj-$(CONFIG_TOUCHBAR) += touchbar/' >> ./Makefile From 8fad868128c6865b55e667b39fe524ee9197fa22 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Tue, 3 Dec 2019 10:28:21 +0100 Subject: [PATCH 04/20] Add ziping patches and pushing them as artifact --- build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index b6961b8..6c1ed22 100755 --- a/build.sh +++ b/build.sh @@ -16,7 +16,7 @@ cat /proc/cpuinfo | grep 'model name' | uniq # git clone --depth 1 --single-branch --branch v5.1.19 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git ### Dependencies -dnf install -y fedpkg fedora-packager rpmdevtools ncurses-devel pesign git libkcapi libkcapi-devel libkcapi-static libkcapi-tools +dnf install -y fedpkg fedora-packager rpmdevtools ncurses-devel pesign git libkcapi libkcapi-devel libkcapi-static libkcapi-tools zip ### Clone Fedora Kernel git repo git clone --single-branch --branch $FEDORA_KERNEL_BRANCH_NAME https://src.fedoraproject.org/rpms/kernel.git @@ -60,4 +60,9 @@ rpmbuild_exitcode=$? find ~/rpmbuild/ | grep '\.rpm' cp -rfv ~/rpmbuild/RPMS/x86_64/*.rpm /tmp/artifacts/ +### Add patches to artifacts +cd .. +zip -r patches.zip patches/ +cp -rfv patches.zip + exit $rpmbuild_exitcode From 41a5ffb0189172613b082db190555d53b6effdb6 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Tue, 3 Dec 2019 23:43:29 +0100 Subject: [PATCH 05/20] Testing adding custom drivers to build v3 --- patch_driver.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/patch_driver.sh b/patch_driver.sh index 981e127..92bad91 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -52,8 +52,11 @@ git diff HEAD >> ${REPO_PWD}/../patches/custom-drivers.patch cd $REPO_PWD for config_file in $(ls | grep kernel | grep '.config') do - echo 'CONFIG_BCE_DRIVER=y' >> $config_file - echo 'CONFIG_TOUCHBAR_DRIVER=y' >> $config_file + echo 'CONFIG_BCE_DRIVER=m' >> $config_file + echo 'CONFIG_TOUCHBAR_DRIVER=m' >> $config_file done +echo 'CONFIG_BCE_DRIVER=m' > kernel/configs/fedora/generic/CONFIG_BCE_DRIVER +echo 'CONFIG_TOUCHBAR_DRIVER=m' >> kernel/configs/fedora/generic/CONFIG_TOUCHBAR_DRIVER + echo -e "bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> mod-extra.list From dbeecbce9704804161e6f3bbc88cbbccb439b7dd Mon Sep 17 00:00:00 2001 From: mikeeq Date: Wed, 4 Dec 2019 00:02:32 +0100 Subject: [PATCH 06/20] Testing adding custom drivers to build v4 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 6c1ed22..20388a5 100755 --- a/build.sh +++ b/build.sh @@ -63,6 +63,6 @@ cp -rfv ~/rpmbuild/RPMS/x86_64/*.rpm /tmp/artifacts/ ### Add patches to artifacts cd .. zip -r patches.zip patches/ -cp -rfv patches.zip +cp -rfv patches.zip /tmp/artifacts/ exit $rpmbuild_exitcode From d2664f6f11d940d4a07bc60a2476f6236935b356 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Wed, 4 Dec 2019 00:29:00 +0100 Subject: [PATCH 07/20] Testing adding custom drivers to build v5 --- patch_driver.sh | 4 ++-- templates/Kconfig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/patch_driver.sh b/patch_driver.sh index 92bad91..536d956 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -28,7 +28,7 @@ rm -rf .git cd .. cp -rfv ${REPO_PWD}/../templates/Kconfig bce/Kconfig sed -i "s/TEST_DRIVER/BCE_DRIVER/g" bce/Kconfig -sed -i "s/obj-m/obj-$(CONFIG_BCE)/g" bce/Makefile +sed -i 's/obj-m/obj-$(CONFIG_BCE)/g' bce/Makefile ### apple-ib git clone --single-branch --branch ${APPLE_IB_DRIVER_BRANCH_NAME} https://github.com/roadrunner2/macbook12-spi-driver.git touchbar @@ -38,7 +38,7 @@ rm -rf .git cd .. cp -rfv ${REPO_PWD}/../templates/Kconfig touchbar/Kconfig sed -i "s/TEST_DRIVER/TOUCHBAR_DRIVER/g" touchbar/Kconfig -sed -i "s/obj-m/obj-$(CONFIG_TOUCHBAR)/g" touchbar/Makefile +sed -i 's/obj-m/obj-$(CONFIG_TOUCHBAR)/g' touchbar/Makefile echo 'obj-$(CONFIG_BCE) += bce/' >> ./Makefile echo 'obj-$(CONFIG_TOUCHBAR) += touchbar/' >> ./Makefile diff --git a/templates/Kconfig b/templates/Kconfig index d29c6a7..a153d18 100644 --- a/templates/Kconfig +++ b/templates/Kconfig @@ -1,4 +1,4 @@ config TEST_DRIVER depends on X86_64 tristate "TEST_DRIVER" - default y + default m From e9ba75f885401c63a51c555496d37cf95a2bbf16 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Wed, 4 Dec 2019 20:23:54 +0100 Subject: [PATCH 08/20] Testing adding custom drivers to build v6 --- build_in_docker.sh | 15 +++++++++++++++ patch_driver.sh | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 build_in_docker.sh diff --git a/build_in_docker.sh b/build_in_docker.sh new file mode 100644 index 0000000..7c0fe03 --- /dev/null +++ b/build_in_docker.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +DOCKER_IMAGE=fedora:31 +RPMBUILD_HOST_PATH=/opt/rpmbuild + +mkdir -p ${RPMBUILD_HOST_PATH} + +docker pull ${DOCKER_IMAGE} +docker run \ + -t \ + --rm \ + -v $(pwd):/repo \ + -v ${RPMBUILD_HOST_PATH}:/root/rpmbuild \ + ${DOCKER_IMAGE} \ + /bin/bash -c 'cd /repo && ./build.sh' diff --git a/patch_driver.sh b/patch_driver.sh index 536d956..e14c1e1 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -56,7 +56,7 @@ do echo 'CONFIG_TOUCHBAR_DRIVER=m' >> $config_file done -echo 'CONFIG_BCE_DRIVER=m' > kernel/configs/fedora/generic/CONFIG_BCE_DRIVER -echo 'CONFIG_TOUCHBAR_DRIVER=m' >> kernel/configs/fedora/generic/CONFIG_TOUCHBAR_DRIVER +echo 'CONFIG_BCE_DRIVER=m' > configs/fedora/generic/CONFIG_BCE_DRIVER +echo 'CONFIG_TOUCHBAR_DRIVER=m' >> configs/fedora/generic/CONFIG_TOUCHBAR_DRIVER echo -e "bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> mod-extra.list From 0f56db3daceeabdf61b9009b65bb4757ac80cb89 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Wed, 4 Dec 2019 20:58:59 +0100 Subject: [PATCH 09/20] Testing adding custom drivers to build v7 --- patch_driver.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patch_driver.sh b/patch_driver.sh index e14c1e1..ac9f4da 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -60,3 +60,5 @@ echo 'CONFIG_BCE_DRIVER=m' > configs/fedora/generic/CONFIG_BCE_DRIVER echo 'CONFIG_TOUCHBAR_DRIVER=m' >> configs/fedora/generic/CONFIG_TOUCHBAR_DRIVER echo -e "bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> mod-extra.list + +echo 'inputdrvs="gameport tablet touchscreen bce touchbar"' >> filter-x86_64.sh From f039890639d63a71af7d99b047390ca907827a8b Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 14:20:11 +0100 Subject: [PATCH 10/20] Added - Calculate sha256 sums of built RPMs - to build script --- build.sh | 6 +++++- patch_driver.sh | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 20388a5..eafad57 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,7 @@ #!/bin/sh ## Update fedora docker image tag, because kernel build is using `uname -r` when defining package version variable +FEDORA_KERNEL_GIT_URL=https://src.fedoraproject.org/rpms/kernel.git FEDORA_KERNEL_VERSION=5.3.14 FEDORA_KERNEL_BRANCH_NAME=f31 FEDORA_KERNEL_COMMIT_HASH=da7e076b233966319134542bfbdda46388d420ba # Linux v5.3.14 - https://src.fedoraproject.org/rpms/kernel/commits/f31 @@ -19,7 +20,7 @@ cat /proc/cpuinfo | grep 'model name' | uniq dnf install -y fedpkg fedora-packager rpmdevtools ncurses-devel pesign git libkcapi libkcapi-devel libkcapi-static libkcapi-tools zip ### Clone Fedora Kernel git repo -git clone --single-branch --branch $FEDORA_KERNEL_BRANCH_NAME https://src.fedoraproject.org/rpms/kernel.git +git clone --single-branch --branch $FEDORA_KERNEL_BRANCH_NAME ${FEDORA_KERNEL_GIT_URL} cd kernel ## Cleanup rm -rfv *.rpm @@ -60,6 +61,9 @@ rpmbuild_exitcode=$? find ~/rpmbuild/ | grep '\.rpm' cp -rfv ~/rpmbuild/RPMS/x86_64/*.rpm /tmp/artifacts/ +### Calculate sha256 sums of built RPMs +sha256sum ~/rpmbuild/RPMS/x86_64/*.rpm > /tmp/artifacts/sha256 + ### Add patches to artifacts cd .. zip -r patches.zip patches/ diff --git a/patch_driver.sh b/patch_driver.sh index ac9f4da..72ea946 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -1,10 +1,13 @@ #!/bin/sh ### Apple T2 drivers commit hashes +BCE_DRIVER_GIT_URL=https://github.com/MCMrARM/mbp2018-bridge-drv.git BCE_DRIVER_BRANCH_NAME=master BCE_DRIVER_COMMIT_HASH=7330e638b9a32b4ae9ea97857f33838b5613cad3 +APPLE_IB_DRIVER_GIT_URL=https://github.com/roadrunner2/macbook12-spi-driver.git APPLE_IB_DRIVER_BRANCH_NAME=mbp15 APPLE_IB_DRIVER_COMMIT_HASH=90cea3e8e32db60147df8d39836bd1d2a5161871 +APPLE_SMC_DRIVER_GIT_URL=https://github.com/MCMrARM/mbp2018-etc APPLE_SMC_DRIVER_BRANCH_NAME=master APPLE_SMC_DRIVER_COMMIT_HASH=cf42289ad637d3073e2fd348af71ad43dd31b8b4 @@ -14,14 +17,14 @@ echo -e "From: fedora kernel \nSubject: patch custom drivers\ mkdir -p /root/temp cd /root/temp -git clone --single-branch --branch ${APPLE_SMC_DRIVER_BRANCH_NAME} https://github.com/MCMrARM/mbp2018-etc +git clone --single-branch --branch ${APPLE_SMC_DRIVER_BRANCH_NAME} ${APPLE_SMC_DRIVER_GIT_URL} cp -rfv mbp2018-etc/applesmc/patches/* ${REPO_PWD}/../patches/ git clone --depth 1 --single-branch --branch v${FEDORA_KERNEL_VERSION} git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git cd ./linux-stable/drivers ### bce -git clone --depth 1 --single-branch --branch ${BCE_DRIVER_BRANCH_NAME} https://github.com/MCMrARM/mbp2018-bridge-drv.git ./bce +git clone --depth 1 --single-branch --branch ${BCE_DRIVER_BRANCH_NAME} ${BCE_DRIVER_GIT_URL} ./bce cd bce git checkout ${BCE_DRIVER_COMMIT_HASH} rm -rf .git @@ -31,7 +34,7 @@ sed -i "s/TEST_DRIVER/BCE_DRIVER/g" bce/Kconfig sed -i 's/obj-m/obj-$(CONFIG_BCE)/g' bce/Makefile ### apple-ib -git clone --single-branch --branch ${APPLE_IB_DRIVER_BRANCH_NAME} https://github.com/roadrunner2/macbook12-spi-driver.git touchbar +git clone --single-branch --branch ${APPLE_IB_DRIVER_BRANCH_NAME} ${APPLE_IB_DRIVER_GIT_URL} touchbar cd touchbar git checkout ${APPLE_IB_DRIVER_COMMIT_HASH} rm -rf .git From 12bc1099fdb995dd4882cf020f298937ea37f3f9 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 14:49:50 +0100 Subject: [PATCH 11/20] Heroku repo fix --- yum-repo/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yum-repo/Dockerfile b/yum-repo/Dockerfile index c5836e6..06ddf89 100644 --- a/yum-repo/Dockerfile +++ b/yum-repo/Dockerfile @@ -15,6 +15,9 @@ RUN dnf -y install \ RUN wget -A xml.gz -r http://fedora-mbp-repo.herokuapp.com/ \ && wget -A xml -r http://fedora-mbp-repo.herokuapp.com/ \ && wget -A rpm -r http://fedora-mbp-repo.herokuapp.com/ \ + && mv -f ./fedora-mbp-repo.herokuapp.com/fedora-mbp-repo.herokuapp.com/*.rpm ./ \ + && mv -f ./fedora-mbp-repo.herokuapp.com/*.rpm ./ \ + && rm -rfv fedora-mbp-repo.herokuapp.com \ && chown -R nginx:nginx /var/repo RUN for rpm in $(curl -s https://github.com/mikeeq/mbp-fedora-kernel/releases/latest -L | grep rpm | grep span | cut -d'>' -f2 | cut -d'<' -f1); do \ From 465dd2d7d74a0850cddf5fddf88c987dabb5fadb Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 14:57:22 +0100 Subject: [PATCH 12/20] Heroku repo fix v2 --- yum-repo/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yum-repo/Dockerfile b/yum-repo/Dockerfile index 06ddf89..529252b 100644 --- a/yum-repo/Dockerfile +++ b/yum-repo/Dockerfile @@ -15,14 +15,15 @@ RUN dnf -y install \ RUN wget -A xml.gz -r http://fedora-mbp-repo.herokuapp.com/ \ && wget -A xml -r http://fedora-mbp-repo.herokuapp.com/ \ && wget -A rpm -r http://fedora-mbp-repo.herokuapp.com/ \ - && mv -f ./fedora-mbp-repo.herokuapp.com/fedora-mbp-repo.herokuapp.com/*.rpm ./ \ && mv -f ./fedora-mbp-repo.herokuapp.com/*.rpm ./ \ + && rm -rfv *.1 \ && rm -rfv fedora-mbp-repo.herokuapp.com \ && chown -R nginx:nginx /var/repo RUN for rpm in $(curl -s https://github.com/mikeeq/mbp-fedora-kernel/releases/latest -L | grep rpm | grep span | cut -d'>' -f2 | cut -d'<' -f1); do \ wget https://github.com/mikeeq/mbp-fedora-kernel/releases/download/v${RELEASE_VERSION}/$rpm; \ done && \ + && rm -rfv *.1 \ chown -R nginx:nginx /var/repo RUN createrepo /var/repo From e0fda345ca93c5c615dd72ee2f0eff8cd3ff76c0 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 15:27:43 +0100 Subject: [PATCH 13/20] Heroku repo fix v3 --- yum-repo/Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/yum-repo/Dockerfile b/yum-repo/Dockerfile index 529252b..8dee065 100644 --- a/yum-repo/Dockerfile +++ b/yum-repo/Dockerfile @@ -16,15 +16,16 @@ RUN wget -A xml.gz -r http://fedora-mbp-repo.herokuapp.com/ \ && wget -A xml -r http://fedora-mbp-repo.herokuapp.com/ \ && wget -A rpm -r http://fedora-mbp-repo.herokuapp.com/ \ && mv -f ./fedora-mbp-repo.herokuapp.com/*.rpm ./ \ - && rm -rfv *.1 \ + # && mv -f ./fedora-mbp-repo.herokuapp.com/repodata ./ \ && rm -rfv fedora-mbp-repo.herokuapp.com \ - && chown -R nginx:nginx /var/repo + ; rm -rfv *.1 \ + ; chown -R nginx:nginx /var/repo RUN for rpm in $(curl -s https://github.com/mikeeq/mbp-fedora-kernel/releases/latest -L | grep rpm | grep span | cut -d'>' -f2 | cut -d'<' -f1); do \ - wget https://github.com/mikeeq/mbp-fedora-kernel/releases/download/v${RELEASE_VERSION}/$rpm; \ - done && \ - && rm -rfv *.1 \ - chown -R nginx:nginx /var/repo + wget --backups=1 https://github.com/mikeeq/mbp-fedora-kernel/releases/download/v${RELEASE_VERSION}/$rpm; \ + done \ + ; rm -rfv *.1 \ + ; chown -R nginx:nginx /var/repo RUN createrepo /var/repo From 76d800f99d0991daf369d657ea049148c18a5a4a Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 16:07:46 +0100 Subject: [PATCH 14/20] Heroku repo fix v4 --- README.md | 5 +++++ yum-repo/Dockerfile | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ae4714..ceb061a 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,11 @@ Travis kernel publish status - : > Tested on: Macbook Pro 15,2 13" 2019 i5 TouchBar Z0WQ000AR MV972ZE/A/R1 +``` +Boot ROM Version: 220.270.99.0.0 (iBridge: 16.16.6571.0.0,0) +MacOS Mojave: 10.14.6 (18G103) +``` + ### Known issues - 5.2<= kernel random kernel panics - just disable thunderbolt driver diff --git a/yum-repo/Dockerfile b/yum-repo/Dockerfile index 8dee065..bb4ff03 100644 --- a/yum-repo/Dockerfile +++ b/yum-repo/Dockerfile @@ -12,9 +12,9 @@ RUN dnf -y install \ gettext \ && dnf clean all -RUN wget -A xml.gz -r http://fedora-mbp-repo.herokuapp.com/ \ - && wget -A xml -r http://fedora-mbp-repo.herokuapp.com/ \ - && wget -A rpm -r http://fedora-mbp-repo.herokuapp.com/ \ +RUN wget -A rpm -r http://fedora-mbp-repo.herokuapp.com/ \ + # && wget -A xml -r http://fedora-mbp-repo.herokuapp.com/ \ + # && wget -A xml.gz -r http://fedora-mbp-repo.herokuapp.com/ \ && mv -f ./fedora-mbp-repo.herokuapp.com/*.rpm ./ \ # && mv -f ./fedora-mbp-repo.herokuapp.com/repodata ./ \ && rm -rfv fedora-mbp-repo.herokuapp.com \ From 787e48bac216ce0f628d60b581074fd5d1e7832f Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 16:10:29 +0100 Subject: [PATCH 15/20] Update kernel to 5.3.15 --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index eafad57..c861a63 100755 --- a/build.sh +++ b/build.sh @@ -2,9 +2,9 @@ ## Update fedora docker image tag, because kernel build is using `uname -r` when defining package version variable FEDORA_KERNEL_GIT_URL=https://src.fedoraproject.org/rpms/kernel.git -FEDORA_KERNEL_VERSION=5.3.14 +FEDORA_KERNEL_VERSION=5.3.15 FEDORA_KERNEL_BRANCH_NAME=f31 -FEDORA_KERNEL_COMMIT_HASH=da7e076b233966319134542bfbdda46388d420ba # Linux v5.3.14 - https://src.fedoraproject.org/rpms/kernel/commits/f31 +FEDORA_KERNEL_COMMIT_HASH=85835e68c44c2b671df0e670a7b077c78402ac3c # Linux v5.3.15 - https://src.fedoraproject.org/rpms/kernel/commits/f31 ### Debug commands echo "FEDORA_KERNEL_VERSION=$FEDORA_KERNEL_VERSION" From 1707ab72539bb635cb17c272f2c92723106927e7 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 19:16:10 +0100 Subject: [PATCH 16/20] Thunderbolt driver removed from kernel --- build.sh | 2 +- patch_driver.sh | 8 ++++++++ templates/Kconfig | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index c861a63..f6e209d 100755 --- a/build.sh +++ b/build.sh @@ -17,7 +17,7 @@ cat /proc/cpuinfo | grep 'model name' | uniq # git clone --depth 1 --single-branch --branch v5.1.19 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git ### Dependencies -dnf install -y fedpkg fedora-packager rpmdevtools ncurses-devel pesign git libkcapi libkcapi-devel libkcapi-static libkcapi-tools zip +dnf install -y fedpkg fedora-packager rpmdevtools ncurses-devel pesign git libkcapi libkcapi-devel libkcapi-static libkcapi-tools zip curl ### Clone Fedora Kernel git repo git clone --single-branch --branch $FEDORA_KERNEL_BRANCH_NAME ${FEDORA_KERNEL_GIT_URL} diff --git a/patch_driver.sh b/patch_driver.sh index 72ea946..4d7c569 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -27,6 +27,10 @@ cd ./linux-stable/drivers git clone --depth 1 --single-branch --branch ${BCE_DRIVER_BRANCH_NAME} ${BCE_DRIVER_GIT_URL} ./bce cd bce git checkout ${BCE_DRIVER_COMMIT_HASH} +### Patch bce for kernel 5.3 +curl -sL https://raw.githubusercontent.com/mikeeq/mbp-fedora/f31/files/patches/bce_5_3.patch -o /opt/bce_5_3.patch +git apply /opt/bce_5_3.patch + rm -rf .git cd .. cp -rfv ${REPO_PWD}/../templates/Kconfig bce/Kconfig @@ -48,6 +52,10 @@ echo 'obj-$(CONFIG_TOUCHBAR) += touchbar/' >> ./Makefile sed -i "\$i source \"drivers/bce/Kconfig\"\n" Kconfig sed -i "\$i source \"drivers/touchbar/Kconfig\"\n" Kconfig +### Remove thunderbolt driver +rm -rfv thunderbolt + +### Prepare patch git add . git diff HEAD >> ${REPO_PWD}/../patches/custom-drivers.patch diff --git a/templates/Kconfig b/templates/Kconfig index a153d18..b2fd77a 100644 --- a/templates/Kconfig +++ b/templates/Kconfig @@ -1,4 +1,4 @@ -config TEST_DRIVER +menuconfig TEST_DRIVER depends on X86_64 tristate "TEST_DRIVER" default m From 95f2f7afe77e4e183c7b3c6cec09861306c3f39b Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 19:29:31 +0100 Subject: [PATCH 17/20] Thunderbolt driver removed from kernel v2 --- README.md | 2 +- patch_driver.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ceb061a..ba410e3 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ MacOS Mojave: 10.14.6 (18G103) ``` ➜ cat /etc/modprobe.d/blacklist.conf - blacklist applesmc blacklist thunderbolt ``` + - it's working on 5.1, because 5.1 is failing to load thunderbolt firmware - Microphone (it's recognised with new apple t2 sound driver, but there is a low mic volume amp) - Dynamic audio outputs change (on connecting/disconnecting headphones jack) diff --git a/patch_driver.sh b/patch_driver.sh index 4d7c569..cf27a72 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -54,6 +54,7 @@ sed -i "\$i source \"drivers/touchbar/Kconfig\"\n" Kconfig ### Remove thunderbolt driver rm -rfv thunderbolt +sed -i '/source "drivers\/thunderbolt\/Kconfig"/d' Kconfig ### Prepare patch git add . @@ -73,3 +74,7 @@ echo 'CONFIG_TOUCHBAR_DRIVER=m' >> configs/fedora/generic/CONFIG_TOUCHBAR_DRIVER echo -e "bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> mod-extra.list echo 'inputdrvs="gameport tablet touchscreen bce touchbar"' >> filter-x86_64.sh + +sed -i '/CONFIG_THUNDERBOLT=m/d' kernel-x86_64* +sed -i '/CONFIG_THUNDERBOLT_NET=m/d' kernel-x86_64* +sed -i '/CONFIG_INTEL_WMI_THUNDERBOLT=m/d' kernel-x86_64* From 9085cb98d0e048349d11bcc045e821009e5eb619 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 19:38:04 +0100 Subject: [PATCH 18/20] Thunderbolt driver removed from kernel v3 --- patch_driver.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/patch_driver.sh b/patch_driver.sh index cf27a72..a3ec38b 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -76,5 +76,4 @@ echo -e "bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> mod-extra echo 'inputdrvs="gameport tablet touchscreen bce touchbar"' >> filter-x86_64.sh sed -i '/CONFIG_THUNDERBOLT=m/d' kernel-x86_64* -sed -i '/CONFIG_THUNDERBOLT_NET=m/d' kernel-x86_64* -sed -i '/CONFIG_INTEL_WMI_THUNDERBOLT=m/d' kernel-x86_64* +rm -rfv configs/fedora/generic/x86/x86_64/CONFIG_THUNDERBOLT From f38f833c19454fddbc1f9cdd88b9d40f7c9034e8 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 19:58:35 +0100 Subject: [PATCH 19/20] Thunderbolt driver removed from kernel v4 --- patch_driver.sh | 6 +----- templates/Kconfig | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/patch_driver.sh b/patch_driver.sh index a3ec38b..7818a60 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -52,10 +52,6 @@ echo 'obj-$(CONFIG_TOUCHBAR) += touchbar/' >> ./Makefile sed -i "\$i source \"drivers/bce/Kconfig\"\n" Kconfig sed -i "\$i source \"drivers/touchbar/Kconfig\"\n" Kconfig -### Remove thunderbolt driver -rm -rfv thunderbolt -sed -i '/source "drivers\/thunderbolt\/Kconfig"/d' Kconfig - ### Prepare patch git add . git diff HEAD >> ${REPO_PWD}/../patches/custom-drivers.patch @@ -72,8 +68,8 @@ echo 'CONFIG_BCE_DRIVER=m' > configs/fedora/generic/CONFIG_BCE_DRIVER echo 'CONFIG_TOUCHBAR_DRIVER=m' >> configs/fedora/generic/CONFIG_TOUCHBAR_DRIVER echo -e "bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> mod-extra.list - echo 'inputdrvs="gameport tablet touchscreen bce touchbar"' >> filter-x86_64.sh +### Remove thunderbolt driver sed -i '/CONFIG_THUNDERBOLT=m/d' kernel-x86_64* rm -rfv configs/fedora/generic/x86/x86_64/CONFIG_THUNDERBOLT diff --git a/templates/Kconfig b/templates/Kconfig index b2fd77a..b294a5f 100644 --- a/templates/Kconfig +++ b/templates/Kconfig @@ -1,4 +1,4 @@ menuconfig TEST_DRIVER - depends on X86_64 tristate "TEST_DRIVER" + depends on X86 || COMPILE_TEST default m From 9d90a9a600a528ad8c42fa6ee2d593f129a6c5e9 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Thu, 5 Dec 2019 20:06:19 +0100 Subject: [PATCH 20/20] Thunderbolt driver removed from kernel v5 --- patch_driver.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patch_driver.sh b/patch_driver.sh index 7818a60..ab56675 100755 --- a/patch_driver.sh +++ b/patch_driver.sh @@ -71,5 +71,5 @@ echo -e "bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> mod-extra echo 'inputdrvs="gameport tablet touchscreen bce touchbar"' >> filter-x86_64.sh ### Remove thunderbolt driver -sed -i '/CONFIG_THUNDERBOLT=m/d' kernel-x86_64* -rm -rfv configs/fedora/generic/x86/x86_64/CONFIG_THUNDERBOLT +sed -i "s/CONFIG_THUNDERBOLT=m/CONFIG_THUNDERBOLT=n/g" kernel-x86_64* +sed -i "s/CONFIG_THUNDERBOLT=m/CONFIG_THUNDERBOLT=n/g" configs/fedora/generic/x86/x86_64/CONFIG_THUNDERBOLT