(Tested with ubuntu 18.04, kernel 5.4.0-65, if you fail in the build, please download your own kernel source, see bottom description)
After IOS14, the USB tethering no loger works with libimobiledevice when the Linux kernel is lower than 5.10.4, see the issue
Here is a quick fix by rebuilding the ipheth driver with the revised code. To use it, follow the steps:
git clone https://github.com/potato1992/Iphone_usb_tethering_fix.git
cd Iphone_usb_tethering_fix/
chmod +x ./install.sh
sudo bash ./install.sh
sudo cp /lib/modules/$(uname -r)/kernel/drivers/net/usb/ipheth.ko /lib/modules/$(uname -r)/kernel/drivers/net/usb/ipheth.ko.bak
sudo rmmod ipheth
sudo cp ipheth.ko /lib/modules/$(uname -r)/kernel/drivers/net/usb/
sudo modprobe ipheth
It should work properly now.
Please install the openssl before this step
(1) Generate the cetificate:
openssl req -config ./openssl.cnf -new -x509 -newkey rsa:2048 -nodes -days 36500 -outform DER -keyout "my_mok.priv" -out "my_mok.der"
(2) Sign the module
sudo kmodsign sha512 my_mok.priv my_mok.der /lib/modules/$(uname -r)/kernel/drivers/net/usb/ipheth.ko
(3) Import the certificate:
mokutil --import my_mok.der
Your will be prompted to set a password, and please remember this password. Once this is done, reboot. Just before loading GRUB, shim will show a blue screen (which is actually another piece of the shim project called MokManager). use that screen to select Enroll MOK and follow the menus to finish the enrolling process. You can also look at some of the properties of the key you’re trying to add, just to make sure it’s indeed the right one using View key. MokManager will ask you for the password we typed in earlier here; and will save the key, and we’ll reboot again.
Also, please keep some keywords in mind of the certificate information thus you can identify the right cetificate to be installled:
distinguished_name = my_module_sign_nam
countryName = CA
stateOrProvinceName = Alberta
localityName = Calgary
0.organizationName = cyphermox
commonName = Secure Boot Signing
emailAddress = example@example.com
This project inlclude all the revised versions of the ipheth driver from Linux kernel git repo history from Linux 3.1 to Linux 5.9. However, there are two major possibilities that will cause the build fail:
Then find the ipheth.c at: drivers/net/usb/, copy it to the patches folder, manually change the ipheth.c you put in the patches folder, like the following:
//#define IPHETH_BUF_SIZE 1516
//replaced with:
#define IPHETH_BUF_SIZE 1514
Rerun the install.sh, then the compilation should pass.
ls -l /lib/modules/$(uname -r)/build
The output should be something like the following to indicate a proper soft link:
lrwxrwxrwx 1 root root 39 Jan 19 01:34 /lib/modules/5.4.0-65-generic/build -> /usr/src/linux-headers-5.4.0-65-generic
There are two possible solutions to it,
(1) Install the Linux header of the same version of uname -r.
(2) Install a official version of ubuntu/debian in a vmware machine, then install and switch to the linux kernel version of the target PC, run the scripts and a ipheth.ko driver will be there, copy it to the desitination PC then perform a manual installation as instructed in the Readme.md.
It seems that the Linux kernel of the rasbian system has already been updated to higher than 5.10, thus do a apt upgrade to update the kernel would make the usb tethering work without this script.
But if you donot want to update the kernel and fail in the build with the reson of missing Linux Kernel, like: make -C /lib/modules/5.10.11-v7+/build M=/home/pi/Iphone_usb_tethering_fix modules make[1]: /lib/modules/5.10.11-v7+/build: No such file or directory. Stop. make: [Makefile:6: default] Error 2
Things would be easy to fix this:
sudo apt-get install raspberrypi-kernel-headers