Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change snap install intsructions to edge channel #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 37 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,75 @@ to build, install and test system components.

![Screenshot_2021-08-19_14-49-05](https://user-images.githubusercontent.com/15277964/130065951-9fa7a9fd-b7db-47c1-9bd6-b9dee087af7f.png)

## Goals:
## Goals

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


## Installation:
## Installation

- Linux with Snap:
- `sudo snap install --beta ubports-pdk`
- `sudo snap install --edge 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:
## 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 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
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`.
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`.

```
```shell
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).
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`:
Still logged into the VM instance, you're able to trigger a build of your cloned
sources using `ubports-build`, ie for `indicator-network`:

```
```shell
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`
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`
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

Expand All @@ -81,15 +91,22 @@ as well as your configuration file, which is located in one of the following:

### 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.
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:
```
In order to check which video card you are using, you can run the following
command on host side:

```shell
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:
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
Expand Down