Skip to content

Commit

Permalink
Fedora Kernel v5.18.6 F36 (#63)
Browse files Browse the repository at this point in the history
* Fedora v5.18.6 F36 release
  • Loading branch information
mikeeq authored Jun 28, 2022
1 parent c90bd0c commit 52aa4aa
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 73 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/build-iso.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Build Fedora ISO

# yamllint disable-line rule:truthy
on: [push]

jobs:
Expand All @@ -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 . \
Expand All @@ -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/*
Expand Down
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 - <https://github.com/mikeeq/mbp-fedora-kernel>

Drivers:

- Apple T2 (audio, keyboard, touchpad) - <https://github.com/MCMrARM/mbp2018-bridge-drv>
- Apple SMC - <https://github.com/MCMrARM/mbp2018-etc>
- Touchbar - <https://github.com/roadrunner2/macbook12-spi-driver/tree/mbp15>
Kernel: <https://github.com/mikeeq/mbp-fedora-kernel>
Kernel patches: <https://github.com/AdityaGarg8/linux-t2-patches>

> Tested on: Macbook Pro 15,2 13" 2019 i5 TouchBar Z0WQ000AR MV972ZE/A/R1 && Macbook Pro 16,2 13" 2020 i5
Expand Down Expand Up @@ -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
Expand All @@ -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: <https://github.com/mikeeq/mbp-fedora#todo>
- Microphone (it's recognized with new apple t2 sound driver, but there is a low mic volume amp)
## TODO
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -237,6 +232,7 @@ dnf clean all
- ArchLinux kernel patches: <https://github.com/ppaulweber/linux-mba>
- ArchLinux installation guide: <https://gist.github.com/TRPB/437f663b545d23cc8a2073253c774be3>
- hid-apple-patched module for changing mappings of ctrl, fn, option keys: <https://github.com/free5lot/hid-apple-patched>
- AdityaGarg8 kernel patches: <https://github.com/AdityaGarg8/linux-t2-patches>
## Credits
Expand All @@ -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
29 changes: 16 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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 \
Expand All @@ -29,25 +31,25 @@ 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
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
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions build_in_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
1 change: 1 addition & 0 deletions build_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions fedora-mbp-gnome.ks
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
%include fedora-mbp.ks
%include fedora-live-workstation.ks
2 changes: 2 additions & 0 deletions fedora-mbp-kde.ks
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
%include fedora-mbp.ks
%include fedora-live-kde.ks
51 changes: 9 additions & 42 deletions fedora-mbp.ks
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion files/post-install-kickstart/98-mbp-regenerate-grub-cfg.ks
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52aa4aa

Please sign in to comment.