北肙

当你不能够再拥有,唯一可以做的,就是令自己不要忘记。

How To

Purpose

Configuring iPhone as an AP for Gentoo-installed notebook.

Requirements

  • Gentoo Linux 2.1
  • >=sys-kernel/gentoo-sources-5.15.80
  • >=app-pda/libimobiledevice-1.3.0
  • >=app-pda/usbmuxd-1.1.1
  • iPhone 6 or later

Procedure

  1. Installing Necessary Packages

emerge -avt libimobiledevice usbmuxd
  1. Configuring Kernel Modules

cd /usr/src/linux && make menuconfig

Enabling kernel module: ehci-pci

Device Drivers  --->
	[*] USB support  --->
		[*]   PCI based USB host interface
		<*>   EHCI HCD (USB 2.0) support

Rebuilding kernel, generating boot image, modifying grub menu list.

mount /boot  # just in case 'noauto' is enabled in file '/etc/fstab'
make && make modules_install && make install
grub-mkconfig -o /boot/grub/grub.cfg

Note: Rerunning dracut for OS which has an LV-based root file system is always recommended (find How-to in another article).

  1. After reboot (only if the kernel is rebuilt), connecting the iPhone to the notebook
lsusb

Output should be:

# lsusb
Bus 002 Device 005: ID 05ac:12a8 Apple, Inc. iPhone 5/5C/5S/6/SE/7/8/X/XR
Bus 002 Device 003: ID 152d:0562 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 04f2:b221 Chicony Electronics Co., Ltd integrated camera
Bus 001 Device 004: ID 0a5c:217f Broadcom Corp. BCM2045B (BDC-2.1)
Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  1. Configuring networking service

Using the command ip a to find out the interface name coming with the iPhone

ip a

Output:

...skiped
8: enp0s29u1u2c4i2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 8e:98:6b:8a:57:7f brd ff:ff:ff:ff:ff:ff
    inet 172.20.10.2/28 brd 172.20.10.15 scope global dynamic noprefixroute enp0s29u1u2c4i2
       valid_lft 85596sec preferred_lft 74796sec
    inet6 2409:8974:e2:5cfa:8c98:6bff:fe8a:577f/64 scope global dynamic mngtmpaddr proto kernel_ra 
       valid_lft forever preferred_lft forever
    inet6 fe80::8c98:6bff:fe8a:577f/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

Note: Never forget to enable iPhone Hotpot

Enabling interface enp0s29u1u2c4i2 on boot with OS

cd /etc/init.d
ln -s net.lo net.enp0s29u1u2c4i2
rc-update add net.enp0s29u1u2c4i2 default

Additional

Starting & and stopping the networking service

/etc/init.d/net.enp0s29u1u2c4i2 <start | stop | restart>

Related Links

ArchLinux: iPhone tethering

Leave a Reply

Your email address will not be published. Required fields are marked *