Skip to content

Commit

Permalink
sync docs automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
ComixHe committed May 31, 2024
1 parent 60eb524 commit a884128
Show file tree
Hide file tree
Showing 24 changed files with 307 additions and 215 deletions.
48 changes: 25 additions & 23 deletions en/guide/debug/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,50 @@ SPDX-License-Identifier: LGPL-3.0-or-later
Linglong applications run in a container, and the application data will be mounted to `/opt/apps/<appid>`/. Only system data will exist in the `/usr/share` directory, and there will be no application-related data. Therefore, reading directly from `/usr/share` will fail. Suggested processing: Use the `XDG_DATA_DIRS` environment variable to read resources, and `/opt/apps/<appid>/files/share` will exist in this environment variable search path.
2. The font library file cannot be found when the application is running. Why can the corresponding font library be read when the `deb` package is installed?

When the `deb` package is installed, it will depend on the corresponding font library file. The Linglong package format adopts a self-sufficient packaging format. Except for the basic system library, `qt` library and `dtk` library files provided in `runtime`, do not need to be provided by yourself, other dependent data files need to be provided by yourself. It is recommended to put the corresponding data file under `files/share`, and use the environment variable `XDG_DATA_DIRS` to read the path.
When the `deb` package is installed, it will depend on the corresponding font library file. The Linglong package format adopts a self-sufficient packaging format. Except for the basic system library, `Qt` library and `DTK` library files provided in `runtime`, do not need to be provided by yourself, other dependent data files need to be provided by yourself. It is recommended to put the corresponding data file under `files/share`, and use the environment variable `XDG_DATA_DIRS` to read the path.
3. What is in the Linglong application `runtime`? Can you add some library files to it?

At present, the `runtime` that Linglong application depends on provides the `qt` library and the `dtk` library. Because `runtime` has a strict size limit, adding additional library files to `runtime` is currently not allowed.
At present, the `runtime` that Linglong application depends on provides the `Qt` library and the `DTK` library. Because `runtime` has a strict size limit, adding additional library files to `runtime` is currently not allowed.
4. The application runs in the container. Can a configuration file be created in any path of the container during the running process?

This is not allowed. The file system in the container is a read-only file system and configuration files are not allowed to be created under arbitrary paths.
You can create configuration files under `XDG_CONFIG_HOME`.
5. Where is app data saved? Where can I find it outside the container?

Because Linglong applications follow the principle of non-interference, the `XDG_DATA_HOME`, `XDG_CONFIG_HOME`, `XDG_CACHE_HOME` environment variables are defined in the corresponding path of the host machine, `~/.linglong/<appid>`/. So the user application data will be saved under this path. When writing data while the application is running, it should also be able to read the corresponding environment variable to write the data. Mutual configuration calls between applications are prohibited.
Because Linglong applications follow the principle of non-interference, the `XDG_DATA_HOME`, `XDG_CONFIG_HOME`, `XDG_CACHE_HOME` environment variables are defined in the corresponding path of the host machine, `~/.linglong/<appid>`/. So the user application data will be saved under this path. When writing data while the application is running, it should also be able to read the corresponding environment variable to write the data. Prohibit reading and writing configurations of other applications.
6. The application provides the `dbus service` file, where do I place it? What does the `Exec` segment write?

When the application provides the `dbus service` file, it needs to be placed in the `entries/dbus-1/services` directory. If `Exec` executes the binary in the Linglong package, use the `--exec` option parameter to execute the corresponding binary.
7. Can the application download files to the `$HOME` directory by default? I downloaded the file, why can't I find it on the host machine?
7. After the app is installed, the launcher cannot find it?

Linglong specification does not allow files and directories to be created in the `$HOME` directory.
8. Why does the desktop shortcut icon appear as a gear or blank? How are the icon files placed?
TryExec=xxx, if xxx does not exist in the $PATH, the application is considered non-existent and will not be displayed.
8. Why is the Icon displayed as a small black dot?

If the gear shaped icon is displayed, the icon has not been obtained. You need to confirm whether the `Icon` path name is correct. When the icon is empty, the `tryExec` field exists. When the command does not exist, it will cause the shortcut to display improperly. Place the application icon in the `icons` directory. The directory structure should be consistent with the system `icons` directory structure. The recommended path is `icons/hicolor/scalable/apps/org.desktopspec.demo.svg`. Use `svg` format icons. Refer to the icon file format specification. If you use a non-vector format, please place the icon according to the resolution. Note that the `desktop` file should not write the icon path, but directly write the icon name.
9. Why do `xdg-open` and `xdg-email` that come with the application fail?
The desktop file has an 'Icon' field written, but the Icon field name is incorrect or an absolute path is being used."。
9. Why is the Icon field as a gear?

