From 6596b9cf711c2ce5cfbfb8160722b5cb445420ff Mon Sep 17 00:00:00 2001 From: marcosfad Date: Tue, 29 Mar 2022 20:25:58 +0200 Subject: [PATCH] Add wifi driver --- .github/workflows/CI.yml | 8 -------- 01_build_file_system.sh | 12 +++++++++++- 02_build_image.sh | 12 ------------ README.md | 6 ++++-- build.sh | 3 ++- files/chroot_build.sh | 6 ++++-- 6 files changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9fbffb..a312b06 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,14 +19,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: debug - env: - TEST: ${{ github.event.inputs.KERNEL_VERSION }} - run: - echo "inputs.KERNEL_VERSION ${{ github.event.inputs.KERNEL_VERSION}}" - echo "env.KERNEL_VERSION ${{env.KERNEL_VERSION}}" - echo "env.TEST ${{env.TEST}}" - - name: Configure variables id: variables env: diff --git a/01_build_file_system.sh b/01_build_file_system.sh index 6218bc9..607df2f 100755 --- a/01_build_file_system.sh +++ b/01_build_file_system.sh @@ -23,9 +23,19 @@ umount "${CHROOT_PATH}/dev" ### Add update_kernel_mbp script echo >&2 "===]> Info: Add update_kernel_mbp script... " -curl -L https://raw.githubusercontent.com/marcosfad/mbp-ubuntu/master/update_kernel_mbp.sh -o /usr/bin/update_kernel_mbp +cp -r "${ROOT_PATH}/files/update_kernel_mbp.sh" /usr/bin/update_kernel_mbp chmod +x /usr/bin/update_kernel_mbp +### Add wifi firmware script +echo >&2 "===]> Info: Add wifi firmware... " +cp -r "${ROOT_PATH}/files/wifi/iso-firmware.deb" "${CHROOT_PATH}"/usr/src/iso-firmware.deb + +### Add example to fix amdgpu power manager +echo >&2 "===]> Configure amdgpu" +cat << EOF > "${CHROOT_PATH}"/usr/src/udev_rules_d_30-amdgpu-pm.rules +KERNEL=="card0", SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_force_performance_level}="high" +EOF + ### Copy grub config without finding macos partition echo >&2 "===]> Info: Patch Grub... " cp -rfv "${ROOT_PATH}"/files/grub/30_os-prober "${CHROOT_PATH}"/etc/grub.d/30_os-prober diff --git a/02_build_image.sh b/02_build_image.sh index a37ff41..585da3b 100755 --- a/02_build_image.sh +++ b/02_build_image.sh @@ -34,26 +34,14 @@ submenu "Ubuntu, with Linux $file" { linux /casper/vmlinuz-$file file=/cdrom/preseed/mbp.seed boot=casper ro efi=noruntime pcie_ports=compat --- initrd /casper/initrd-$file } - menuentry "Try Ubuntu FS without installing (blacklist=thunderbolt)" { - linux /casper/vmlinuz-$file file=/cdrom/preseed/mbp.seed boot=casper ro efi=noruntime pcie_ports=compat --- modprobe.blacklist=thunderbolt - initrd /casper/initrd-$file - } menuentry "Install Ubuntu FS" { linux /casper/vmlinuz-$file preseed/file=/cdrom/preseed/mbp.seed boot=casper only-ubiquity efi=noruntime pcie_ports=compat --- initrd /casper/initrd-$file } - menuentry "Install Ubuntu FS (blacklist=thunderbolt)" { - linux /casper/vmlinuz-$file preseed/file=/cdrom/preseed/mbp.seed boot=casper only-ubiquity efi=noruntime pcie_ports=compat --- modprobe.blacklist=thunderbolt - initrd /casper/initrd-$file - } menuentry "Check disc for defects" { linux /casper/vmlinuz-$file boot=casper integrity-check efi=noruntime enforcing=0 efi=noruntime pcie_ports=compat --- initrd /casper/initrd-$file } - menuentry "Check disc for defects (blacklist=thunderbolt)" { - linux /casper/vmlinuz-$file boot=casper integrity-check efi=noruntime enforcing=0 efi=noruntime pcie_ports=compat --- modprobe.blacklist=thunderbolt - initrd /casper/initrd-$file - } } EOF done diff --git a/README.md b/README.md index 9742e43..93aa7f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mbp-ubunt. +# mbp-ubuntu UBUNTU 20.04 ISO with Apple T2 patches built-in. The ISO in from this repo should allow you to install ubuntu without using an external keyboard or mouse on a MacBook Pro. It work in my MacBook with T2. @@ -73,7 +73,8 @@ See for more detai ## Configuration -- See +- If wifi do not work out of the box, you can try to install the firmware using `sudo dpkg -i /usr/src/iso-firmware.deb` + More details you can find on - To install additional languages, install appropriate langpack via apt `sudo apt-get install language-pack-[cod] language-pack-gnome-[cod] language-pack-[cod]-base language-pack-gnome-[cod]-base ` - see - You can change mappings of ctrl, fn, option keys (PC keyboard mappings) by creating `/etc/modprobe.d/hid_apple.conf` file and recreating grub config. All available modifications could be found here: @@ -84,6 +85,7 @@ options hid_apple swap_opt_cmd=1 ``` - I switch the touchbar to show f* by default. If you like another configuration, change /etc/modprobe.d/apple-tb.conf or remove it. - To update grub, run: `grub-mkconfig -o /boot/grub/grub.cfg` +- If you have problems with shutdown and your mac has an AMD video Card, try deactivating the dpm on kernel (by adding `amdgpu.dpm=0` to the kernel options) or use copy the udev rule (`sudo cp /usr/src/udev_rules_d_30-amdgpu-pm.rules /etc/udev/rules.d/30-amdgpu-pm.rules`) ## MISC diff --git a/build.sh b/build.sh index 08188ac..4b2ddaa 100755 --- a/build.sh +++ b/build.sh @@ -29,7 +29,8 @@ apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::=" dosfstools \ zip \ isolinux \ - syslinux + syslinux \ + curl echo >&2 "===]> Info: Start building... " diff --git a/files/chroot_build.sh b/files/chroot_build.sh index ae358b3..b7364a7 100755 --- a/files/chroot_build.sh +++ b/files/chroot_build.sh @@ -106,8 +106,10 @@ sed -i "s/COMPRESS=lz4/COMPRESS=gzip/g" "/etc/initramfs-tools/initramfs.conf" printf '\n### applespi start ###\napple_ib_tb\napple_ib_als\n### applespi end ###' >> /etc/modules-load.d/applespi.conf printf '\n# display f* key in touchbar\noptions apple-ib-tb fnmode=2\n' >> /etc/modprobe.d/apple-touchbar.conf -echo >&2 "===]> Info: Install wifi firmware... " -dpkg -i /tmp/setup_files/wifi/iso-firmware.deb +#if [ -d /tmp/setup_files/wifi/iso-firmware.deb ]; then +# echo >&2 "===]> Info: Install wifi firmware... " +# dpkg -i /tmp/setup_files/wifi/iso-firmware.deb +#fi #echo >&2 "===]> Info: install mpbfan ... " #git clone https://github.com/networkException/mbpfan /tmp/mbpfan