From 52aa4aa16bdb93c7c94c5648f8416d86fef6bbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Miotk?= Date: Tue, 28 Jun 2022 09:48:09 +0200 Subject: [PATCH] Fedora Kernel v5.18.6 F36 (#63) * Fedora v5.18.6 F36 release --- .github/workflows/build-iso.yml | 30 +++++++++-- README.md | 23 ++++----- build.sh | 29 ++++++----- build_in_docker.sh | 1 + build_local.sh | 1 + fedora-mbp-gnome.ks | 2 + fedora-mbp-kde.ks | 2 + fedora-mbp.ks | 51 ++++--------------- .../98-mbp-regenerate-grub-cfg.ks | 2 +- 9 files changed, 68 insertions(+), 73 deletions(-) create mode 100644 fedora-mbp-gnome.ks create mode 100644 fedora-mbp-kde.ks diff --git a/.github/workflows/build-iso.yml b/.github/workflows/build-iso.yml index 62973ee..e7fe3cd 100644 --- a/.github/workflows/build-iso.yml +++ b/.github/workflows/build-iso.yml @@ -1,6 +1,7 @@ --- name: Build Fedora ISO +# yamllint disable-line rule:truthy on: [push] jobs: @@ -17,7 +18,7 @@ jobs: -w /repo \ -v $(pwd):/repo \ -t \ - alpine:3.13 /bin/sh -c " \ + alpine:3.16 /bin/sh -c " \ apk add --no-cache py-pip python3 bash \ && pip3 install yamllint \ && yamllint -s . \ @@ -29,22 +30,43 @@ jobs: -w /repo \ -v $(pwd):/repo \ -t \ - alpine:3.13 /bin/sh -c " \ + alpine:3.16 /bin/sh -c " \ apk add --no-cache shellcheck bash \ && shellcheck $(find . -type f -name "*.sh" | tr '\n' ' ') " - build: + build-gnome: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: "Build Fedora ISO" run: ./build_in_docker.sh + env: + FEDORA_DESKTOP_ENV: gnome + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + tag_name: ${{ github.ref }} + name: Release gnome ${{ github.ref }} + draft: true + files: | + ./output_zip/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # You don't need to add this in secrets it's by default. + build-kde: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: "Build Fedora ISO" + run: ./build_in_docker.sh + env: + FEDORA_DESKTOP_ENV: kde - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.ref }} - name: Release ${{ github.ref }} + name: Release kde ${{ github.ref }} draft: true files: | ./output_zip/* diff --git a/README.md b/README.md index d96b4c3..613df77 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,10 @@ Fedora ISO with Apple T2 patches built-in (Macbooks produced >= 2018). -All available Apple T2 drivers are integrated with this iso. Most things work, besides those mentioned in [not working section](#not-working). +All available Apple T2 drivers and patches are integrated into this ISO. -Kernel - - -Drivers: - -- Apple T2 (audio, keyboard, touchpad) - -- Apple SMC - -- Touchbar - +Kernel: +Kernel patches: > Tested on: Macbook Pro 15,2 13" 2019 i5 TouchBar Z0WQ000AR MV972ZE/A/R1 && Macbook Pro 16,2 13" 2020 i5 @@ -115,7 +110,7 @@ sudo -i # Upgrade kernel beforehand ## update_kernel_mbp has built-in selfupgrade function, so when it fails it's just due to script update - please rerun everything should be good on second run -KERNEL_VERSION="5.17.6-f36" UPDATE_SCRIPT_BRANCH="v5.17-f36" update_kernel_mbp +KERNEL_VERSION="5.18.6-f36" UPDATE_SCRIPT_BRANCH="v5.18-f36" update_kernel_mbp # Upgrade your OS dnf upgrade -y --refresh @@ -138,9 +133,11 @@ dnf clean all ## Not working -- Dynamic audio input/output change (on connecting/disconnecting headphones jack) - TouchID - (@MCMrARM is working on it - https://github.com/Dunedan/mbp-2016-linux/issues/71#issuecomment-528545490) -- Microphone (it's recognised with new apple t2 sound driver, but there is a low mic volume amp) +- Audio + - Dynamic audio input/output change (on connecting/disconnecting headphones jack) + - manual switch works, see here: + - Microphone (it's recognized with new apple t2 sound driver, but there is a low mic volume amp) ## TODO @@ -188,8 +185,6 @@ dnf clean all 81:1 ``` -- verify `brcmf_chip_tcm_rambase` returns - ## Known issues - Kernel/Mac related issues are mentioned in kernel repo @@ -237,6 +232,7 @@ dnf clean all - ArchLinux kernel patches: - ArchLinux installation guide: - hid-apple-patched module for changing mappings of ctrl, fn, option keys: +- AdityaGarg8 kernel patches: ## Credits @@ -245,3 +241,4 @@ dnf clean all - @roadrunner2 - thanks for SPI (touchbar) driver - @aunali1 - thanks for ArchLinux Kernel CI - @ppaulweber - thanks for keyboard and Macbook Air patches +- @AdityaGarg8 - thanks for support and upkeeping kernel patches diff --git a/build.sh b/build.sh index a39af63..7ccc584 100755 --- a/build.sh +++ b/build.sh @@ -6,11 +6,13 @@ CURRENT_PWD=$(pwd) FEDORA_VERSION=36 FEDORA_KICKSTARTS_GIT_URL=https://pagure.io/fedora-kickstarts.git FEDORA_KICKSTARTS_BRANCH_NAME=f36 -FEDORA_KICKSTARTS_COMMIT_HASH=a69afdb7e04c06cde624a9de2444d755e95ee8b4 # https://pagure.io/fedora-kickstarts/commits/f36 +FEDORA_KICKSTARTS_COMMIT_HASH=dfbad4bdf5f5b9c6a93b3b192bfe91580ac08915 # https://pagure.io/fedora-kickstarts/commits/f36 LIVECD_TOOLS_GIT_URL=https://github.com/mikeeq/livecd-tools LIVECD_TOOLS_GIT_BRANCH_NAME=feature/fix-f35-build LIVECD_CACHE_PATH=/var/cache/live -ARTIFACT_NAME="livecd-mbp-${FEDORA_KICKSTARTS_BRANCH_NAME}-$(date +'%Y%m%d').zip" + +FEDORA_DESKTOP_ENV="${FEDORA_DESKTOP_ENV:-}" +ARTIFACT_NAME="livecd-mbp-${FEDORA_KICKSTARTS_BRANCH_NAME}-${FEDORA_DESKTOP_ENV}-$(date +'%Y%m%d').zip" ### Debug commands echo "FEDORA_KICKSTARTS_BRANCH_NAME=${FEDORA_KICKSTARTS_BRANCH_NAME}" @@ -20,7 +22,7 @@ ls echo "CPU threads: $(nproc --all)" grep 'model name' /proc/cpuinfo | uniq -### Dependencies +echo >&2 "===]> Info: Installing dependencies..." # dnf install -y git zip livecd-tools-27.1-9.fc34.x86_64 dnf install -y \ git \ @@ -29,7 +31,7 @@ dnf install -y \ make \ livecd-tools -### Install livecd-tools fix +echo >&2 "===]> Info: Install livecd-tools fix" [ -x "$(command -v python)" ] || ln -s /usr/bin/python3 /usr/bin/python git clone --single-branch --branch ${LIVECD_TOOLS_GIT_BRANCH_NAME} ${LIVECD_TOOLS_GIT_URL} /tmp/livecd-tools @@ -37,17 +39,17 @@ cd /tmp/livecd-tools make install cd "${CURRENT_PWD}" -### Copy efibootmgr fix for anaconda +echo >&2 "===]> Info: Copy efibootmgr fix for anaconda" mkdir -p /tmp/kickstart_files/ cp -rfv files/* /tmp/kickstart_files/ -### Clone Fedora kickstarts repo +echo >&2 "===]> Info: Clone Fedora kickstarts repo" git clone --single-branch --branch ${FEDORA_KICKSTARTS_BRANCH_NAME} ${FEDORA_KICKSTARTS_GIT_URL} /tmp/fedora-kickstarts cd /tmp/fedora-kickstarts git checkout $FEDORA_KICKSTARTS_COMMIT_HASH -### Copy fedora-mbp kickstart file -cp -rfv "${CURRENT_PWD}"/fedora-mbp.ks ./ +echo >&2 "===]> Info: Copy fedora-mbp kickstart file" +cp -rfv "${CURRENT_PWD}"/fedora-mbp*.ks ./ mkdir -p ${LIVECD_CACHE_PATH} ### Workaround - travis_wait @@ -58,19 +60,20 @@ do done & bgPID=$! -### Generate LiveCD iso -livecd-creator --verbose --releasever=${FEDORA_VERSION} --config=fedora-mbp.ks --cache=${LIVECD_CACHE_PATH} +echo >&2 "===]> Info: Generate LiveCD iso - fedora-mbp-${FEDORA_DESKTOP_ENV}.ks" +livecd-creator --verbose --releasever=${FEDORA_VERSION} --config="fedora-mbp-${FEDORA_DESKTOP_ENV}.ks" --cache=${LIVECD_CACHE_PATH} livecd_exitcode=$? -### Move iso artifact to repo dir +echo >&2 "===]> Info: Move iso artifact to repo dir" cp -rfv ./*.iso "${CURRENT_PWD}"/ cd "${CURRENT_PWD}" -### Zip iso and split it into multiple parts - github max size of release attachment is 2GB, where ISO is sometimes bigger than that +echo >&2 "===]> Info: Zip iso and split it into multiple parts" +# Github max size of release attachment is 2GB, where ISO is sometimes bigger than that mkdir -p ./output_zip zip -s 1000m ./output_zip/"${ARTIFACT_NAME}" ./*.iso -### Calculate sha256 sums of built ISO +echo >&2 "===]> Info: Calculate sha256 sums of built ISO" sha256sum ./output_zip/* > ./output_zip/sha256 sha256sum ./*.iso >> ./output_zip/sha256 diff --git a/build_in_docker.sh b/build_in_docker.sh index c9985e3..e2c1631 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -8,6 +8,7 @@ docker pull ${DOCKER_IMAGE} docker run \ --privileged \ --rm \ + -e FEDORA_DESKTOP_ENV="${FEDORA_DESKTOP_ENV:-gnome}" \ -t \ -v "$(pwd)":/repo \ ${DOCKER_IMAGE} \ diff --git a/build_local.sh b/build_local.sh index 6d2af5b..d74409d 100755 --- a/build_local.sh +++ b/build_local.sh @@ -11,6 +11,7 @@ LIVECD_CACHE_PATH=/var/cache/live docker run \ --privileged \ --rm \ + -e FEDORA_DESKTOP_ENV="${FEDORA_DESKTOP_ENV:-gnome}" \ -t \ -v "$(pwd)":/repo \ -v /dev:/dev \ diff --git a/fedora-mbp-gnome.ks b/fedora-mbp-gnome.ks new file mode 100644 index 0000000..bfb62c0 --- /dev/null +++ b/fedora-mbp-gnome.ks @@ -0,0 +1,2 @@ +%include fedora-mbp.ks +%include fedora-live-workstation.ks diff --git a/fedora-mbp-kde.ks b/fedora-mbp-kde.ks new file mode 100644 index 0000000..829a3ec --- /dev/null +++ b/fedora-mbp-kde.ks @@ -0,0 +1,2 @@ +%include fedora-mbp.ks +%include fedora-live-kde.ks diff --git a/fedora-mbp.ks b/fedora-mbp.ks index ee9d3b2..02cdeaa 100644 --- a/fedora-mbp.ks +++ b/fedora-mbp.ks @@ -8,30 +8,18 @@ bootloader --append="enforcing=0 efi=noruntime pcie_ports=compat" eula --agreed ### Install kernel from hosted rpm repo +# https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#chapter-9-package-selection %packages -git -gcc -gcc-c++ -make +curl iwd wpa_supplicant --shim-ia32-15.4-*.x86_64 --shim-x64-15.4-*.x86_64 +-shim-ia32-15.[0-9]*-[0-9].x86_64 +-shim-x64-15.[0-9]*-[0-9].x86_64 -kernel-5.*.fc36.x86_64 --kernel-core-5.*.fc36.x86_64 --kernel-devel-5.*.fc36.x86_64 --kernel-devel-matched-5.*.fc36.x86_64 --kernel-modules-5.*.fc36.x86_64 --kernel-modules-extra-5.*.fc36.x86_64 --kernel-modules-internal-5.*.fc36.x86_64 -kernel-5.17.6-300.mbp.fc33.x86_64 -kernel-core-5.17.6-300.mbp.fc33.x86_64 -kernel-devel-5.17.6-300.mbp.fc33.x86_64 -kernel-devel-matched-5.17.6-300.mbp.fc33.x86_64 -kernel-modules-5.17.6-300.mbp.fc33.x86_64 -kernel-modules-extra-5.17.6-300.mbp.fc33.x86_64 -kernel-modules-internal-5.17.6-300.mbp.fc33.x86_64 +kernel-*.*[0-9].mbp.fc34.x86_64 + +## Install mbp-fedora-kernel and remove newer shim than 15-8 %end @@ -51,30 +39,12 @@ echo 'nameserver 8.8.8.8' > /etc/resolv.conf echo "===]> Info: Print /etc/resolv.conf" cat /etc/resolv.conf -KERNEL_VERSION=5.17.6-300.mbp.fc33.x86_64 -UPDATE_SCRIPT_BRANCH=v5.17-f36 -BCE_DRIVER_GIT_URL=https://github.com/t2linux/apple-bce-drv -BCE_DRIVER_BRANCH_NAME=aur -BCE_DRIVER_COMMIT_HASH=f93c6566f98b3c95677de8010f7445fa19f75091 -APPLE_IB_DRIVER_GIT_URL=https://github.com/Redecorating/apple-ib-drv -APPLE_IB_DRIVER_BRANCH_NAME=mbp15 -APPLE_IB_DRIVER_COMMIT_HASH=467df9b11cb55456f0365f40dd11c9e666623bf3 +KERNEL_VERSION=5.18.6-200.mbp.fc34.x86_64 +UPDATE_SCRIPT_BRANCH=v5.18-f36 ### Remove not compatible kernels rpm -e $(rpm -qa | grep kernel | grep -v headers | grep -v oops | grep -v wifi | grep -v mbp) -### Install custom drivers -mkdir -p /opt/drivers -git clone --single-branch --branch ${BCE_DRIVER_BRANCH_NAME} ${BCE_DRIVER_GIT_URL} /opt/drivers/bce -git -C /opt/drivers/bce/ checkout ${BCE_DRIVER_COMMIT_HASH} - -git clone --single-branch --branch ${APPLE_IB_DRIVER_BRANCH_NAME} ${APPLE_IB_DRIVER_GIT_URL} /opt/drivers/touchbar -git -C /opt/drivers/touchbar/ checkout ${APPLE_IB_DRIVER_COMMIT_HASH} -PATH=/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin make -C /lib/modules/${KERNEL_VERSION}/build/ M=/opt/drivers/bce modules -PATH=/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin make -C /lib/modules/${KERNEL_VERSION}/build/ M=/opt/drivers/touchbar modules -cp -rf /opt/drivers/bce/*.ko /lib/modules/${KERNEL_VERSION}/extra/ -cp -rf /opt/drivers/touchbar/*.ko /lib/modules/${KERNEL_VERSION}/extra/ - ### Add custom drivers to be loaded at boot echo -e 'hid-apple\nbcm5974\nsnd-seq\napple_bce' > /etc/modules-load.d/apple_bce.conf echo -e 'add_drivers+=" hid_apple snd-seq apple_bce "\nforce_drivers+=" hid_apple snd-seq apple_bce "' > /etc/dracut.conf @@ -95,7 +65,6 @@ sed -i '/^type=rpm.*/a exclude=kernel,kernel-core,kernel-devel,kernel-devel-matc %end - %post --nochroot ### Copy grub config without finding macos partition cp -rfv /tmp/kickstart_files/grub/30_os-prober ${INSTALL_ROOT}/etc/grub.d/30_os-prober @@ -115,5 +84,3 @@ cp -rfv /tmp/kickstart_files/suspend/rmmod_tb.sh ${INSTALL_ROOT}/lib/systemd/sys chmod +x ${INSTALL_ROOT}/lib/systemd/system-sleep/rmmod_tb.sh %end - -%include fedora-live-workstation.ks diff --git a/files/post-install-kickstart/98-mbp-regenerate-grub-cfg.ks b/files/post-install-kickstart/98-mbp-regenerate-grub-cfg.ks index 4c5336a..a9f7eea 100644 --- a/files/post-install-kickstart/98-mbp-regenerate-grub-cfg.ks +++ b/files/post-install-kickstart/98-mbp-regenerate-grub-cfg.ks @@ -2,7 +2,7 @@ GRUB_CMDLINE_VALUE=$(grep -v '#' /etc/default/grub | grep -w GRUB_CMDLINE_LINUX | cut -d'"' -f2) -for i in efi=noruntime pcie_ports=compat modprobe.blacklist=thunderbolt; do +for i in efi=noruntime pcie_ports=compat; do if ! echo "$GRUB_CMDLINE_VALUE" | grep -w $i; then GRUB_CMDLINE_VALUE="$GRUB_CMDLINE_VALUE $i" fi