Linglong specially handles `xdg-open` and `xdg-email` in `runtime`, so the application is forbidden to execute the executable file or script of `xdg-open` and `xdg-email` that it carries.
10. Why doesn't the system environment variable used by the application take effect?
The desktop file does not provide Icon field.
10. Where are the icons stored?

When using environment variables, you need to confirm whether there are corresponding environment variables in the container. If not, you need to contact the Linglong team for processing.
11. The library files required for the application to run were not found. How can I provide them?
svg -> $PREFIX/share/icons/hicolor/scalable/apps/

The resource files that the application needs to use and the library files both need to be provided by the application itself. The library files are placed in the `$PREFIX/lib` path.
12. Where can I choose the application download directory?
Other formats are stored according to resolution, such as 16x16.

Currently Linglong users can only choose the `Desktop`, `Documents`, `Downloads`, `Music`, `Pictures`, `Videos`, `Public`, and `Templates` directories under the user's home directory, and cannot be downloaded to other directories.
13. Why has the `QTWebEngine` rendering process crashed when the application is running?
png/xpm -> $PREFIX/share/icons/hicolor/16X16/apps/
11. Why do `xdg-open` and `xdg-email` that come with the application fail?

Due to the system upgrade of `glibc`, the application fails to use the built-in browser, and the application needs to be re-adapted. A temporary solution is to set the environment variable: `export QTWEBENGINE_DISABLE_container=1`.
14. When the application is running, the `libqxcb.so` library cannot be found or the `qtwebengine` error is reported. What can I do?
Linglong specially handles `xdg-open` and `xdg-email` in `runtime`, so the application is forbidden to execute the executable file or script of `xdg-open` and `xdg-email` that it carries.
12. Why doesn't the system environment variable used by the application take effect?

When a `qt.conf` file exists, you need to configure the correct path in the file or use the `QTWEBENGINEPROCESS_PATH`, `QTWEBENGINERESOURCE_PATH`, `QT_QPA_PLATFORM_PLUGIN_PATH`, and `QT_PLUGIN_PATH` environment variables to configure the search path.
15. The application running error message `gpu_data_manager_impl_private`, how can I solve it?
When using environment variables, you need to confirm whether there are corresponding environment variables in the container. If not, you need to contact the Linglong team for processing.
13. The library files required for the application to run were not found. How can I provide them?

The resource files that the application needs to use and the library files both need to be provided by the application itself. The library files are placed in the `$PREFIX/lib` path.
14. Why has the `Qt WebEngine` rendering process crashed when the application is running?

The current temporary solution is to add `--no-container`.
Due to the system upgrade of `glibc`, the application fails to use the built-in browser, and the application needs to be re-adapted. A temporary solution is to set the environment variable: `export QTWEBENGINE_DISABLE_SANDBOX=1`.
15. When the application is running, the `libqxcb.so` library cannot be found or the `qtwebengine` error is reported. What can I do?

Reference: [https://github.com/Automattic/simplenote-electron/issues/3044](https://github.com/Automattic/simplenote-electron/issues/3044)
When a `qt.conf` file exists, you need to configure the correct path in the file or use the `QTWEBENGINEPROCESS_PATH`, `QTWEBENGINE_RESOURCE_PATH`, `QT_QPA_PLATFORM_PLUGIN_PATH`, and `QT_PLUGIN_PATH` environment variables to configure the search path.
16. Can the application carry the database file by itself and write data to the database during operation?

The file system in the container is a read-only file system and does not allow data to be written to application resource files.
Expand Down
18 changes: 18 additions & 0 deletions en/guide/debug/ll-pica-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# FAQ

1. Where is the default configuration located for the `linglong.yaml` file generated by `ll-pica`?

The configuration file for `ll-pica` is located at `~/.pica/config.json`.
2. Does ll-pica fail to convert software such as Wine, Android apps, input methods, or security applications?

Linglong applications currently do not support this type of application, and consequently, ll-pica cannot convert them either.
3. Why is there no sound from software that requires audio?

Prompt "libpulsecommon-12.2.so not found" can be addressed by adding a line in the `build` section of the linglong.yaml file: `mv $PREFIX/lib/$TRIPLET/pulseaudio/* $PREFIX/lib/$TRIPLET`.
4. Why is the `command` field empty in the generated `linglong.yaml` file?

ll-pica retrieves the 'Exec' field from the desktop file within the deb package. If the command is empty, please verify if the desktop file path
within the deb package exists in the following locations.

- /opt/apps/$appid/entries/applications
- /usr/share/applications
46 changes: 23 additions & 23 deletions en/guide/ll-builder/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ Arguments:
The `ll-builder create` command creates a folder in the current directory according to the project name, and generates the `linglong.yaml` template file required for the build. Here is an example:

```bash
ll-builder create org.deepin.demo
ll-builder create org.deepin.hello
```

Here is the output:

```text
org.deepin.demo/
org.deepin.hello/
└── linglong.yaml
```

Expand All @@ -54,8 +54,8 @@ version: "1"
```yaml
package:
id: org.deepin.demo
name: deepin-demo
id: org.deepin.hello
name: hello
version: 0.0.0.1
kind: app
description: |
Expand Down Expand Up @@ -83,8 +83,7 @@ runtime: org.deepin.Runtime/23.0.1
Linglong application startup command.
```yaml
command:
- /opt/apps/org.deepin.demo/files/bin/demo
command: [echo, -e, hello world]
```
### Source
Expand Down Expand Up @@ -118,28 +117,29 @@ The contents of the `linglong.yaml` file are as follows:
version: "1"
package:
id: org.deepin.demo
name: deepin-demo
version: 0.0.0.1
id: @ID@
name: your name #set your application name
version: 0.0.0.1 #set your version
kind: app
description: |
simple qt demo.
your description #set a brief text to introduce your application.
command:
- /opt/apps/org.deepin.demo/files/bin/demo
command: [echo, -e, hello world] #the commands that your application need to run.
base: org.deepin.foundation/23.0.0
runtime: org.deepin.Runtime/23.0.1
base: org.deepin.foundation/23.0.0 #set the base environment, this can be changed.
#set the runtime environment if you need, a example of setting deepin runtime is as follows.
#runtime:
#org.deepin.Runtime/23.0.1
sources:
- kind: git
url: "https://github.com/linuxdeepin/linglong-builder-demo.git"
version: master
commit: a3b89c3aa34c1aff8d7f823f0f4a87d5da8d4dc0
#set the source if you need, a simple example of git is as follows.
#source:
# - kind: git
# url: https://github.com/linuxdeepin/linglong-builder-demo.git
# version: master\n
# commit: a3b89c3aa34c1aff8d7f823f0f4a87d5da8d4dc0
build: |
cd /project/linglong/sources/linglong-builder-demo.git
qmake -makefile PREFIX=${PREFIX} LIB_INSTALL_DIR=${PREFIX}/lib/${TRIPLET}
make
make install
echo 'hello' #some operation to build this project
```
4 changes: 3 additions & 1 deletion en/guide/ll-builder/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ ll-builder run

If `ll-builder run` runs successfully, the output is as follows:

![org.deepin.demo.png](./images/org.deepin.demo.png)
```bash
hello world
```

To facilitate debugging, use an additional `--exec /bin/bash` parameter to replace the default execution program after entering the container, such as:

Expand Down
20 changes: 9 additions & 11 deletions en/guide/ll-cli/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ SPDX-License-Identifier: LGPL-3.0-or-later

# Update Linglong App

Use `ll-cli update` to update Linglong apps.
Use `ll-cli upgrade` to upgrade Linglong apps.

View the help information for the `ll-cli update` command:
View the help information for the `ll-cli upgrade` command:

```bash
ll-cli update --help
ll-cli upgrade --help
```

Here is the output:

```text
Usage: ll-cli [options] update com.deepin.demo
Usage: ll-cli [options] upgrade com.deepin.demo
Options:
-h, --help Displays help on commandline options.
Expand All @@ -26,26 +26,24 @@ Options:
--module <--module=runtime> the module of app
Arguments:
update update an application
upgrade update an application
appId application id
```

Use `ll-cli update` to update a local app to the latest version in the remote repository, such as:
Use `ll-cli upgrade` to upgrade a local app to the latest version in the remote repository, such as:

```bash
ll-cli update <org.deepin.calculator>
ll-cli upgrade org.deepin.calculator
```

Here is the output:

```text
update org.deepin.calculator , please wait a few minutes...
org.deepin.calculator is updating...
message: update org.deepin.calculator success, version:5.7.16 --> 5.7.21.4
100% Install main:org.deepin.calculator/5.7.21.4/x86_64 success
```

Example of updating the specified version to the latest version:

```bash
ll-cli update <org.deepin.calculator/5.7.16>
ll-cli upgrade org.deepin.calculator/5.7.16
```
2 changes: 1 addition & 1 deletion en/guide/ll-pica/adep.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Global Flags:
```

```bash
ll-builder adep -d "dep1,dep2" -p /path/to/linglong.yaml
ll-pica adep -d "dep1,dep2" -p /path/to/linglong.yaml
```

If executing within the same path where the `linglong.yaml` file resides, there is no need to include the `-p` parameter.
9 changes: 4 additions & 5 deletions en/guide/ll-pica/convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ The constructed products are as follows:
```bash
├── package
│ └── com.baidu.baidunetdisk
│ └── amd64
│ ├── com.baidu.baidunetdisk_4.17.7.0_x86_64_develop.layer
│ ├── com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer
│ ├── linglong
│ └── linglong.yaml
│ ├── com.baidu.baidunetdisk_4.17.7.0_x86_64_develop.layer
│ ├── com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer
│ ├── linglong
│ └── linglong.yaml
└── package.yaml
```

Expand Down
19 changes: 18 additions & 1 deletion en/guide/ll-pica/introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# ll-pica Introduction

This tool currently provides the capability to convert DEB packages into Linglong packages. Only software packages that comply with the app store packaging standards are supported for conversion. Packages related to Wine, Android emulators, input methods, and security software cannot be converted at this time.
This tool currently provides the capability to convert DEB packages into Linglong packages. Generate the required `linglong.yaml` file for building Linglong applications and rely on `ll-builder` to implement application build and export. Only software packages that comply with the [app store packaging standards](https://doc.chinauos.com/content/M7kCi3QB_uwzIp6HyF5J) are supported for conversion.

:::tip

The conversion tool is merely an auxiliary tool and does not guarantee
that the converted application will definitely run. It's possible that
the software depends on libraries installed in paths or other
configuration paths that do not align with those inside LingLong's
internal structure, leading to the inability to execute. In such cases,
you would need to use the command `ll-builder run --exec bash` to enter the container for debugging purposes.
:::

The following situations are likely to result in unsuccessful execution:

1. Packages related to Wine, Android emulators, input methods, and security software cannot be converted.
2. The package utilizes preinst, postinst, prerm, and postrm scripts.
3. It is necessary to read configuration files from a fixed path.
4. Need to obtain root permissions.

View the help information for the `ll-pica` command:

Expand Down
7 changes: 3 additions & 4 deletions en/guide/ll-pica/manifests.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ The `package.yaml` file serves as the foundation for ll-pica to convert packages
{workdir}
├── package
│ └── {appid}
│ └── amd64
│ ├── linglong
│ ├── linglong.yaml
│ └── start.sh
│ ├── linglong
│ ├── linglong.yaml
│ └── start.sh
└── package.yaml
```

Expand Down
6 changes: 3 additions & 3 deletions en/guide/start/how_to_use.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ ll-builder run

the successful output of `ll-builder run` is as follows:

![org.deepin.demo.png](../ll-builder/images/org.deepin.demo.png)
![org.deepin.calculator.png](./images/org.deepin.calculator.png)

For debugging purposes, use the additional `--exec /bin/bash` parameter to replace the default program executed upon entering the container, for example:

Expand All @@ -108,11 +108,11 @@ ll-builder run --exec /bin/bash

# Conversion application

Here, we use baidunetdisk as an example for converting to a Linglong package from a deb package.
Here, we use baidunetdisk as an example. We will introduce the process of converting DEB packages into Linglong packages

## Obtain software package

Take baidunetdisk as an example. First, obtain the deb package file.
First, obtain the deb package file.
Currently, only software following the application store packaging
specifications is supported for conversion.

Expand Down
30 changes: 25 additions & 5 deletions en/guide/start/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
SPDX-License-Identifier: LGPL-3.0-or-later
-->

# Install
# Install linglong

Currently supported: deepin v23, UOS 1070.
Linglong is composed of three parts.

## Operating system
- ll-builder is used to build and debug Linglong applications, provided by linglong-builder.
- ll-box is a sandbox container, provided by linglong-box.
- ll-cli manages and runs Linglong applications, provided by linglong-bin.

- deepin v23
## deepin v23

```bash
sudo apt install linglong-builder
```

- UOS 1070
## UOS 1070

add Linglong repository source

Expand All @@ -28,3 +30,21 @@ echo "deb [trusted=yes] https://ci.deepin.com/repo/deepin/deepin-community/lingl
sudo apt update
sudo apt install linglong-builder
```

# Install the Pica tool

This tool currently provides the capability to convert DEB packages into Linglong packages. Generate the required `linglong.yaml` file for building Linglong applications and rely on `ll-builder` to implement application build and export.

## deepin v23

```bash
sudo apt install linglong-pica
```

## UOS 1070

The repository source needs to be added, which has been done previously.

```bash
sudo apt install linglong-pica
```
Loading

0 comments on commit a884128

Please sign in to comment.