Merge pull request #61 from marcosfad/feature/addWifi

Add wifi
This commit is contained in:
marcosfad 2022-03-29 22:14:12 +02:00 committed by GitHub
commit d2d1c37fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 29 deletions

View File

@ -10,6 +10,8 @@ on:
type: string
default: ''
description: (optional) Choose kernel version to use from T2Linux. Without the "v".
env:
KERNEL_VERSION: ${{ github.event.inputs.KERNEL_VERSION }}
jobs:
build:
@ -19,9 +21,13 @@ jobs:
- name: Configure variables
id: variables
if: ${{ inputs.KERNEL_VERSION == '' }}
env:
KERNEL_VERSION: ${{ env.KERNEL_VERSION }}
run: |
KERNEL_VERSION=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | grep "${MBP_VERSION}" | cut -d'/' -f6 | head -n1 | cut -d'v' -f2)
if [ -z "${KERNEL_VERSION}" ]; then
echo "KERNEL_VERSION not set, calculating it"
KERNEL_VERSION=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | grep "${MBP_VERSION}" | cut -d'/' -f6 | head -n1 | cut -d'v' -f2)
fi
echo "::set-output name=build::${KERNEL_VERSION}"
- name: Download kernel packages

View File

@ -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

View File

@ -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

View File

@ -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 <https://wiki.t2linux.org/distributions/ubuntu/installation/> for more detai
## Configuration
- See <https://wiki.t2linux.org/guides/wifi/>
- 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 <https://wiki.t2linux.org/guides/wifi/>
- 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 <https://askubuntu.com/questions/149876/how-can-i-install-one-language-by-command-line>
- 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: <https://github.com/free5lot/hid-apple-patched>
@ -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
@ -97,6 +99,22 @@ GRUB_TIMEOUT=10
and then:
`sudo update-grub`
### Crashes with amdgpu or shutdown issues
Try to disable the power management by adding `amdgpu.dpm=0` to the kernel command line or disabling it temporarily using:
```shell
echo high | sudo tee /sys/bus/pci/drivers/amdgpu/0000:??:??.?/power_dpm_force_performance_level
```
if that fix the issue for you, you can make this change permanent using:
```shell
sudo su
cat << EOF > /etc/udev/rules.d/30-amdgpu-pm.rules
KERNEL=="card0", SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_force_performance_level}="high"
EOF
```
## Update to newer kernels
**IF YOU UPDATE THE KERNEL, REMEMBER TO ADD THE REQUIRED DRIVERS AGAIN.**

View File

@ -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... "

View File

@ -29,11 +29,6 @@ echo >&2 "===]> Info: Install systemd and Ubuntu MBP Repo... "
apt-get install -y systemd-sysv gnupg curl wget
mkdir -p /etc/apt/sources.list.d
echo "deb https://mbp-ubuntu-kernel.herokuapp.com/ /" >/etc/apt/sources.list.d/mbp-ubuntu-kernel.list
curl -L https://mbp-ubuntu-kernel.herokuapp.com/KEY.gpg | apt-key add -
apt-get update
echo >&2 "===]> Info: Configure machine-id and divert... "
dbus-uuidgen >/etc/machine-id
@ -43,7 +38,6 @@ ln -s /bin/true /sbin/initctl
echo >&2 "===]> Info: Install packages needed for Live System... "
# todo: Install the latest kernel automatically
export DEBIAN_FRONTEND=noninteractive
apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
ubuntu-standard \
@ -64,7 +58,6 @@ apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="
linux-firmware \
grub-efi-amd64-signed \
intel-microcode \
linux-headers-azure \
thermald
echo >&2 "===]> Info: Add firmwares"
@ -113,10 +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 "===]> Configure amdgpu"
cat << EOF > /etc/udev/rules.d/30-amdgpu-pm.rules
KERNEL=="card0", SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_force_performance_level}="high"
EOF
#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

BIN
files/wifi/iso-firmware.deb Normal file

Binary file not shown.