Skip to content

ubports/ubports-pdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Platform Development Kit

A way to help the development of Ubuntu Touch. Runs an Ubuntu Touch emulator that has little pre-installed, yet (no indicators or no core apps so far). It allows you to build, install and test system components.

Screenshot_2021-08-19_14-49-05

Goals:

  • Make debugging platform components easy
  • Don't worry about porting
  • Lower barrier to entry for contributors

Installation:

  • Linux with Snap:
    • sudo snap install --beta ubports-pdk
    • sudo snap connect ubports-pdk:kvm
    • sudo snap connect ubports-pdk:network-control
  • macOS & other Linux: Clone this repository or download a copy of it from GitHub

On Linux, make sure that your user account is in the kvm group:

  • Ubuntu 18.04 and earlier:
    • sudo groupadd kvm
    • sudo usermod -aG kvm $USER
  • Ubuntu 20.04 and up:
    • sudo usermod -aG kvm $USER

Usage:

For the snap version, use the command ubports-pdk.pdk instead of ubuntu-touch-pdk.

  • ubuntu-touch-pdk setup: Sets up the environment and mounting capabilities for your development needs
  • ubuntu-touch-pdk pull: Download the freshest development image (based on focal)
  • ubuntu-touch-pdk run: Run the development VM instance

Changes within a VM are persistent until you run the pull command again. You can have separate VMs by adding --name=my_custom_vm to the pull and run commands.

For more options, please run the command with the -h flag.

Tutorial: Fetching package sources

When logged into the VM instance (user: root, password: root) you're able to clone UBports repositories using ubports-clone. Let's try that with indicator-network.

root@linux:~# ubports-clone indicator-network

This will download the sources from Git and make them available in your PDK workspace (configured during the ubuntu-touch-pdk setup step).

Within the VM instance you're able to access those files in /pdk/sources.

Tutorial: Building package sources

Still logged into the VM instance, you're able to trigger a build of your cloned sources using ubports-build, ie for indicator-network:

root@linux:~# ubports-build indicator-network

This will copy your sources over to the VM, build the source code and publish Debian packages easily accessible from within your PDK workspace. For indicator-network those files will be located in $PDK_WORKSPACE/sources/indicator-network

The same Debian packages generated by the ubports-build command can be installed into the VM, like: sudo apt install /pdk/sources/indicator-network/*.deb

Troubleshooting

Running on distributions other than Ubuntu is possible, but not guaranteed yet.

Reset PDK

To reset the PDK completely, remove the environment directory you chose on setup as well as your configuration file, which is located in one of the following:

  • Linux with Snap: $SNAP_USER_COMMON/config.sh (e.g. $HOME/snap/ubports-pdk/common/config.sh)
  • Other Linux: $HOME/.config/UbuntuTouchPdk/config.sh
  • Mac: $HOME/Library/Caches/UbuntuTouchPdk/config.sh

Nvidia GPU Support Note

There are currently known issues with NVIDIA GPUs. If the QEMU window remains black after starting the PDK and logging into the VM instance, this may be the case.

In order to check which video card you are using, you can run the following command on host side:

glxinfo|egrep "OpenGL vendor|OpenGL renderer"

And if a discrete Nvidia graphics card is used, and there is onboard Intel and PRIME is supported, executing sudo prime-select intel to switch and then rebooting may help.

Technical details:

  • Preconfigured QEMU with OpenGL support
  • Focus on Linux and macOS as host systems first
  • Intel images on Intel hardware, ARM64 on ARM64 hardware (Mac M1)
  • 20.04 off-the-shelf kernel
  • Rootfs builds taken straight from Debos
  • Utilities that wrap around Git and make it easier to pull sources
  • Utilities around building and testing UT components

About

Platform Development Kit for Ubuntu Touch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages