Unnamed Fossil Project

All Top-level Files
Login

All Top-level Files

Files in the top-level directory in any check-in


FreeBSD on the PinePhone Pro

Porting FreeBSD to run on the PinePhone Pro. This repo tracks files added to or modified from the FreeBSD source. The intention is to merge these into upstream once ready. The priority is currently on phone bringup, i.e. writing or porting drivers to enable the hardware. Contributions and collaborations are welcome.

IceWM desktop on PinePhone Pro

Progress

What works:

Known issues:

Usage

Requirements:

Releases

A developer build of FreeBSD including a minimal desktop and virtual keyboard is available for testing and development:

The desktop is based on IceWM and can be easily customized. It is started by /etc/rc.local in combination with /root/.xinitrc. The on-screen keyboard is DeforaOS keyboard.

Building and development setup

To build your own bootable image:

Development workflow

To make changes to the kernel and test:

  1. You can make changes in the src sub-tree, copying in files from freebsd-src as needed.
  2. Insert the SD card into the PC and wait for it to auto-mount (or mount it manually to /media/...).
  3. Run ./patch.sh && ./cross-build.sh && ./install.sh /media/[drive] to patch the freebsd-src sub-tree with the changes, build the kernel, copy it to the SD card, and then unmount it. Replace ./cross-build.sh with ./dtb-build.sh if you are testing changes to the device tree.
  4. Put the SD card into the phone and boot it.

Serial console for on-device development

You can also build and test on-device, which is especially useful for kernel modules:

  1. Disable the headphone hardware switch to enable the serial console.
  2. Download and boot the development release (see above).
  3. Use the headphone jack to USB serial adapter to connect to your device from your PC: sudo cu -s 1500000 -l /dev/ttyU0
  4. Login as root (no password).
  5. The kernel source as well as an example driver are in the /root home folder. You can compile a module and then kldload it to test on device. Vim editor is included.

Network access via headphone jack

As we currently don't have working WiFi, Bluetooth, USB, or 4G drivers, the next best way to get network access on your device is to use the serial console that runs over the headphone jack. Here are the steps to get this working:

  1. On your PC, add the following to your /etc/pf.conf to enable NAT (replace re0 with your external interface):
ext_if="re0"
int_if="tun0"
localnet=$int_if:network

set skip on lo0
nat on $ext_if inet from !($ext_if) -> ($ext_if:0)
  1. On your PC, enable packet forwarding: sysctl net.inet.ip.forwarding=1
  2. On your PC, start the packet filter: sudo service pf start
  3. On your PC, copy the img/fs/etc/ppp/ppp.conf file from this repo, to /etc/ppp/ppp.conf (adjust any settings like IP addresses as necessary).
  4. On your PC, open the serial console to your phone (as described above)
  5. In the serial console, login as root, then run ./ppp.sh. This will reset the baud rate of the console to 115200 (the highest speed at which this currently works), so you can immediately close the console (press Enter then ~. to exit cu).
  6. On your PC, quickly run sudo ppp -foreground server and in a separate terminal, you can sudo tail -f /var/log/ppp.log to see what is happening. It should connect and stay connected until you press Ctrl-C to exit. If it fails, perhaps the client timed out, so reconnect the serial console (which should have reverted back to 1500000 baud rate) and try again.

You should now have internet access on your phone via your PC. Since you've lost access to the serial console, you can install dropbear SSH server on your phone (using xterm and on-screen keyboard), add a user and set password, then ssh from your PC into your phone using it's IP address.

Sponsor

Thanks to Honeyguide for sponsoring development.

Contact

Please contact me me if you would like to contribute, collaborate, or have questions.

Disclaimer

The developers and sponsors of this project are not liable for any damages or losses that may occur from the use of, or misuse of this software. Use this software at your own risk.