diff --git a/en/Community-Developer-Guides/Software_Package_Copyright_Supplement_Guide.md b/en/Community-Developer-Guides/Software_Package_Copyright_Supplement_Guide.md new file mode 100644 index 0000000000000000000000000000000000000000..8f2a2a4c63d276e3629f14a53646dd9007f562ae --- /dev/null +++ b/en/Community-Developer-Guides/Software_Package_Copyright_Supplement_Guide.md @@ -0,0 +1,242 @@ +--- +title: openKylin Package Copyright Agreement Supplementary Guide +date: 2022-09-16 14:36:45 +tags: +--- + +# openKylin package copyright agreement supplementary guide + +openKylin is very strict about package copyright and license information. All packages in openKylin should contain the corresponding copyright information, generally including the following three steps: 1. +1. place the appropriate copyright notice file in the header comments of each source file. +2. create a file named "LICENSE" or "COPYING" in the package's first-level directory and put the license information for the entire project. +3. provide a summary of the copyright information of all source files of the project in the Debian/copyright file. + + **It is recommended that new open source projects use the [Mulan PSL v2 protocol](http://license.coscl.org.cn/index.html).** Mulan PSL v2 is similar to BSD-type licenses and has good compatibility: BSD and MIT-type loose licenses are compatible with the Mulan PSL v2 protocol. The Mulan PSL v2 protocol is compatible with Apache License v2.0, L/GPLv2, L/GPLv3, and other licenses. That is, code licensed under BSD, MIT class licenses can contribute to projects using the Mulan PSL v2 protocol; code using the Mulan PSL v2 protocol can contribute to projects such as Apache License v2.0, L/GPLv2 or L/GPLv3. + +## Header Comments + +For source files such as .c/.cpp/.h/.py/.java within a project, add the appropriate copyright notice to the header comments, the corresponding notice can be found in the license text message, or you can refer to projects following the same license at + +Take the project ukui-foo, license "Mulan PSL v2", copyright subject Zhang Three, for example, you need to insert in the header comment of each source file. + +``` +Copyright (c) 2022 Zhang Three +ukui-foo is licensed under Mulan PSL v2. +You can use this software according to the terms and conditions of the Mulan PSL v2. +You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 +This SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +See the Mulan PSL v2 for more details. +``` + +Take the project ukui-foo, license GPL-3.0+, copyright subject Zhang Three as an example: +``` +Copyright (C) 2022 Zhang Three + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +This program is distributed in the hope that it will not be used for any other purpose. + +This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +You should have received a copy of the GNU General Public License along with this program; if not, see . +``` + +> Enterprise users use the enterprise license + +## Project license file +Depending on which license the project follows, you need to copy the complete contents of the corresponding license (openKylin from the /usr/share/common-license directory, Mulan PSL v2 from the [official website](http://license.coscl.org.cn/index.html)) Copy it to the first-level directory of the project and rename it to "LICENSE" or "COPYING". +Take the project ukui-foo, license GPL-3 as an example. +``` +cd ukui-foo +cp /usr/share/common-license/GPL-3 COPYING +``` +## debian/copyright file +### File syntax + +The Debian/copyright file must convey all required upstream information, copyright notices, and license details in a file consisting of two or more paragraphs. At a minimum, the file must include a title paragraph and a document paragraph. + +### Paragraphs + +There are three types of paragraphs. The first paragraph in the file is called the Header paragraph. Each of the other paragraphs is a Files paragraph or a separate License paragraph. + +#### Header Paragraphs + +The following fields can appear in the header field + + - Format: mandatory + - Upstream-Name: Optional. (recommended) + - Upstream-Contact: Optional. (Recommended) + - Source: Optional. (Recommended) + - Disclaimer: Optional. + - Comment: Optional. (Recommended) + - License: Optional. + - Copyright: Optional. + + +#### Files paragraph (repeatable) + +The copyright and license for a file are declared in one or more paragraphs. In the simplest case, a single paragraph can be used which applies to all files and lists all applicable copyrights and licenses. + +The following fields can appear in a single document paragraph. + + - Files: Required + - Copyright: Required + - License: Required + - Comment: Optional. + +#### Separate License paragraph (optional, repeatable). + +When a group of files is multi-licensed, or when the same license appears multiple times, you can use single-line license fields and separate license paragraphs to expand the license abbreviation. + +The following fields can appear in separate license paragraphs. + + - License: mandatory + - Comment: optional + +### Fields + +The following fields are defined for use in Debian/copyright. + +#### Format + +Type: single line value. + +The file format follows the canonical address, e.g. + +- Format: https://www.Debian.org/doc/packaging-manuals/copyright-format/1.0/. + +#### Upstream-Name + +Type: single-line value. + +Name of the software used upstream + +#### Upstream-Contact + +Type: row-based list; + +The preferred address to reach the upstream project. This may be free-form text, but by convention it is usually written as a list of RFC5322 addresses or URIs. + +#### Source +Type: formatted text, no summary. + +An explanation of the upstream source. Normally this would be a URL, but it may be a free-form interpretation. If the upstream source has been modified to remove non-free parts, this should be specified in this field. + +#### Disclaimer + +Type: formatted text, no summary. + +This field may be used in the case of non-free and contributed packages (non-free) + +#### Comment + +Type: formatted text, without a summary. + +This field can provide additional information. + +#### License + +Type: formatted text with a brief description. + +In the Header segment, this field gives the license information for the entire package, which may differ from all combinations of the per-file license information or a simplification of them. In the Files paragraph, this field gives the license terms for the files listed in the Files field of the paragraph. In a separate license paragraph, it gives the license terms for those paragraphs that reference it. + +First line: the abbreviated name of the license, or the expression that provides an alternative. [standard abbreviation](https://dep-team.pages.debian.net/deps/dep5/#license-short-name). + +Remaining lines: If left blank here, the file must include a separate license paragraph that matches the short name of each license listed in the first line. Otherwise, this field should include the full text of the license, or include a pointer to the license file under /usr/share/comm-licenses. This field should include all the text needed to satisfy the Debian Policy requirements for including software distribution licenses, as well as any licensing requirements for including warranty disclaimers or other statements in binary packages. + +#### Copyright + +Type: formatted text, without a summary. + +One or more free-form copyright notices. Any format is allowed. +See the following example to see how to organize this field to make it easier to read. In the Title paragraph, this field gives the copyright information for the entire package, which may differ from or be simplified by the combination of copyright information for all individual files. In the Files segment, it gives the copyright information that applies to the files matched by the file schema. + +The Copyright field collects all relevant copyright notices for the files in this segment. Not all copyright notices apply to each individual file; the year of publication of a copyright holder may be collected together. For example, if Document A has + + - Copyright 2008 John Smith + - Copyright 2009 Angela Watts + +and Document B has + + - Copyright 2010 Angela Watts + +the copyright fields covering both Document A and Document B need only contain. + + - Copyright 2008 John Smith + - Copyright 2009, 2010 Angela Watts + +The copyright field can contain an exact copy of the original copyright notice (including the word " Copyright") or the text can be shortened, as long as the information is not sacrificed. + +#### Files + +Type: a space-separated list. + +Indicates the schema list of documents covered by the licenses and copyrights specified in this paragraph. + +The filename patterns in the file field are specified using the simplified shell glob syntax. Patterns are separated by spaces. + + - Only the wildcard characters * and ? apply; the former matches any number of characters (including none), the latter matches a single character. Both match the slash (/). + + - Matches pathnames starting from the source code. Thus, "Makefile.in " only matches files in the root modal stream of the source code, but "\*/Makefile.in" matches files at all directory levels. + + +### License specification +#### syntax + +License names are case-insensitive and cannot contain spaces. + +In the case of multiple licenses, when the user can choose between different licenses, and when the use of the work must comply with the terms of multiple licenses at the same time, the short names of the licenses are separated by "or". + +For example, here is a simple "GPL version 2 or higher" field. + +License: GPL-2+ + +This is a dual-licensed GPL/Artistic work, e.g. Perl. + +License: GPL-1+ or Artistic + +This applies to files that contain both GPL and classic BSD code: License: GPL-2+ and Artistic + +License: GPL-2+ and BSD + +For the most complex cases, commas are used to eliminate the priority of ors and ands, and take precedence over ors, unless preceded by a comma. Example. + +A or B and C means A or (B and C). + +A or B, and C means (A or B), and C. + +This is a file containing Perl code and classic BSD code. + +License: GPL-2+ or Artistic-2.0, and BSD + +A GPL-2+ work with an OpenSSL exception is actually a dual-licensed work that can be redistributed both under GPL-2+ and under both GPL-2+ and OpenSSL exceptions. As such, it is expressed as + +License: GPL-2+ with OpenSSL exception + +Debian/copyright can be found in [example](https://gitee.com/openKylin/ukui-session-manager/blob/openKylin/yangtze/debian/copyright "example") + +## How to check copyright + +There are already programs upstream in the community that can help us check the copyright writeup, and these programs currently follow the DEP-5 rules. + +#### licensecheck + +The maintainer can check the source file headers with the licensecheck command + + - $ licensecheck * -r + +#### cme + +Use the cme command to automatically update the debian/copyright file based on the source file headers + + - $ cme update dpkg-copyright + + diff --git a/en/Community-Developer-Guides/Source_Independent_Selection_Build.md b/en/Community-Developer-Guides/Source_Independent_Selection_Build.md new file mode 100644 index 0000000000000000000000000000000000000000..c82a16c87a55f519e8686d7be3e11e9f809eee54 --- /dev/null +++ b/en/Community-Developer-Guides/Source_Independent_Selection_Build.md @@ -0,0 +1,708 @@ +# openKylin source code independent selection build process + +# I. Package version number selection + +## 1. selection strategy + +### 1.1 Software project selection strategy + +![software_project_selection_strategies.png](./assets/source_independent_selection_build/software_project_selection_strategies.png) + +- Continue to actively introduce full "A" software (version) + +- Encourage the introduction of "A" and "B" software only (version) tory-view-113483.html + +- Cautiously introduce software with "C" (version) + +- Reject/delete software (version) with "D" or "C >= 3" in time + +### 1.2 Software version selection strategy + +- Long-term support version (for the time being, openKylin does not have a long-term support version, 1.0 is not a long-term support version at the moment) + - Give priority to the version widely used by mainstream OS, taking into account both quality and stability. + - The compatibility list is not affected by the upgrade. + - No major version changes during the life cycle of the same version, only feature and patch rounds to solve quality problems. + +- Community development version + - Meet the basic compliance issues, integrate as much software as possible, giving priority to the latest version of the current stable branch of open source components. + - Follow up on upstream community dynamics in a timely manner and merge new feature versions of open source software. + +### 1.3 Software classification and compatibility principles + +| **Level** | **Scope** | **Principles** | +| -------- | --------------------------------------- | ------------------------------------------------------------ | +| Level 1 | kernel, glibc, gcc, zlib, and other core system components | APIs and ABI remain stable for the lifetime of the main release, and as much as possible for the next main release | +| Level 2 | Base software such as dbus, oepnssl, bzip2, systemd, etc. | APIs and ABIs remain stable for the lifetime of a single major release, and dependent applications do not require major changes in principle for the lifetime of a single major release | Level 3 | Other applications, etc. | APIs and ABIs remain stable for the lifetime of a single major release. +| The API and ABI are not forced to remain stable during the life cycle of a single major version, and dependent applications are upgraded inline. + +## The specific process + +1. select the new projects to be introduced according to the "Software Project Selection Policy". 2. + +2. select a version of the project according to the "software version selection policy" + +3. output the "project selection report", including the compliance, compatibility, importance, activity, quality, security details of the new project, as well as the new features of the selected version, compatibility, impact domain, comparison of versions in other distributions, etc. + +4. the technical committee adopted the following process to carry out specific work + +### 2.1 Obtain the project address of the package + +The project address is used to view the current project details, development status, compilation and installation, instructions, etc. of the package + +There are several ways to obtain the project address of the package. + +#### 2.1.1 The debian community's package tracking platform + +Most packages can be found on the debian community's package tracker ([tracker.debian.org](https://tracker.debian.org/)) + +For example, to find the `libnftnl` package + +![example_of_the_debian_community_package_tracking_platform.png](./assets/source_independent_selection_build/example_of_the_debian_community_package_tracking_platform.png) + +The project address of the package can be accessed through the homepage information in the upper right corner, as shown above. + +#### 2.1.2 dsc file + +The dsc file of a package can be viewed on the debian community ([tracker.debian.org](https://tracker.debian.org/)), ubuntu (https://launchpad.net), etc. The dsc file may contain information describing the project address of the current package . + +For example: `libnftnl` in the debian community to view the package [dsc file](https://deb.debian.org/debian/pool/main/libn/libnftnl) (hereinafter in [version 1.1.2-2](https://deb.debian.org/)) debian/pool/main/libn/libnftnl/libnftnl_1.1.2-2.dsc) as an example). + +```Bash +# Remove gpg signature information for easy viewing +Format: 3.0 (quilt) +Source: libnftnl +Binary: libnftnl11, libnftnl-dev +Architecture: linux-any +Version: 1.1.2-2 +Maintainer: Debian Netfilter Packaging Team +Uploaders: Arturo Borrero Gonzalez +Homepage: https://git.netfilter.org/libnftnl +Standards-Version: 4.2.1 +Vcs-Browser: https://salsa.debian.org/pkg-netfilter-team/pkg-libnftnl +Vcs-Git: https://salsa.debian.org/pkg-netfilter-team/pkg-libnftnl +Build-Depends: debhelper (>= 11), libmnl-dev, libtool, pkg-config +package-list: + libnftnl-dev deb libdevel optional arch=linux-any + libnftnl11 deb libs optional arch=linux-any +Checksums-Sha1: + c0f880588fabaa845a88fb5a2bdad0dea7481857 366014 libnftnl_1.1.2.orig.tar.bz2 + 0a9063e79191955fbf59482d75c7bfb62aded816 912 libnftnl_1.1.2.orig.tar.bz2.asc + 505f8b44e3adb574dc3cf657580e9d73f0b0a853 8772 libnftnl_1.1.2-2.debian.tar.xz +Checksums-Sha256: + a5c7b7a6c13c9c5898b13fcb1126fefce2015d5a96d7c354b19aaa40b6aece5d 366014 libnftnl_1.1.2.orig.tar.bz2 + 4178552d7ad210e9f17df3c079ac6de032f62c72774d59bfac404a023d48950b 912 libnftnl_1.1.2.orig.tar.bz2.asc + 4ef80a0c344b23624d24b7dd4be1b73a7b96d86089813c545705f8093067ce13 8772 libnftnl_1.1.2-2.debian.tar.xz +Files: + 14093a238d5025d4a452e6d1cef88c58 366014 libnftnl_1.1.2.orig.tar.bz2 + e10dcb9138261d92e7569bd72b809a28 912 libnftnl_1.1.2.orig.tar.bz2.asc + 518ff0360f67c8031a31792a257a5c3b 8772 libnftnl_1.1.2-2.debian.tar.xz +``` + + +As highlighted in. + +- **Homepage** : project address + +- **Vcs-Browser** : Version control system browsing platform (similar to github, gitee, gitlab, etc.) + +- **Vcs-Git** : git repository address + +#### 2.1.3 debian/control files + +First download any source package from debian community, ubuntu community (launchpad.net) and unzip it. + +```Bash +# Download the source package from the ubuntu community (launchpad.net) +# You can also use apt-source to download source code by adding deb-src source +# To use dget you need to install devscripts +dget -x https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/libnftnl/1.2.3-1/libnftnl_1.2.3-1.dsc + +# Go to the unpacked directory +cd libnftnl-1.2.3 +``` + +Check the `debian/control` file for `Homepage`, `Vcs-Git`, `Vcs-Browser` and other related fields + +For example. + +``Bash +$ grep -E "^(Homepage|Vcs-*)" debian/control +Homepage: https://git.netfilter.org/libnftnl +Vcs-Git: https://salsa.debian.org/pkg-netfilter-team/pkg-libnftnl.git +Vcs-Browser: https://salsa.debian.org/pkg-netfilter-team/pkg-libnftnl +``` + +The descriptions of the fields highlighted above are the same as in subsection 2.1.2 + +#### 2.1.4 debian/watch files + +As in subsection 2.1.3, the source code needs to be downloaded first. This time, the `debian/watch` file is viewed + +The **debian/watch** file is mainly used to record the download address of the upstream source code (this file is not required, so it may not be present in some source packages) + +``Bash +$ cat debian/watch +version=3 +opts=pgpsigurlmangle=s/$/.sig/ http://ftp.netfilter.org/pub/libnftnl/libnftnl-(\S+).tar.bz2 +``` + +The upstream source code download address recorded in this file allows you to find its corresponding project address + +For example. + +```Bash +# The download address is usually an ftp or git release download address +# If the download address is hosted by another platform, then you may not know the project address +http://ftp.netfilter.org/pub/libnftnl + +# The above address is a good guess for the project address +http://netfilter.org/pub/libnftnl +``` + +### 2.2 Getting the package version status + +The latest stable version list of the current project is learned by looking at the project address. + +This can be viewed in several ways. + +- debian/watch file + +If the package in subsection 2.1.4 has a debian/watch file, you can view the download address of the upstream package zip of the project. + +```! +! The download address may contain a beta version with a name similar to xxxx-beta.tar.gz. Generally this beta version of the source code should not be selected. +```! + +- git repositories + +If it is a git repository, you can check if its counterpart has a release git release: 1. + +1. If there is, then you can get a list of its releases on the git release page + +2. If not, see if the corresponding `branch(branch)` or `tag(tag)` has the relevant version list information + + + +# II. Building the source package + +Select the version of the package to be built and the download address from the first section. + +If there is already a project in the remote repository and you need to change the upstream version, then please check the contents of subsection 4. + +## 1. Download the source code and modify the source code directory format + +Download the source package locally and unzip it + +```Bash +## Download the source code +wget https://www.netfilter.org/pub/libnftnl/libnftnl-1.2.3.tar.bz2 + +# Decompress +tar -xaf libnftnl-1.2.3.tar.bz2 +``` + +Modify the source directory to conform to the **-** format. For example. + +```Bash +$ ls -al +drwxr-x--@ - luzp 10 Aug 02:24 libnftnl-1.2.3 +.rw-rw----@ 395k luzp 10 Aug 02:24 libnftnl-1.2.3.tar.bz2 +``` + +## 2. build out the debian package directory + +### 2.1 upstream source contains debian directory + +```! +! Note: If the upstream source contains a debian directory, we need to manually rename the upstream debian directory to avoid other problems when we regenerate the debian directory +``` + +- Back up the original debian directory + +```Bash +mv debian debian-orig +``` + +- Rebuild the debian directory + +```Bash +debmake -u -r -t +``` + +This will create a new directory at the same level as the source code, in the format - + +Suppose. + +The source tarball is `amdgcn-tools-13.tar.gz` + +``Bash +# Extract the source code +# Unzip the source code to the amdgcn-tools-13 directory +tar -xaf amdgcn-tools-13.tar.gz + +# Go to the source directory and backup the original debian directory +cd amdgcn-tools-13 +mv debian debian-orig + +# Rebuild the debian directory +debmake -u13 -rok1 -t + +# After execution, a new directory will be created in the same level as amdgcn-tools-13 +# -, which is the following directory +ls amdgcn-tools-13-13 +``` +### 2.2 Building debian directories directly + +If the upstream source code is pure source, then just build the debian directory directly. + +``Bash +### Build the debian directory +debmake -z tar.bz2 +``` + +-z Specify the tarball format for the source code + - libnftnl-1.2.3.tar.bz2 would be specified as -z tar.bz2 + + - The default source compression format is tar.gz + +-b If it is a perl or python source package, you can specify this parameter to create more files for debmake in the corresponding programming language + +```Bash +# If it is python +debmake -b ":python3" + +# perl +debmake -b ":perl" +``` + +-t regenerate the upstream source package (i.e. xxx.orig.tar.gz) + +More detailed debmake usage can be found in its man page + +```Bash +man debmake +``` + +## 3. Modify build rules + +The main thing is to modify the files in the debian directory. + +### 3.1 control + +The `control` file covers the contents of two sections. + +#### 3.1.1 Source package section + +A brief description of the current source package, and the compilation dependencies for building it + +There are several fields that need to be noted. + +- **Section** + +Describes the type of package, and is used to classify the package. For example, `mysql-8` should belong to `database`. + +The options are. + +admin, cli-mono, comm, database, debug, devel, doc, editors, education, electronics, embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio, haskell, httpd, interpreters, introspection, java, javascript, kde, kernel, libdevel, libs, lisp, localization, mail, math, metapackages, misc, net, news, ocaml, oldlibs, otherosfs, perl, php, python, ruby, rust, science, shells, sound, tasks, tex, text, utils, vcs, video, web, x11, xfce, zope + +- **Priority** + - Priority of the package + + - required System required packages + - important Important packages, packages that are not required for the system, but preferably pre-installed on the system + - standard Standard Relatively independent packages + - optional This is the default priority option, which should be used unless the package is a system-required package + +- **Maintainer** +It needs to be written as the current openkylin sig group responsible for the package, e.g. `packaging sig` group is written as `Openkylin Developers ` + +- **Vcs-Browser**: + +Write it to the corresponding gitee repository address, e.g. https://gitee.com/openkylin/autoconf + +- **Vcs-Git**. + +Write to the corresponding gitee repository git address, e.g. https://gitee.com/openkylin/autoconf.git + +- **Build-Depends and ** + +Build dependencies needed to compile architecture-related code + +- **Build-Depends-Indep** + +Compilation dependencies required to compile architecture-independent code + +For **Build-Depends** and **Build-Depends-Indep** you can find the relevant compilation dependencies from the project address. + +--- +**Note:** If the control file references rules from another OS distribution, you need to remove or replace the version number rules in the other OS version, for example. + +``` +Build-Depends: + pkg1 (>= 1.0.0-0ubuntu1), + pkg1 (< 1.2.0-1debian2), + pkg2 (> 1.0.0.build), + pkg3 (> 2.0ubuntu19) +``` + +First of all, it should be clear that for quilt format version numbers generally have "-" in the format `-`, while native format source packages generally do not contain "-" + +The modification process can be done in two steps + +**Step 1:** + +For quilt-formatted versions, the version numbers 1.0.0-0ubuntu1 and 1.2.0-1debian2 in pkg1 contain the version number of the specific OS distribution, so they should be modified. It also becomes. + +``` +pkg1 (>= 1.0.0), +pkg1 (< 1.2.0), +``` + +For version numbers in native format, you first need to determine its upstream version, for pkg2 and pkg3. + +(1) Try to find the 1.0.0 version of pkg2, if you can find it, then 1.0.0 is the upstream version, and its compilation dependency should be changed to: pkg2 (> 1.0.0); same as pkg3 + +(2) If the upstream version of pkg2 cannot be found, and the current version number does not contain the name of other OS distributions, then it can be kept (because the source-package tool is used to repackage the source code, its upstream version number is also the current version number); but for pkg3, if pkg3 is OS self-developed (its source code name usually However, for pkg3, if pkg3 is OS developed (its source code name also contains OS name, e.g. ubuntu-keyring), then this package can be renamed and maintained by openkylin, with the corresponding source code name changed to openkylin-keyring and the version number redefined, e.g. 1:1.0.0; if it is not OS developed package, it is better for us to redefine the version number and maintain it according to If it is not an OS self-developed package, it is better that we also re-define the version number and maintain it according to our own version number, which can be discussed internally, e.g. 1:1.0.0 is also specified here.** Note that here, it is better to use the version number in : format, which indicates that the version number with : is always higher than the version number without. ** + +Then, for pkg2, pkg3, it is modified as follows + +``` +pkg2 (> 1.0.0.build), +pkg3 (> 1:1.0.0) +``` +**Step 2 (native format is not handled):** + +The second step is to improve on the first step. In general we need to clarify the content of the revisions in other OS distributions that follow the - horizontal line. + +For -, generally each revision is a fix for a bug, security vulnerability, etc. For ubuntu, each revision is made up of several patches. + +So for pkg1 (>= 1.0.0-0ubuntu1), it is explicitly stated that it can only be used after revision 0ubuntu1, which means that using pkg1 version 1.0.0 is risky, and the most immediate phenomenon is that the compilation does not pass. + +Therefore, it is necessary to combine our actual pkg1 version situation to. + +(1) If pkg1 exists in the repository, its version is 1.0.0-ok1. In order to ensure that the above compilation passes, it is necessary to integrate the patch in ubuntu's 1.0.0-0ubuntu1. If the relevant patch is already integrated, then the compilation dependency becomes. + +``` +pkg1 (>= 1.0.0-ok1), +pkg1 (< 1.2.0), +``` + +After the patch integration, the pkg1 version in the repository becomes 1.0.0-ok2. Then, where the dependencies are compiled, it becomes + +``` +pkg1 (>= 1.0.0-ok2), +pkg1 (< 1.2.0), +``` + +(2) If pkg1 does not exist in the repository, then when we select the build independently for the first time, it is better to select the version between 1.0.0~1.2.0 to ensure that the compiled dependencies of each dependency package can be met. + +The above is based on compilation dependencies. If the version number is also specified in the installation dependency field of the binary package, then it is handled in the same way as above. + +#### 3.1.2 Binary package section + +Describes which binary package programs the current source package can be divided into. + +Common types of subpackages are + +- lib + +shared library, whose binary package name is usually `lib-xxx`. + +- dev + +Shared library headers and related development files, usually named `lib-xxx-dev` + +- doc + +Documentation of a package + +If the documentation corresponds to the documentation of an executable, the binary package name is usually `xxx-doc`. + +If the documentation is for a development library, the binary package name is usually `lib-xxx-doc`. + +- bin + +The binary package name is usually the name of the corresponding binary program of a package, such as the binary program of a compiled language (e.g., c/c++) and the executable program of an interpreted programming language (e.g., python, perl) + +This sub-package can be used in combination with ``debmake`` when building the ``debian` package directory, e.g. + +```Bash +# The package name is foo, which provides the binary and the documentation for the binary +debmake -b "foo:bin,foo-doc:doc" + +# The package name is libfoo, which is the source code for a development library that provides documentation for the development library and the development library +debmake -b "libfoo:lib,libfoo-doc:doc" + +# After execution, each binary package information template will be automatically written to debian/control file +``` +### 3.2 rules + +Package compilation and build rules + +### 3.3 changelog + +Modify the package version number in the format: - + +In general, for the openkylin community, use `ok1` for the first revisions, e.g. + +```Bash +autoconf (2.71-ok1) yangtze; urgency=low + + * Build for openKylin. + + -- Lu zhiping Fri, 26 Aug 2022 15:25:09 +0800 +``` + +### 3.4 source/format + +The source package must be formatted as `quilt` format + +```Bash +echo "3.0 (quilt)" > debian/source/format +``` + +```Bash +echo "3.0 (quilt)" > debian/source/format +``` + +### 3.5 Other files + +xxx.install + +xxx.doc + +xxx.symbols + +xxx.manpages + +### 3.6 Applying patches from other OS distributions + +If other OS distributions have patches for the package, then we need to analyze and consider whether to apply their patches. + +You can start by considering whether to apply patches from other OS distributions in the following ways. + +- What is fixed by the patch? Is it an irrelevant patch that has not been absorbed by the upstream community? + +- Is it a patch that was only available in a previous, older release and has it been integrated in a new release? + +- Is it a major vulnerability fix patch? + +- Is it a patch that is only required for a specific OS distribution? + +- If the patch is not applied is there a compilation problem and is there a problem with the installation? + +``` +Also, it's best to apply patches from the upstream community after building out the git repository, so that the information from the upstream community patches can be retained in the git commit +``` + +Here are the steps for applying patches after building out a git repository in Section 5. + +If you need to apply patches from upstream communities, it is best to keep the content and author information of their patches. You can apply patches from upstream communities directly through the git tool. + +- git am apply patch +The git am application patch will automatically keep the patch information + +``Bash +git am xxxx.patch +``` + +- git apply applies patch + +But some patches don't have the exact same information format as git am, so you can use git apply to import the patches and then commit to add the patch information + +```Bash +# import patch information +git apply xxx.patch + +# Add changes +git add . + +# Fill in the edit box with information about the patch, such as +# the author of the patch, the content of the patch, etc. +git commit +git commit . + +After importing a patch, if you want to compile and test the newly imported patch, you can use the gbp tool to generate the new source code (new dsc file) + +```Bash +# Modify changelog to add a new version number +vim debian/changelog + +# Compile the source code, which will generate a new dsc file +gbp buildpackage -S -sa -nc --git-prisine-tar --git-ignore-branch +``` + +## 4. Importing upstream source code + +If the remote repository already has a project, you need to change the upstream version. + +(1) Download the source tarball from the upstream community + +(2) Re-compress the source tarball to match the ``_.orig.tar.[gz|xz|bz2]` format + +```Bash +# For example. +# The source tarball obtained from the upstream source community is requests-2.27.1.tar.gz +# First extract the source code +tar -xaf requests-2.27.1.tar.gz + +# Change the source directory to - +# If the source tarball from the upstream community is extracted from the requests directory +mv requests requests-2.27.1 + +# Recompress to match _.orig.tar.[gz|xz|bz2] +tar -czf requests-2.27.1 requests-2.27.1.orig.tar.gz +``` + +(3) Clone the gitee remote repository source code to local, enter the source code directory + +```Bash +# Clone the remote repository +git clone git@gitee.com:openkylin/requests.git + +# Enter the source directory +cd requests +``` +(4) Changing upstream source code + +Refer to chapter 6 of the [openKylin source package git workflow](openKylin source package git workflow.md) section "Updating upstream versions". + +- a. Import the upstream version (the zip generated in step 2) + +- ``Bash + gbp import-orig requests-2.27.1.orig.tar.gz --no-merge --pristine-tar --upstream-branch=upstream + git checkout upstream + git push + git push --tags + ``` + +- b. Filtering old patches (in conjunction with [openKylin source package git workflow] (openKylin source package git workflow.md) subsection 6.3.3) + +- If the patch is an R&D patch, then you need to confirm with the relevant R&D that the patch is still required in the new upstream source code + - If the patch is a patch from another OS distribution, then confirm with the OS distribution that the patch is still required in the latest version of the source code + +- c. Introducing patches from other OS distributions + +- You can refer to subsection 3.6, "Applying patches from other OS distributions". + + - Use git am or git apply or other methods to import patches from other OS distributions + +- d. Modify other build files in the debian directory + +- debian/control + - debian/changelog needs to retain the original changelog information + - debian/rules + - deiban/other files + +After the changes are done, you can follow section 5 and test the build locally first, then push it to the remote repository after the test is done. + +## 5. Compile the source package + +After completing the build rules for the debian directory, first compile a round of source packages based on this. The dsc file will be generated + +``Bash +## Switch to the development branch +git checkout openkylin/yangtze +# Execute in the source directory +dpkg-source -b . +``` + + + +# III. Compile + +After building the source package according to the previous section, compile it. + +You can download a chroot environment of openkylin and compile and debug in the chroot environment. + +The chroot for x86: http://files.build.openkylin.top/51159/chroot-openkylin-yangtze-amd64.tar.gz + +riscv chroot: http://files.build.openkylin.top/51197/chroot-openkylin-yangtze-riscv64.tar.gz + +At this stage, the package build rules in the debian package directory will be continuously modified and optimized until a complete installable binary package is packaged. + + + +# IV. Installation Testing + +Simply test whether the compiled binary is installable and whether the system works properly after installation, etc. + +## V. Building a git repository + +## 1. create gitee repository + +fork openkylin's community repository + +``Bash +# After fork to your personal repository, clone your personal repository to local +git clone git@gitee.com:/community.git + +# Then add the source package name to the corresponding sig group sig.yaml file +# For example, to add a package to the packaging sig, the source-name should be the actual package name +echo "- " >> sig/packaging/sig.yaml + +# Then commit the changes and push them to your personal repository +git add sig/packaging/sig.yaml +git commit -m "Add xxx package" +git push origin master +``` + +Create a PR on the gitee web side, and then have it reviewed by the community project leader. After the review, the CI platform will automatically create the corresponding git repository + +## 2. Build the git repository + +Build the git repository for the source package built in chapter 2. + +- Download the tool + +Follow the [source-packaging](https://gitee.com/openkylin/packaging-tools#源码反向构建工具-source-packing) tool instructions to download the tools and install the dependencies. + +- Build the git repository + +```Bash +. /source-packing import-to-git --dsc-file sqlite3_3.31.1-ok1.dsc --packaging-branch openkylin/yangtze +``` + +More detailed git workflow can be found in [openKylin source package git workflow](openKylin source package git workflow.md) + +## 3. Associating remote repositories and pushing to gitee + +You need the package to be compiled in chapter 3 and installed and tested in chapter 4 before pushing it to the gitee repository + +```Bash +# Go to the source code repository built in step 2 +cd sqlite3 +# Associate the remote repository and push to it +git remote add origin git@gitee.com:openkylin/sqlte3.git +git push --all && git push --tags +``` + + + +# VI. Other content + +1. A brief description of gitee's ci process. + +```Bash +1. package first push. +maintainer first pushes the package to the gitee repository by way of push, at which point the ci platform sends its package to the okbs compilation platform for compilation, and the current compilation address is (https://build.openkylin.top/~cibot/+archive/openkylin/ citest/+packages) + +2. Subsequent modification contributions. +The developer needs to fork the repository to the personal repository, then develop changes on the personal repository, and then modify the changelog to add the version number after the source code is modified, and then submit the PR to the original repository. + +maintainer review PR, PR review passed, CI platform automatically package the current PR sent to OKBS compilation platform for compilation, the compilation results will be added to the corresponding PR in the form of comments, maintainer according to the compilation results and CI platform gate check results to consider whether to accept the PR +``` + +2. The source address of each distribution, using gvfs as an example. + +Debian 11: https://tracker.debian.org/pkg/gvfs + +Ubuntu 22.04: https://launchpad.net/ubuntu/+source/gvfs + +Fedora 36: https://src.fedoraproject.org/rpms/gvfs + +Arch: https://archlinux.org/packages/extra/x86_64/gvfs/ + +Deepin: https://ftp.sjtu.edu.cn/deepin/pool/ + +openEuler: https://gitee.com/src-openeuler/gvfs \ No newline at end of file diff --git a/en/Community-Developer-Guides/Source_Package_Git_Workflows.md b/en/Community-Developer-Guides/Source_Package_Git_Workflows.md new file mode 100644 index 0000000000000000000000000000000000000000..c8f68e9ef3de45e8229d6d2bc2e3257748d8433c --- /dev/null +++ b/en/Community-Developer-Guides/Source_Package_Git_Workflows.md @@ -0,0 +1,817 @@ +# openKylin source package git workflow + +# 1. git branch settings + +| Branch | Description | Example | +| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| Upstream branch | A branch that does not contain the debian directory, holding the upstream source code of the package. Only one upstream branch is needed to modify the package, which is uniformly named upstream. For self-developed packages, multiple versions may be developed in parallel, so there may be multiple upstream branches. In order to avoid confusion with the packaging branch, "/" cannot be used in the name of the upstream branch | upstream master 1.0 2.0 | +| native packaging branch | A branch for package maintainers to submit changes, including the debian directory. Modifications relative to the upstream branch can be submitted directly to this branch. | The format of the name is: release code name/series code name The development branch of Galaxy Kirin V10 SP1 is named: yhkylin/v101openKylin The development branch of the Yangtze River version is named: openkylin/yangtze | +| quilt packaging branch | The modified package requires the use of the quilt branch for packaging. Under this branch, the changes made by the package maintainer relative to the upstream branch are stored in the debian/patches directory in the form of a patch, which is convenient for choosing when updating the upstream version. The self-developed package can be directly packaged with the native branch or quilt. The CI platform automatically completes the synchronization from the native branch to the quilt branch. | he quilt packaging branch corresponding to openkylin/yangtze, add packaging/ in front of the branch name: packaging/openkylin/yangtze | +| patch-queue branch | The temporary branch used in the CI build environment will not be submitted to the source code management platform, and assists in generating a patch from the modified content of the native packaging branch and saving it to the quilt packaging branch. | patch-queue/packaging/openkylin/yangtze | + + + +# 2. source package import + +For quilt format packages, you need to convert the package branch to native format, so that developers can manage the file modification history with git. + + +The git_init.sh script describes the specific steps to do this. + +``` +#! /bin/bash + +set -e + +[ ! -d $1 ] && echo "should specify source path" exit 1; + +cd $1 + +# Switch to the package branch +git checkout openkylin/yangtze +git checkout -b packaging/openkylin/yangtze + +# Create a temporary integration patch branch, which will automatically be named patch-queue/openkylin/yangtze +gbp pq import + +# fix patches date format +gbp pq export + +git add debian +git commit -m "format patches" || true + +git checkout openkylin/yangtze + +# Integrate patch in the package branch +git merge patch-queue/packaging/openkylin/yangtze -m "apply patches" + +# Delete temporary branches +git branch -D patch-queue/packaging/openkylin/yangtze + +# Delete the debian/patches directory +rm -rf debian/patches + +# Change the format of the format +echo "3.0 (native)" > debian/source/format + +# Commit the changes +git add debian +git commit -m "changed debian/source/format to native" + +``` +## 2.1 Importing with tools + +Importing can be done using the `source-packing` tool. + +There are three main steps. + +1. Repacking of the source code. + +``Bash +. /source-packing rebuild-source --dsc-file sqlite3_3.31.1-4kylin0.3.dsc --new-revisions ok1 +``` + +The new dsc file `sqlite3_3.31.1-ok1.dsc` will be generated + +1. Reverse build out the git repository. + +```Bash +. /source-packing import-to-git --dsc-file sqlite3_3.31.1-ok1.dsc --packaging-branch openkylin/yangtze +``` + +1. associate the remote repository and push to the remote repository (if the remote repository is not created, then you need to create the remote repository first) + +```Bash +# Go to the source code repository built in step 2 +cd sqlite3 +# Associate the remote repository and push to it +git remote add origin git@gitee.com:openkylin/sqlte3.git +git push --tags +git push --all +``` + +The details of how to use this are described in the project documentation: [source reverse build tool-source-packing](https://gitee.com/openkylin/packaging-tools#源码反向构建工具-source-packing) + +Note: You can use the manual way to import the source code, you can refer to section 3.2, 3.3 (if you use 3.1 tool reverse build successfully, 3.2, 3.3 section can be skipped) + +## 2.2 Importing source code + +```Bash +gbp import-dsc --pristine-tar --debian-branch=openkylin/yangtze --upstream-branch=upstream live-build_3.0~a57-1kylin38.20.04.2.dsc live- build +``` + +Parameter meaning + +| --pristine-tar | Record the data of the original orig tarball to avoid changes in the tarball contents after repackaging with gbp | +| ------------------ | ------------------------------------------------------------ | +| --debian-branch= | Specify the name of the branch to be packaged, refer to https://docs.qq.com/doc/DQ2tlZ1BYUHBIVGp4 | +| --upstream-branch= | Specify the name of the upstream branch, use upstream for modified packages and master for self-developed packages | + +In addition to the two branches we specified, the gbp import-dsc command will automatically create two tags. + +- debian/3.0_a57-1kylin38.20.04.2 Package branch status in version 3.0~a57-1kylin38.20.04.2 +- upstream/3.0_a57 The status of this imported upstream version 3.0~a57, we need to refer to this tag when packaging the quilt format source packages + +### 2.2.1 Special case handling when there are multiple orig packages + +3.0 (quilt)-formatted source packages support multiple orig packages, and some packages will package the upstream source's main directory and individual subdirectories separately + +https://manpages.debian.org/testing/git-buildpackage/gbp-buildpackage.1.en.html#git~6 + +For example, sqlite3, version 3.31.1-4 has two orig packages: sqlite3_3.31.1.orig.tar.xz and sqlite3_3.31.1.orig-www.tar.xz, which will be compiled by first unpacking sqlite3_3.31.1.orig.tar.xz, and then sqlite3_3.31.1.orig-www.tar.xz解压到www子目录. + +The package in this case is recognized by gbp when it is imported, but you need to specify --git-component=www when executing gbp buildpackage to successfully package it. + +You can create debian/gbp.conf and fix the --git-component option + +``Prolog +[buildpackage] +component=www +# If you have more than one, write component=['ft2docs', 'ft2demos'] +``` + +Different packages have different components, so you need to create separate debian/gbp.conf files + +Another pitfall is that if the compression of the orig and orig-component packages is different, one is xz and the other is gz, gbp buildpackage will report the following error. + + + +```Plain%20Text +gbp:warning: Components specified, pristine-tar-commit not yet supported - disabling it. +gbp:info: Creating /home/xiewei/git/perl_5.30.0.orig.tar.xz +gbp:info: Creating /home/xiewei/git/perl_5.30.0.orig-regen-configure.tar.xz +gbp:error: Error creating perl_5.30.0.orig-regen-configure.tar.xz: Pristine-tar couldn't checkout "perl_5.30.0.orig-regen-configure.tar. xz": fatal: Path 'perl_5.30.0.orig-regen-configure.tar.xz.delta' does not exist in 'refs/heads/pristine-tar' +pristine-tar: git show refs/heads/pristine-tar:perl_5.30.0.orig-regen-configure.tar.xz.delta failed +``` + +Fixes. + +1. unify the compression format, repackage perl_5.30.0.orig-regen-configure.tar.gz as perl_5.30.0.orig-regen-configure.tar.xz + +```Apache +zcat perl_5.30.0.orig-regen-configure.tar.gz | xz -c - > perl_5.30.0.orig-regen-configure.tar.xz +``` + +1. Import pristine-tar information + +```Shell +gbp pristine-tar commit --component=regen-configure path-to/perl_5.30.0.orig-regen-configure.tar.xz +``` + +## 2.3 Create native package branch, integrate patch (convert package branch to native branch for developers to compile for local testing) + +```Bash +git checkout openkylin/yangtze # switch to package branch +gbp pq import # create a temporary integrated patch branch, which will be automatically named patch-queue/openkylin/yangtze +gbp pq export # Automatically format the patch to go back to the openkylin/yangtze branch +git add debian +git commit -m 'format patch' +git branch packaging/openkylin/yangtze # Create a branch of quilt for official packaging +git merge patch-queue/openkylin/yangtze -m "apply patches" # Integrate patches in the packaging branch +git branch -D patch-queue/openkylin/yangtze # Delete the temporary branch +Then delete the debian/patches directory and change debian/source/format to "3.0 (native)" +rm -rf debian/pathes +echo "3.0 (native)" > debian/source/format +Committing changes +``` + + + +# 3. development maintainers modify packages (maintain under native package branches like openkylin/yangtze) + +## 3.1. production line code changes + +Development maintainers clone the official version of the git repository to their personal space, then modify the source files and debian/changelog directly on the package branch. + +```Bash +git checkout openkylin/yangtze +# Modify the source files +vim ... +# Modify the changelog, modify the version number according to the package version specification, for version numbers with the '-' symbol, you cannot modify the part before the '-' +dch -R +git add . +git commit +``` + +Then push it to your personal gitee or gitlab repository and submit the PR to maintainer for review. + +Local debugging can be done directly with debuild for compilation testing. + +## 3.2. Committing patch upstream after package branch changes + +To commit changes upstream, you need to export the patch first + +First run git log and find the commit numbers before and after this change + +``Bash +git log + +commit 5ba63fabc689b225cd7823a81655e531f54eed46 (HEAD -> openkylin/yangtze) +Author: Xie Wei +Date: Mon Apr 18 16:41:59 2022 +0800 + + edit version and copying + +commit 5c066ae094a7788c6507413891dab66db36cd07b +Author: Xie Wei +Date: Mon Apr 18 16:40:56 2022 +0800 + + edit COPYING + +commit e5a25c0fba1b1b68e023062878962abbebf1f8ea +Author: Xie Wei +Date: Mon Apr 18 16:40:31 2022 +0800 + + edit version + +commit 8c8ad046e88f2692bef8b193b517666d82ca6957 +Author: Xie Wei +Date: Mon Apr 18 16:35:37 2022 +0800 + + native +``` + +As shown above, assuming that you want to commit the versioning and copying changes as a complete patch, you should compare the changes between the penultimate commit and the penultimate commit. + +```Apache +# Ignore the debian directory when generating patches, older commits go first, newer commits go second +git diff --binary -r 8c8ad046e88f2692bef8b193b517666d82ca6957 -r 5ba63fabc689b225cd7823a81655e531f54eed46 ':!debian' > /tmp/live-build- change-version-copying.patch +``` + +After generating patch, it depends on what kind of submission method the upstream community accepts, directly sending patch is not introduced in this article, assuming it supports PR submission in gitee or github, then we first fork our own repository in the corresponding hosting platform, then clone to local, then import patch + +```Apache +# clone your own forked repository in the hosting platform +git clone git@gitee.com:xiewei/live-build.git live-build-upstream +cd live-build-upstream +# Switch to the branch you need to commit to, depending on the version the patch is targeting and the upstream community's branching rules +git checkout master +git apply /tmp/live-build-change-version-copying.patch +git add . +# Commit the changes +git commit +# push to your own fork repository +git push +``` + +Then it's a matter of operating on the hosting platform and committing a PR from your repository to the upstream community. + +If there are updates upstream, you have to sync the upstream changes before committing the PR, resolve the conflicts, and then commit the PR + +``Bash +# First add the address of the upstream repository to remote, clone down and only need to do it once because we only need to read and add the address of the https protocol on the line. +git remote add upstream https://gitee.com/upstream/live-build.git +# Sync upstream updates, the last argument is the name of the branch to sync +git pull upstream master +# If there are conflicts, follow the prompts to resolve them, if there are no conflicts, you can push to your fork repository +git push +git push + + + +# 4. upload the build platform (CI platform is implemented automatically) + +When uploading the build platform, you need to try to upload in quilt format to fully reuse the orig.tar file and save bandwidth and server space. + +The action of converting native format source packages into quilt format will be done automatically through CI platform. + + +## 4.1 Packaging in quilt format + +In the packaging environment clone git repository, create a temporary quilt packaging branch for packaging + +native into quilt, the main difference is to form a patch relative to the upstream code changes, rather than directly on the source file, we use gbp pq to generate the patch. + +```Bash +# switch to the quilt packaging branch +git checkout packaging/openkylin/yangtze +# Create a temporary patch-queue to automatically switch to patch-queue/packaging/openkylin/yangtze +gbp pq import +# Commit the latest changes to the native packaging branch in the patch-queue +git diff --binary -r openkylin/yangtze -- ':!debian' | git apply -R +git add . -f +# Commit the latest commits from the native package branch to the patch-queue branch for exporting patches +git log -r openkylin/yangtze -1 --pretty=format:"%s" | git commit -F - +# Export patch, automatically switch to packaging/openkylin/yangtze +gbp pq export +# Synchronize changes to the debian directory from the native packaging branch, ignoring patches and source/format +git diff --binary -r openkylin/yangtze -- debian ':!debian/patches' ':!debian/source/format' | git apply -R + +git add debian +# Commit the latest commits from the native package branch to the quilt package branch, no manual input required +git log -r openkylin/yangtze -1 --pretty=format:"%s" | git commit -F - +# Pack the source code, because gbp is packaged in the master branch by default, so you need to add the --git-ignore-branch argument, and the --git-tag argument to automatically create a tag after a successful package +gbp buildpackage --git-ignore-branch --git-tag --git-pristine-tar --git-pristine-tar-commit -S -nc +# packaging/openkylin/yangtze branch needs to be automatically saved to gitee or gitlab +git push +git push --tags +``` + +If the native branch involves binary changes, the generated patch will also have binary information, and the buildpackage will prompt ``detected 1 unwanted binary file (add it in debian/source/include-binaries to allow its inclusion)` + +Debian recommends putting the binaries you want to replace in the debian directory, then modifying the install step in debian/*.install or debian/rules to overwrite the upstream binaries at build time. Debian includes binaries, whether they are images or patches, that need to be added to debian/source/include-binaries, or just add a line to debian/source/options to include-binaries, allowing any binary to be included. + + +https://www.debian.org/doc/manuals/debmake-doc/ch08.en.html + +> If you wish to replace upstream provided PNG file **data/hello.png** with maintainer provided one **debian/hello.png**, editing **debian/install* * isn't enough. * When you add **debian/hello.png**, you need to add a line "`include-binaries`" to **debian/source/options** since PNG is See `dpkg-source`(1). + +Method to get upstream tags based on version number: (compare on top of existing patches, no more direct comparison of upstream) + +```Python +from gbp.deb.git import DebianGitRepository +version = '3.0~a57-1kylin38.20.04.4.4' +upstream_version = version.split('-')[0] +# '3.0~a57' +upstream_tag = DebianGitRepository.version_to_tag('upstream/%(version)s', upstream_version) +# 'upstream/3.0_a57' +``` + +## 4.2 Packaging in native format + +The native branch allows you to package the source code directly in the current branch and upload it to the build platform. + +```Bash +## Switch to the native packaging branch +git checkout openkylin/yangtze +# Pack the source code, since gbp is packaged in the master branch by default, so add the --git-ignore-branch argument, and the --git-tag argument to automatically create a tag after successful packaging +gbp buildpackage --git-ignore-branch --git-tag -S +# Synchronize the tags created during packaging to gitee or gitlab +git push --tags +``` + + + +# 5. update upstream version (needs to be handled manually by maintainer) + +When a package needs to update its upstream version number, it has to import the upstream source code and add the appropriate tags first. This step needs to be operated by maintainer in the official version git repository. + +The developer can then rebase the code from the package branch to the new version. + +## 5.1 Importing source code for a new upstream version (modified package) + +When the upstream version of a package is updated, a new import of the orig package is required + +```Bash +gbp import-orig . /live-build_4.0.orig.tar.gz --no-merge --pristine-tar --upstream-branch=upstream +git checkout upstream +git push +git push --tags +``` + +Parameter Meaning + +| --pristine-tar | Record data from the original orig tarball to avoid changes to the tarball after repackaging with gbp | +| ------------------ | ------------------------------------------------------------ | +| --no-merge | Do not merge the upstream version of the code into the package branch, because our package branch is in native format and the source code is modified based on upstream, so there is no way to merge it automatically. +| --upstream-branch= | Specify the name of the upstream branch, and modify the package to use upstream | + +In the above example, a new tag will be created: upstream/4.0 + +## 5.2 Creating a tag for a new version (self-published package) + +The maintainer creates the tag upstream/ based on the upstream branch (or some other upstream stable version branch) as the upstream for new version packaging. + +This can be done on gitlab and gitee. + +## 5.3 Packaging a branch rebase to a new version + +### 5.3.1 Determining if there is a patch on an old version + +``Bash +git checkout packaging/openkylin/yangtze +wc debian/patches/series +# Check out the number of patches +``` + +If there is no patch, press 5.3.2, 5.3.4. + +If there is patch, operate as 5.3.3, 5.3.4. + +### 5.3.2 rebase without patch + +Update the packaging branch + +``Bash +git checkout packaging/openkylin/yangtze +### Suppose the original version number is 2:4.11.6-ok1 and the new upstream version number is 2:4.13.17 +git merge upstream/4.13.17 +``` + +Update the native branch + +```Bash +git checkout openkylin/yangtze +# Assume the original version number is 2:4.11.6-ok1 and the new upstream version number is 2:4.13.17 +git merge upstream/4.13.17 +``` + +Change the package version number in the native branch + + +```Bash +# At this point, you can debug the code based on the upstream upstream in the native branch, such as: +# 1. Modify the code until the binary package can be compiled and installed normally +vim xxx +# 2. Perform debuild under the native branch to compile and test +build +# 3. Commit changes +git add xxx +# 4. Modify debian/changelog, the version number is based on the new upstream version. +dch -R +git add debian/changelog +git commit -m 'merge upstream 4.13.17' +``` + +### 5.3.3 Rebase with patch + +#### 5.3.3.1 Get the commit id corresponding to the old version patch + +```Bash +# Create a temporary branch based on the old version +git checkout packaging/openkylin/yangtze +git checkout -b tmp +# Import patch to form git commit record +# Before importing, you can also filter the patch list, modify debian/patches/series, delete unnecessary patches, and then submit +gbp pq import +# Calculate the number of patches +wc debian/patches/series # 14 14 511 debian/patches/series +# Get commit id, redirect to file save +git log --max-count=14 > /tmp/patch-list.txt +``` + +#### 5.3.3.2 Update the packaging branch + +```Bash +git checkout packaging/openkylin/yangtze +# Assume the original version number is 2:4.11.6-ok1, and the new upstream version number is 2:4.13.17 +git merge upstream/4.13.17 +``` + +#### 5.3.3.3 Filter the patches that need to be transplanted, respectively cherry-pick + +```Bash +# Switch to the packaging branch +git checkout packaging/openkylin/yangtze +# Clear the patch list +git rm debian/patches/series +git commit -m 'prepare for new patch list' +# Create a temporary branch and transplant the lower version patch +gbp pq import +# Read the patch-queue commit list file /tmp/patch-list.txt from the back to the front, determine whether to integrate the patch according to the submission information and the patch file name, and perform cherry-pick on the patch that needs to be integrated +git cherry-pick b2cf5dd7923c50c4b4e1809564a7da63a3e38312 f32df40245f054363698225f44158c2673a06978 2853828b649d5c826bda93c9a11a9720954b915c +# Export patch list +gbp pq export +git add debian/patches +# Then remember to modify debian/changelog, the version number is based on the new upstream version. +dch -R +git add debian/changelog +git commit -m 'Apply patches on new upstream 4.13.17' +git branch --delete --force tmp # delete tmp branch +``` + +If there is a conflict, merge the conflict according to actual needs (git mergetool; git cherry-pick --continue) or skip this patch (git cherry-pick --skip). + +> git cherry-pick basic usage + +> Pick a commit-id to merge + +> ``` +> git cherry-pick commit-id +> ``` + +-> Note: The merged commit-id will be changed, and a new commit-id will be generated, which is not the same as the original one. + +> Select multiple commit-ids to merge + +> ``` +> git cherry-pick commit-idA commit-idB +> ``` + +> Select consecutive multiple commit-ids to merge + +> ``` +> git cherry-pick commit-idA..commit-idB +> ``` + +-> This instruction is to merge all the commit-id submission records from commit-idA to commit-idB. It should be noted that commit-idA must be submitted earlier than commit-idB, that is to say, after being selected On the branch, there is commit-idA first, and then there is commit-idB + +#### 5.3.3.4 Reverse sync to native packaging branch + +```Bash +git checkout openkylin/yangtze +git diff --binary -r patch-queue/packaging/openkylin/yangtze -- ':!debian/source/format' | git apply -R +git add . +git commit -m 'merge upstream 4.13.17' +``` + +### 5.3.4 Submit to the git server + +Submit the native packaging branch and packaging branch, do not submit other temporary branches + +``` +!Push, first push the packaging branch, and then push the native branch. +``` + +```Bash +git checkout packaging/openkylin/yangtze +git push +git checkout openkylin/yangtze +git push +``` + + + +# 6. Change the self-developed package to quilt format + +(1) Unzip the source package. + +```Apache +dpkg-source -x kylin-camera_1.2kord01rc2.22.dsc +cd kylin-camera-1.2kord01rc2.22 +``` + +(2) Modify the changelog and change the version number to {upstream_version}-{revision}. + +``` +dch -R +# In the editor, change the version number from 1.2kord01rc2.22 to 1.2kord01rc2.22-0k1 +``` + +(3) Modify the debian/source/format file to 3.0 (quilt) + +```Bash +mkdir -p debian/source +echo "3.0 (quilt)" > debian/source/format +``` + +(4) Package orig.tar + +```Bash +debmake -t +``` + +(5) Generate a new dsc + +```Bash +dpkg-buildpackage -S -nc +``` + +(6) import to git + +```Apache +cd ../ +gbp import-dsc --pristine-tar --debian-branch=openkylin/yangtze --upstream-branch=upstream kylin-camera_1.2kord01rc2.22-0k1.dsc kylin-camera +``` + + + +# 7. Modify the upstream version number without changing the code of the self-developed package + +For example, when ukui is on a certain node, to uniformly upgrade the upstream version number of the currently imported packages, you need to operate as follows, + +(1) Switch to a packaging branch (such as openkylin/yangtze). + +```Shell +git checkout openkylin/yangtze +``` + +(2) Read debian/changelog to confirm the current upstream version. + +​ For example, the version number in the changelog is 3.10.0-0k0 + +(3) Modify the changelog version number, and change the upstream version to a new version number. Suppose it is to be set to 3.13.0, then the package version number in the changelog can be changed to 3.13.0-0k0. Then commit the changes. + +(4) Add an upstream tag corresponding to the new version number. + +```Shell +git tag upstream/3.13.0 upstream/3.10.0 +``` + +(5) Changes to the openkylin/yangtze branch and the new label upstream/3.13.0 are pushed to the git server. + +```Shell +git push +git push --tags +``` + +(6) Generate a new version orig.tar package (completed by CI platform). + +```Shell +# Synchronize the changelog changes to the quilt packaging branch +git diff --binary -r openkylin/yangtze debian ':!debian/patches' ':!debian/source/format' | git apply -R +git add debian +git log -r openkylin/yangtze -1 --pretty=format:"%s" | git commit -F - +# Pack and automatically save orig.tar +gbp buildpackage --git-ignore-branch --git-tag --git-pristine-tar --git-pristine-tar-commit -S -nc +# After packaging the new upstream version, the pristine-tar branch will be updated and needs to be uploaded to the git server +git push +git push origin pristine-tar +``` + + + +# 8. Overwrite the openkylin community warehouse with the modified source code of Kylin + +The premise is that the upstream version has not changed, and it is in quilt format, otherwise you need to clear the warehouse and import it or go through the "update upstream version" process. + +(1) Cover the debian directory in the quilt packaging branch + +```Shell +# Switch to the quilt packaging branch + +# Delete the existing debian directory, ready to be overwritten with the Kylin version +# Unzip the *.debian.tar file of the Kylin version +``` + +(2) Modify the version number and series code in the changelog + +Add a modification record, the version number is -ok, N is a number, which is larger than the version number in openkylin before overwriting. + +(3) Override the native branch + + + +# 9. Build the packaging branch from scratch + +This section describes how to create a packaging branch when there are only branches such as upstream that do not contain debian configuration files + +That is, create openkylin/yangtze and packaging/openkylin/yangtze branches from upstream. + +## 9.1 First clone a clean code from kylinos-src on gitlab + +```Bash +git clone git@gitlab2.kylin.com:kylinos-src/ +cd +``` + +## 9.2 Add the upstream label to the upstream branch + +We need to select a commit corresponding to the upstream version and label it upstream. + +It can be achieved in the following ways, assuming that the upstream version number is set to 1.2.3 + +(1) Package with the latest version of the upstream branch + +```Bash +git tag upstream/v1.2.3 upstream +``` + +(2) Package with an existing tag, assuming there is already a tag named v1.2.3 + +```Bash +git tag upstream/1.2.3 v1.2.3 +``` + +(3) Package based on a certain commit of the upstream branch + +```Bash +git log upstream # Find the commit id you want to use +git tag upstream/1.2.3 031eae9e49ef7b523286410d45ee44ba57e29f79 +``` + +## 9.3 Create a packaging branch based on the upstream label, and add the debian packaging configuration file + +```Bash +git checkout -b packaging/openkylin/yangtze upstream/1.2.3 +# Copy the prepared debian packaging configuration file +cp -r /path-to/debian ./ +# Modify the changelog to ensure that the version number starts with "1.2.3-" and conforms to the version number specification +dch -R +# Make sure the source package is in quilt format +mkdir -p debian/source +echo "3.0 (quilt)" > debian/source/format +# Test packaging and save pristine-tar data +gbp buildpackage --git-ignore-branch --git-tag --git-pristine-tar --git-pristine-tar-commit -S -nc +``` + +## 9.4 Create the corresponding development branch, which is convenient for developers to test locally after modifying the code + +```Bash +# Create a temporary integration patch branch, which will be automatically named patch-queue/packaging/openkylin/yangtze1 +gbp pq import +# Rename to standard development branch name +git checkout -b openkylin/yangtze +# delete temporary branch +git branch -D patch-queue/packaging/openkylin/yangtze +# Then delete the debian/patches directory and change debian/source/format to "3.0 (native)" +rm -rf debian/pathes +echo "3.0 (native)" > debian/source/format +git add debian +git commit -m 'change format to native' +``` + +## 9.5 Push to gitlab server + +```Bash +# Because the new packaging branch involves the modification of 3 branches, use push --all to simplify the operation when pushing, which is why it is necessary to clone a clean code to operate +git push origin --tags +git push origin --all +``` + +## 9.6 Create a branch of a new production line based on an existing packaging branch + +Assuming that the package branch of openkylin/yangtze already exists, it is necessary to create a new bug maintenance branch for the yangtze-2209 production line (the branch name is agreed to be openkylin/yangtze-2209), and the package maintainer will operate as follows on gitee: + +1. Access the branch list of the warehouse + +![img](https://gitee.com/openkylin/docs/raw/master/%E5%BC%80%E5%A7%8B%E8%B4%A1%E7%8C%AE/assets/openKylin% E6%BA%90%E7%A0%81%E5%8C%85git%E5%B7%A5%E4%BD%9C%E6%B5%81/%E5%88%9B%E5%BB%BA%E6 %96%B0%E4%BA%A7%E7%BA%BF%E7%9A%84%E5%88%86%E6%94%AF%E7%A4%BA%E4%BE%8B1.png) + +2. Click "New Branch" + +![img](https://gitee.com/openkylin/docs/raw/master/%E5%BC%80%E5%A7%8B%E8%B4%A1%E7%8C%AE/assets/openKylin% E6%BA%90%E7%A0%81%E5%8C%85git%E5%B7%A5%E4%BD%9C%E6%B5%81/%E5%88%9B%E5%BB%BA%E6 %96%B0%E4%BA%A7%E7%BA%BF%E7%9A%84%E5%88%86%E6%94%AF%E7%A4%BA%E4%BE%8B2.png) + +3. Enter the branch name and create two new branches respectively: + +yopenkylin/yangtze-2209 based on openkylin/yangtze + +​ packaging/openkylin/yangtze-2209 based on packaging/openkylin/yangtze + + + +# 10. There are branches in native format, converted to quilt format + +## 10.1 Mainline branch conversion + +(1) First create an upstream branch and tag based on the current version + +```Bash +# Suppose the original branch name is master, the version number in the changelog is 1.2.3, and the packaging branch to be created is openkylin/yangtze +# create upstream branch +git checkout -b upstream master +# The upstream branch should not have a debian directory +git rm -rf debian +git commit -m 'import upstream 1.2.3' +# Create an upstream tag, the version number cannot contain the - symbol +git tag upstream/1.2.3 +``` + +(2) Create a packaging branch + +```Bash +# Create quilt packaging branch +git checkout -b packaging/openkylin/yangtze master +# Change the version number and source package format to quilt +dch -v 1.2.3-0k1 "quilt format" -D v101 --force-distribution +echo '3.0 (quilt)' > debian/source/format +git add debian +git commit -m 'to quilt format' +# Create a new native packaging branch based on the quilt branch +git checkout openkylin/yangtze +echo "3.0 (native)" > debian/source/format +git commit -m 'to native format' +# Test packaging and save pristine-tar information +git checkout packaging/openkylin/yangtze +gbp buildpackage --git-pristine-tar --git-pristine-tar-commit --git-ignore-branch -S -nc +``` + +## 10.2 Custom branch conversion + +The custom branch should try to keep the upstream version consistent with the main line, but for packages that have been customized in native format, the version number may already be in the form of 1.2.3hw1. If it is changed to 1.2.3-0k1hw1, the version number will be higher than the original version number. Small, you can only continue to use the customized upstream version number. + +(1) Create custom upstream branches and tags + +```Bash +git checkout -b upstream-hw hw +git rm -rf debian +git commit -m 'import hw upstream' +git tag upstream/1.2.3hw1 +``` + +(2) Create a packaging branch, which is the same as the mainline branch, but the branch name is different. + + + +# Attachment: Individual problem handling + +**1.** + +gbp:error: Error creating libwacom_1.3.orig.tar.xz: Pristine-tar couldn't checkout "libwacom_1.3.orig.tar.xz": fatal: Path 'libwacom_1.3.orig.tar.xz.delta ' does not exist in 'refs/remotes/origin/pristine-tar' + +The reason is that the initially imported compressed package is in gz format, but debian/gbp.conf specifies the compressed format as xz. + +The solution is to modify debian/gbp.conf in the openkylin/yangtze branch, delete compression=xz, and submit. + +**2.** + +gbp:error: Error creating kbd_2.0.4.orig.tar.xz: Pristine-tar couldn't checkout "kbd_2.0.4.orig.tar.xz": xdelta3: target window checksum mismatch: XD3_INVALID_INPUT + +The compression format is the same, but the checksum is different. It may be caused by file corruption during import or a different version of the environment and ci environment. You need to re-import + +**3.** + +dpkg-source: error: detected 1 unwanted binary file (add it in debian/source/include-binaries to allow its inclusion). + +If the native branch involves binary file modification, the generated patch will also have binary information, and the buildpackage will prompt `detected 1 unwanted binary file (add it in debian/source/include-binaries to allow its inclusion)` + +Debian recommends to put the binary files to be replaced in the debian directory, and then modify the install steps of debian/*.install or debian/rules to overwrite the upstream binary files during compilation. Debian contains binary files, whether it is a picture or a patch, you need to add the file path to debian/source/include-binaries, or directly add a line of include-binaries to debian/source/options to allow any binary file to be included. + +https://www.debian.org/doc/manuals/debmake-doc/ch08.en.html + +> If you wish to replace upstream provided PNG file **data/hello.png** with maintainer provided one **debian/hello.png**, editing **debian/install** isn't enough. When you add * *debian/hello.png**, you need to add a line "`include-binaries`" to **debian/source/options** since PNG is a binary file. See `dpkg-source`(1). + + + + + + diff --git a/en/Community-Developer-Guides/System_Input_Method_Adaptation_Guide.md b/en/Community-Developer-Guides/System_Input_Method_Adaptation_Guide.md new file mode 100644 index 0000000000000000000000000000000000000000..bebaad98fd6b583b2245f841daf9163b553a6488 --- /dev/null +++ b/en/Community-Developer-Guides/System_Input_Method_Adaptation_Guide.md @@ -0,0 +1,561 @@ +__openKylin OS Input Method Adaptation Guide__ + +# 1\. __Background__. + +This document provides the introduction of fcitx5 input method framework built in openKyLin OS and the details of the work needed to adapt the input method engine to fcitx5. + +# 2\. __fcitx5 input method framework__ + +## 2\.1 __Introduction__ + +### 2\.1\.1 __Overall design architecture + +fcitx5 input method framework adopts plug-in design. In this design, it contains one fcitx5 input method framework service and several plug-in dynamic libraries. The main modules are introduced below. + +#### 2\.1\.1\.1\.1 __ fcitx5 input method framework service__ + +fcitx5 input method framework service is a service provided by fcitx5 executable program. This service is responsible for loading each plugin dynamic library and communicating with other modules. + +#### 2\.1\.1\.1\.2 __front-end plug-in module__ + +fcitx5 input method framework has several front-end plug-in modules, namely dbusfrontend, fcitx4frontend, ibusfrontend, waylandim, xim. used to be compatible with different system environments and applications. + +#### 2\.1\.1\.1\.2\.1 __dbusfrontend__ + +dbus frontend plugin is implemented by fcitx5's own protocol, Qt/GTK input method module use this frontend plugin to communicate with fcitx5. + +#### 2\.1\.1\.2\.2 __fcitx4frontend__ + +#### fcitx4 frontend plug-in provides support for applications of input method module that use fcitx4 dbus protocol. + +#### 2\.1\.1\.2\.3 __ibusfrontend__ + +ibus frontend plugin implements ibus protocol. + +#### 2\.1\.1\.2\.4 __waylandim__ + +waylandim implements Wayland's server-side protocol for providing input method protocols. + +#### 2\.1\.1\.1\.2\.5 __xim__ + +xim implements the server-side protocol for X11's input method protocol. + +#### 2\.1\.1\.1\.3 __UI plugin module__ + +fcitx5 input method framework provides three UI plug-ins, which are classic UI plug-in, kimpanel UI plug-in, and virtualkeyboard UI plug-in. + +#### 2\.1\.1\.1\.3\.1 __classic UI__ + +UI plugins used by default by fcitx5 and already integrated in the input method framework. + +#### 2\.1\.1\.1\.3\.2 __kimpanel UI__ + +UI proxy plugin for the physical keyboard input window used by fcitx5. The adaptation requires the implementation of the kimpanel server. The plugin uses the DBus interface to communicate with the server. + +#### 2\.1\.1\.1\.3\.3 __virtualkeyboard UI__ + +Virtual keyboard UI proxy plugin used by fcitx5. The adaptation requires the implementation of a virtual keyboard server. The plugin uses the DBus interface to communicate with the server. + +#### 2\.1\.1\.1\.4 __Input Method Engine Plugin Module__ + +The fcitx5 input method framework defines the interface used by the input method engine plug-in. If any input method engine implements this interface and export the input method engine object in certain format, then fcitx5 input method framework can load and use this input method engine correctly. + +### 2\.1\.2 __basic working principle__ + +Multiple front-end plug-in modules of fcitx5 input method framework are implemented to support multiple input method protocols and GUI frameworks, including XIM, Wayland, ibus and other input method protocols and Qt, GTK and other GUI frameworks. + +Among them, the dbus frontend module is responsible for dbus communication with the input method plugins of Qt and GTK GUI frameworks. + +Take Qt5 application as an example, here is a brief introduction of Qt5 application's interaction with input method engine through fcitx5 input method framework. The basic principle schematic is shown as follows. + +![inputmethod.png](./assets/system_input_method_adaptation_guide/inputmethod.png) + +#### 2\.1\.2\.1 __Qt5 input method module__ + +fcitx5\-qt project implements Qt5 defined input method interface and interface to communicate with dbus front-end plug-in of fcitx5 input method framework, so that events in Qt5 program can be sent to fcitx5 input method framework. + +#### 2\.1\.2\.2 __dbus front-end plugin__ + +Receive dbus signals sent from Qt or GTK program through dbus or call + +#### 2\.1\.2\.3 __fcitx5 input method framework__ + +dbus front-end plug-in will do some processing of event or function call and then call the function in fcitx5 input method framework, usually call the method of InputContext object to send an event to fcitx5 input method framework + +#### 2\.1\.2\.4 __UI proxy plugin__ + +fcitx5 input method framework supports multiple UI display methods, including classic UI plugin using X11 API and kimpanel plugin using remote display service. The UI proxy plugin in the schematic says kimpanel plugin, while impanel is the corresponding remote display service. This service can display the input window of the physical keyboard input method. + +#### 2\.1\.2\.5 __Input Method UI Service__ + +If the input method framework uses a UI proxy plugin, the UI proxy plugin communicates with the corresponding input method UI service. + +#### 2\.1\.2\.6 __Input Method Engine Plugin__ + +After fcitx5 input method framework receives keystroke event, after some processing, it will call the function of input method engine plug-in which implemented InputMethodEngine API defined by fcitx5. Communication with input method engine service is realized through functions in plug-in + +#### 2\.1\.2\.7 __InputMethodEngine__ + +The input method engine implements the real logic of the input method. The input method engine can either be wrapped directly in the input method engine plug-in, or the communication between the input method engine and the input method engine plug-in can be implemented by means of IPC communication. + +## 2\.2 __ Support for physical keyboard input method engine + +### 2\.2\.1 __UI support__ + +fcitx5 provides physical keyboard input method UI proxy plugin based on DBus protocol: kimpanel. the module is located in fcitx5/src/ui/kimpanel directory. + +#### 2\.2\.1\.1 __DBus service__ + +#### 2\.2\.1\.1\.1 __DBus service name__ + +org\.kde\.kimpanel\.inputmethod + +##### 2\.2\.1\.1\.2 __DBus object path__ + +/kimpanel + +##### 2\.2\.1\.1\.1\.3 __DBus interface name__ + +org\.kde\.kimpanel\.inputmethod + +#### 2\.2\.1\.2 __DBus signal__ + +The dbus signals provided by kimpanel can be called by kimpanel to enable communication from kimpanel to impanel. The impanel UI service is responsible for responding to these signals. + +#### 2\.2\.1\.2\.1 __ExecDialog__ + +Show dialog box + +#### 2\.2\.1\.2\.2\.2 __ExecMenu__ + +Show menu + +#### 2\.2\.1\.2\.3 __RegisterProperties__ + +Register menu items + +#### 2\.2\.1\.2\.4 __UpdateProperty__ + +Update a menu item + +#### 2\.2\.1\.2\.5 __RemoveProperty__ + +Remove a menu item + +#### 2\.2\.1\.2\.6 __ShowAux__ + +Whether to show Aux prompt text + +#### 2\.2\.1\.2\.7 __ShowPreedit__ + +Whether to show the pre-edit string + +#### 2\.2\.1\.2\.8 __ShowLookupTable__ + +Whether to show candidate results + +#### 2\.2\.1\.2\.9 __UpdateLookupTableCursor__ + +Update the input position cursor + +#### 2\.2\.1\.2\.10 __updatePreeditCaret__ + +Update the pre-edit string cursor + +#### 2\.2\.1\.2\.11 __UpdatePreeditText__ + +Update the pre-edit text + +#### 2\.2\.1\.2\.2\.12 __UpdateAux__ + +Update the aut auxiliary text + +#### 2\.2\.1\.2\.2\.13 __UpdateSpotLocation__ + +#### 2\.2\.1\.2\.14 __UpdateScreen__ + +#### 2\.2\.1\.2\.15 __Enable__ + +Enables or disables the input window + +#### 2\.2\.1\.3 __DBus method__ + +The dbus method provided by kimpanel can be called by the impanel UI service to enable communication from impanel to kimpanel + +#### 2\.2\.1\.3\.1 __Exit__ + +Exit fcitx5 input method framework service + +#### 2\.2\.1\.3\.2 __ReloadConfig__ + +Restart input method framework service on fcitx5 + +#### 2\.2\.1\.3\.3 __Configure__ + +Start fcitx5 configuration tool + +#### 2\.2\.1\.3\.4 __LookupTablePageUp__ + +Candidate result page up + +#### 2\.2\.1\.3\.5 __LookupTablePageDown__ + +LookupTablePageDown + +#### 2\.2\.1\.3\.6 __SelectCandidate__ + +Selects the specified candidate result + +#### 2\.2\.1\.3\.7 __PanelCreated__ + +Physical keyboard input method input window created successfully + +#### 2\.2\.1\.3\.8 __PanelCreated2__ + +The physical keyboard input window was created successfully. + +#### 2\.2\.2 __Input Method Engine Support__ + +fcitx5 provides input method engine APIs: InputMethodEngine, InputMethodEngineV2, InputMethodEngineV3 and InputMethodEngineV4. Among them, InputMethodEngineV4 adds support for virtual keyboard input method keypress events. + +#### 2\.2\.2\.2\.1 __input_engine_API__ + +#### 2\.2\.2\.1\.1 __keyEvent__ + +Function: The main function of the input method to handle key events. + +Parameters: const InputMethodEntry &entry,KeyEvent &keyEvent + +Return value type: void + +#### 2\.2\.2\.2\.1\.2 __activate__ + +Function: Activate the engine + +Parameters + +Return value type + +#### 2\.2\.2\.2\.1\.3 __deactivate__ + +Function: Deactivate the engine + +Parameter + +Return value type + +#### 2\.2\.2\.2\.1\.4 __reset__ + +Function: Reset + +Parameter + +Return value type + +#### 2\.2\.2\.1\.5 __filterKey__ + +Function: Process key events \ (key events not processed elsewhere \) + +Parameters: input method entry, key event + +Return value type: void + +Implementing the simplest physical input method only requires overriding the keyEvent function. + +## 2\\.3 __ Support for virtual keyboard input method engine + +### 2\.3\.1 __UI support__ + +fcitx5 provides virtual keyboard UI plugin based on DBus protocol: virtualkeyboard UI in fcitx5/src/ui/virtualkeyboard. The information and interface of this plugin are shown below. + +#### 2\.3\.1\.1 __DBus service__ + +#### 2\.3\.1\.1\.1 __DBus service name__ + +org\.fcitx\.Fcitx5\.VirtualKeyboardBackend + +#### 2\.3\.1\.1\.2 __DBus object path__ + +/virtualkeyboard + +#### 2\.3\.1\.1\.3 __DBus interface name__ + +org\.fcitx\.Fcitx5\.VirtualKeyboardBackend1 + +#### 2\.3\.1\.2 __DBus signal__ + +#### 2\.3\.1\.2\.1 __ShowVirtualKeyboard__ + +Function: The display signal sent to the virtual keyboard. + +Parameters: None. + +#### 2\.3\.1\.2\.2 __HideVirtualKeyboard__ + +Function: The hidden signal sent to the virtual keyboard. + +Parameters: None. + +#### 2\.3\.1\.2\.3 __UpdatePreeditCaret__ + +Function: Signal sent to the virtual keyboard to set the pre-edit text cursor position. + +Parameters. + +int preeditCursor, the number of the cursor location. + +#### 2\.3\.1\.2\.4 __UpdatePreeditArea__ + +Function: Signal sent to the virtual keyboard to set the pre-edit text. + +Parameters. + +string preeditText, the pre-edit text. + +#### 2\.3\.1\.2\.5 __UpdateCandidateArea__ + +Function: Signal sent to the virtual keyboard to set the candidate words + +Parameters. + +vector &candidateTextList, the set of candidate words for the current page, each element is a candidate word. + +bool hasPrev, if or not the previous page candidate exists. + +bool hasNext, if or not the next page candidate exists. + +int pageIndex, the page number of the current candidate page. + +#### 2\.3\.1\.2\.6 __NotifyIMActivated__ + +Function: Send the current input method activation signal to the virtual keyboard. + +Parameters. + +string uniqueName, the name of the current input method. + +#### 2\.3\.1\.2\.7 __NotifyIMDeactivated__ + +Function: Send the current input method deactivated signal to the virtual keyboard. + +Parameters + +string uniqueName, the name of the current input method. + +#### 2\.3\.1\.2\.8 __NotifyIMListChanged__ + +Function: Send a notification signal to the virtual keyboard that the current input method list has changed. + +Parameters: None. + +#### 2\.3\.1\.1\.3 __DBus method__ + +#### 2\.3\.1\.3\.1 __ProcessKeyEvent__ + +Function: Receives key events sent by the virtual keyboard and forwards them to the input method framework. + +Parameters. + +uint32\_t keyval, the value represented by the current key under the current keyboard layout, in English it is the ASCII code corresponding to the key. + +uint32\_t keycode, the unique tag value of the current key in all keyboard layouts, defined in Linux. + +uint32\_t state, modifier state of key, such as Shift, Caps Lock, etc. Details can be found in fcitx5/src/lib/fcitx\-utils/keysym\.h. + +bool isRelease, if or not the key is pressed, true is lift, false is pressed. + +uint32\_t time, timestamp when key is pressed, default is 0. + +#### 2\.3\.1\.3\.2 __ProcessVisibilityEvent__ + +Function: Receive the virtual keyboard visibility event sent by the virtual keyboard and update the visibility information in the backend module. + +Parameters + +bool visible, the visibility of the virtual keyboard, true is showing, false is hidden + +#### 2\.3\.1\.3\.3 __SelectCandidate__ + +Function: Receive the serial number of the candidate word selected by the virtual keyboard, and up-screen the candidate word. + +Parameters + +int index, the serial number of the candidate word selected by user. + +#### 2\.3\.1\.3\.4 __PrevPage__ + +Function: Receive the candidate word page request sent by virtual keyboard, switch to the previous page of the candidate word. + +Parameters: None. + +#### 2\.3\.1\.3\.5 __NextPage__ + +Function: Receive the page flip request from the virtual keyboard, and switch to the next page of candidates. + +Parameters: None. + +### 2\.3\.2 __Input method engine support__ + +InputMethodEngineV4 of fcitx5 input method engine adds virtualKeyboardEventImpl function to provide support for virtual keyboard input method key event, the related code is in fcitx5/src/lib/fcitx/inputmethodengine. + +If input method engine wants to provide support for virtual keyboard keystroke events, it needs to implement InputMethodEngineV4 interface. Otherwise, just consider to implement other three interfaces for physical keyboard input method engine. + +# 3\. __Adapt fcitx5 input method framework__ + +## 3\.1 __Physical keyboard input method engine adaptation__ + +### 3\.1\.1 __UI adaptation + +fcitx5 provides default physical keyboard input method input window UI, which can be simply divided into two kinds without considering special client side input method UI: classic UI and kimpanel UI. + +#### 3\.1\.1\.1\.1 __classic UI__ + +This UI is the input window UI provided by fcitx5 using underlying API\(X11, wayland\). + +#### 3\.1\.1\.1\.2 __kimpanel UI__ + +This UI is an input window UI proxy provided by fcitx5, which defines several dbus APIs to communicate with remote physical keyboard input UI service. This module is originally provided to solve the problem that input window is not visible due to global search interface overlay on Ubuntu. + +To simplify the adaptation, third-party input methods can consider directly adapting the dbus interface defined by this UI proxy module. + +If you want to provide a more comprehensive customization, you should also consider providing a UI proxy module similar to kimpanel. + +### 3\.1\.2 __Input Method Engine Adaptation__ + +#### 3\.1\.2\.1 __Input method configuration file writing__ + +The configuration files are divided into plugin configuration files and input method configuration files, and the fields in each configuration file have different meanings. + +Addon configuration file: addon configuration file is installed in addon directory /share/fcitx5/addon/. + +Example of Pinyin input method addon configuration file. +```c++ +[Addon] +Name[ca]=Pinyin +Name[da]=Pinyin +Name[de]=Pinyin +Name[he]=פיניין: +Name[ko]=병음 +Name[ru]=Пиньинь +Name[zh_CN]=Pinyin +Name=Pinyin +Category=InputMethod +Version=5.0.11 +//The corresponding pinyin input method so is libpinyin.so +Library=libpinyin +Type=SharedLibrary +OnDemand=True +Configurable=True + +//Addon dependencies +[Addon/Dependencies] +0=punctuation +``` + +Input method configuration file: input method configuration file is saved in input method directory /share/fcitx5/inputmethod/. + +For example, Pinyin input method engine configuration file. + +```c++ +[InputMethod] +Name[ca]=Pinyin +Name[da]=Pinyin +Name[de]=Pinyin +Name[he]=פיניין: +Name[ko]=병음 +Name[ru]=Пиньинь +Name[zh_CN]=Pinyin +Name=Pinyin +//Icon name for Pinyin input method +Icon=fcitx-pinyin +Label=Pinyin +LangCode=zh_CN +//Input method corresponding to the plug-in +Addon=pinyin +//Whether to support customization +Configurable=True +ðŸ™' ðŸ™' +#### 3\.1\.2\.2 __Project CMakeLists file compilation__ + +The project file CMakeLists file defines the compilation behavior of the input method source code file. It includes the libraries to be linked during compilation and the configuration file installation path, etc. Take the pinyin input method as an example. + +```sh +#pinyin +add_library(pinyin SHARED pinyin.cpp) +target_link_libraries(pinyin PRIVATE Fcitx5::Core) +set_target_properties(pinyin PROPERTIES PREFIX "") +install(TARGETS pinyin DESTINATION "${FCITX_INSTALL_LIBDIR}/fcitx5") + +#pinyin-addon configuration file conversion and installation +#export pinyin-addon.conf.in to pinyin-addon.conf +configure_file(pinyin-addon.conf.in pinyin-addon.conf) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pinyin-addon.conf" RENAME quwei.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon") + +# Defines the installation path of the pinyin engine configuration file +# Input Method registration file +install(FILES "pinyin.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod") +``` +#### 3\.1\.2\.3 __Implementation of physical input method engine interface__ + +The input method engine part of the adaptation that is to rewrite the defined engine related interfaces, the main one is InputMethodEngine::keyEvent\(\). Take the tinyin input method as an example. + +Inherit the AddonFactory plugin factory class and create a pinyin input method engine plugin class + +```c++ +class PinyinEngineFactory : public AddonFactory { +public: + AddonInstance *create(AddonManager *manager) override { + registerDomain("fcitx5-chinese-addons", FCITX_INSTALL_LOCALEDIR); + return new PinyinEngine(manager->instance()); + } +}; +``` +Pinyin Engine plugin class inherits InputMethodEngineV3 and implements the relevant interface functions. Such as activate\(\), deactive\(\), keyEvent\(\) and reset\(\) interfaces + +```c++ +class PinyinEngine final : public InputMethodEngineV3 { +public : + PinyinEngine(Instance *instance); + ~PinyinEngine(); + Instance *instance() { return instance_; } + void activate(const InputMethodEntry &entry, + InputContextEvent &event) override; + void deactivate(const InputMethodEntry &entry, + InputContextEvent &event) override; + void keyEvent(const InputMethodEntry &entry, KeyEvent &keyEvent) override; + void reset(const InputMethodEntry &entry, + InputContextEvent &event) override; + ... + }; +``` +## 3\.2 __Virtual keyboard input method engine adaptation__ + +### 3\.2\.1 __UI adaptation + +fcitx5 provides a default UI proxy module for virtual keyboard input method input window: virtualkeyboard UI. + +To simplify the adaptation, third-party input methods can consider directly adapting the dbus interface defined by this UI proxy module. + +If you want to provide more comprehensive customization, you should also consider providing a UI proxy module similar to virtualkeyboard. + +### 3\.2\.2 __Input Method Engine Adaptation__ + +The virtual keyboard engine adaptation is basically similar to the physical keyboard keyboard engine adaptation, the only difference is that the virtual keyboard engine needs to implement the virtualKeyboardEventImpl virtual function in the InputMethodEngineV4 class. + +# __Reference Documentation__ + +Input method engine related code documentation: https://codedocs.xyz/fcitx/fcitx5/classfcitx_1_1InputMethodEngine.html + +Implementing a simplest input method: https://fcitx-im.org/wiki/Develop_an_simple_input_method + + + + + + + + + + + + diff --git a/en/Community-Developer-Guides/assets/arm64-system-installation/ Source_Independent_Selection_Build/.keep b/en/Community-Developer-Guides/assets/arm64-system-installation/ Source_Independent_Selection_Build/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Community-Developer-Guides/assets/arm64-system-installation/ Source_Independent_Selection_Build/Example_of_the_debian_community_package_tracking_platform.png b/en/Community-Developer-Guides/assets/arm64-system-installation/ Source_Independent_Selection_Build/Example_of_the_debian_community_package_tracking_platform.png new file mode 100644 index 0000000000000000000000000000000000000000..1c80f536f0e47e6ed5dcf1c79d41558391948471 Binary files /dev/null and b/en/Community-Developer-Guides/assets/arm64-system-installation/ Source_Independent_Selection_Build/Example_of_the_debian_community_package_tracking_platform.png differ diff --git a/en/Community-Developer-Guides/assets/arm64-system-installation/ Source_Independent_Selection_Build/Software_project_selection_strategies.png b/en/Community-Developer-Guides/assets/arm64-system-installation/ Source_Independent_Selection_Build/Software_project_selection_strategies.png new file mode 100644 index 0000000000000000000000000000000000000000..e13a44777e8efb8e64785bc128126f5e5242a6a1 Binary files /dev/null and b/en/Community-Developer-Guides/assets/arm64-system-installation/ Source_Independent_Selection_Build/Software_project_selection_strategies.png differ diff --git a/en/Community-Developer-Guides/assets/source_independent_selection_build/.keep b/en/Community-Developer-Guides/assets/source_independent_selection_build/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Community-Developer-Guides/assets/source_independent_selection_build/example_of_the_debian_community_package_tracking_platform.png b/en/Community-Developer-Guides/assets/source_independent_selection_build/example_of_the_debian_community_package_tracking_platform.png new file mode 100644 index 0000000000000000000000000000000000000000..1c80f536f0e47e6ed5dcf1c79d41558391948471 Binary files /dev/null and b/en/Community-Developer-Guides/assets/source_independent_selection_build/example_of_the_debian_community_package_tracking_platform.png differ diff --git a/en/Community-Developer-Guides/assets/source_independent_selection_build/software_project_selection_strategies.png b/en/Community-Developer-Guides/assets/source_independent_selection_build/software_project_selection_strategies.png new file mode 100644 index 0000000000000000000000000000000000000000..e13a44777e8efb8e64785bc128126f5e5242a6a1 Binary files /dev/null and b/en/Community-Developer-Guides/assets/source_independent_selection_build/software_project_selection_strategies.png differ diff --git a/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/.keep b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image1.png b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image1.png new file mode 100644 index 0000000000000000000000000000000000000000..c3619dbcaeadec4eb4c5d005e977d80c0b602feb Binary files /dev/null and b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image1.png differ diff --git a/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image2.png b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image2.png new file mode 100644 index 0000000000000000000000000000000000000000..01acefe9c3c6be61be400a59ff5fe8a78d62ea3e Binary files /dev/null and b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image2.png differ diff --git a/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image3.png b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image3.png new file mode 100644 index 0000000000000000000000000000000000000000..9054d509dd3b9cc1ea2216f62c82fe671b2ace78 Binary files /dev/null and b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/image3.png differ diff --git a/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/inputmethod.png b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/inputmethod.png new file mode 100644 index 0000000000000000000000000000000000000000..a54c2560be6041052efb15a1bdb45a1e5298a3e6 Binary files /dev/null and b/en/Community-Developer-Guides/assets/system_input_method_adaptation_guide/inputmethod.png differ diff --git a/en/Community-Developer-Guides/delongOpenKylin_Packaging_Guide.md b/en/Community-Developer-Guides/delongOpenKylin_Packaging_Guide.md new file mode 100644 index 0000000000000000000000000000000000000000..caa8925c8e11affb5d28a93665e6f753e571d688 --- /dev/null +++ b/en/Community-Developer-Guides/delongOpenKylin_Packaging_Guide.md @@ -0,0 +1,566 @@ +--- +title: openKylin Packaging Guide +description: +published: true +date: 2022-06-23T06:51:53.339Z +tags: +editor: markdown +dateCreated: 2022-05-17T07:44:07.346Z +--- + +# **openKylin Packaging Guide** + + +### **About this document** + + +This document is an instructive document that introduces the production of DEB packages. It focuses on guiding you to complete the production of the first DEB package. The detailed rules for the production of DEB packages will be scattered in each specific specification. We will continue to update and improve this document. + +In writing this document, the following guidelines were followed: + +Provides an overview only, ignoring edge cases. (**Big Picture Principle**) + +Keep text short and compact. (**KISS principle**) + +Don't reinvent the wheel. (use link to **existing reference**) + +Focus on using non-graphical tools and consoles. (using **shell example**) + +Be objective. (using [popcon](http://popcon.debian.org/) etc.) + +### **1. Software packaging** + + +A software package under openKylin usually includes a collection of a series of files, which define how applications or library files can be released and deployed through package managers (such as apt, yum, etc.). As a way to replace source code compilation and installation, packaging means making DEB software packages, combining application binary files, configuration documents, man/info help pages and other files into one file, thus making software installation easier stand up. Through the package manager, a series of operations such as acquisition, installation, uninstallation, and query are completed. + +**1.1. General Rules** + + openKylin attempts to normalize various open source projects into a coherent system. Therefore, openKylin formulates this packaging guide to standardize the action of making DEB. + +- openKylin follows the general [Linux Base Standard (LSB)](https://gitee.com/link?target=http://www.linuxbase.org/). This standard aims to reduce the differences between distributions. + +- openKylin also complies with the [Linux Filesystem Hierarchy Standard (FHS)](https://gitee.com/link?target=http://www.pathname.com/fhs/). The standard is about how to manage + A reference to the Linux filesystem hierarchy. + +- In addition to following these general rules that general Linux distributions follow, this document normalizes the practical details of packaging for openKylin Community Edition. + +**1.2. Packaging Basics** + +Before using this document to create a DEB package, it is recommended that you be familiar with the following knowledge points, which are necessary for how to create a high-quality software package, and provide many detailed details. + +| | skill | | links | +|---|-------------------|------|-------------------------------------------------------------------------| +| 1 | Debian policy document | required | https://www.Debian.org/doc/Debian-policy/ | +| 2 | Debian Maintainer's Guide | required | see the https://www.Debian.org/doc/manuals/debmake-doc/index.zh-cn.html | + +**1.3. Associated Documents** + +If you plan to introduce software to openKylin official software repository, please refer to +[ openKylin contribution guide](openKylin contribution guide.md). + +**1.4. Applicability** + +In general, these guidelines apply to all versions of openKylin, including non-lifecycle releases, lifecycle releases, and development releases. + +The guidelines also cover all types and delivery scenarios of packages coming into openKylin to some extent. openKylin is a community version, so there is no guarantee that all the rules will remain unchanged. Currently, its core and most important basic principles will not change significantly in the foreseeable future. + +**1.5. Technical Reminder** + +Here are some technical suggestions, which can make it easier and more effective for you to maintain software packages with other maintainers, so that + The output of the openKylin project is maximized. + +Make your package easy to debug (debug). + +Keep your packages simple and understandable. + +Don't over-engineer packages. + +Make your packages well documented. + +Use a readable coding style. + +Write comments in the code. + +Format your code to make it consistent. + +Maintain a git repository for packages. + +### **2. Packaging rules** + + +Each operating system is self-contained, and apart from different technical routes and milestones, the organization of software packages is also different. + +The main differences focus on the following aspects: + +(1) Different package managers (fedora, openSUSE use rpm, Debian use deb, etc.). + +(2) Maintain different package lists, including different software versions. + +(3) Separate software package splitting rules. + +(4) A software dependency graph that is naturally formed based on different splitting rules. + +**2.1. Package Manager** + + openKylin does not intend to reinvent the wheel, using DEB as the base, with apt, dpkg, etc. to manage software packages. DEB format is +Debian system (including Debian and Ubuntu) exclusive installation package format, with apt +software management system, which has become the current Linux +A very popular installation package. Perhaps in the near future, if deb, apt and other tools cannot meet the needs, openKylin will consider launching a new project. + +**2.2. Software list, software selection** + + openKylin has its own collection of software lists, and currently has integrated 1000+ software packages, which are still being enriched and improved. + + The software code source of openKylin is directly taken from the stable version of the original software community, and the Debian/\* rule files are written and integrated according to this packaging specification. + + openKylin follows the Upstream First principle. + +**2.3. Software split rules** + +For upstream source code examples like the one below, we give here some typical +Scenarios and practices of multiarch package splitting: + +- a repository source *libfoo-1.0*\*\*.tar.gz\*\* + +- A software tool source code *bar-1.0*\*\*.tar.gz\*\*, the software is written in a compiled language + +- A software tool source code *baz-1.0*\*\*.tar.gz\*\*, the software is written in an interpreted language + +| binary package | type | Architecture: | Multi-Arch: | Package Contents | +|----------------|--------|---------------|-------------|----------------------------------------| +| lib foo1 | lib \* | any | same | Shared library, co-installable | +| lib foo -dev | dev \* | any | same | Shared library header files and related development files can be installed together | +| lib foo -tools | bin \* | any | foreign | Runtime support program, not co-installable | +| lib foo -doc | doc \* | all | foreign | Shared library documentation | +| bar | bin \* | any | foreign | Compiled program files cannot be co-installed | +| bar -doc | doc \* | all | foreign | Documentation files that accompany the program | +| baz | script | all | foreign | interpreted program file | + +### **3. Package verification** + + +(1) You must test your package to see if there are installation problems. The debi command helps you to test all generated binary packages. + +(2) Use lintian to check your .changes +document. The lintian command runs a number of test scripts to check for common packaging errors. +Of course, to replace the .changes generated by your own package +The filename of the file. The output of the lintian command is often marked with the following: + +- E: stands for error: Definite Debian Policy violation or a definite packaging error. + +-W: stands for warning: possible violation of Debian Policy or a possible packaging error. + +- I: stands for information: information for a specific packaging class. + +- N: stands for comment: detailed information to help you debug. + +- O: stands for overridden: a message that is overridden by the lintian-overrides file, but due to the use of + \--show-overrides option is displayed. + +(3) Check whether the binary package after software selection and packaging can use the apt command set install, remove, purge normally +and upgrade. The entire test process should be completed in accordance with the following sequence of operations: + +- Install the previous version of the package if possible; + +- upgrade packages from the previous version; + +- Downgrading the package to the previous version (optional); + +- completely remove the package; + +- Fresh install the package; + +- Uninstall the package; + +- Install the package again. + +- completely remove the package; + +If this is your first package, you should create a test package with a different version number to complete the upgrade test, so as to avoid future problems. + +(4) After installation and upgrade, verify: 1) For services, verify start/stop/restart/reload; 2) For commands, at least verify that the basic functions are available. + +(5) The source code of the software package comes with tests, which cannot be commented, deleted, or disabled at will. It is necessary to ensure that when the code is submitted, the make in the access control +The check self-test case passed. + +(6) Especially after the software is selected and upgraded, it is difficult to independently judge the impact on other software packages, and an integration test is required. + +### **4. Packaging specification** + + +Rules and norms are a process of gradual improvement, and it is necessary to ensure that existing rules are followed. + + +**4.1. Reliable source** + +- Do not embed precompiled binaries or libraries, all binaries or libraries included in the package must be compiled from the source package. Files of the binary firmware class are exempt. If it is necessary to introduce binary, it will be decided after discussion with TC. + +- The software package should try to avoid bundling multiple, separated, and upstream projects into one software package, and strive to make one package come from one community. + +- Software **should** be open source software, the definition of open source software refers to [https://opensource.org/osd.html](https://gitee.com/link?target=https://opensource.org/ osd.html) + . If it is not an open source software, it will be decided after discussion with TC. + +- Integrate open source software without legal risks, [Open Source License Directory](https://gitee.com/link?target=https://opensource.org/licenses/alphabetical). + +- The content of the Debian directory file should be adapted to openKylin and be correct, accurate, clear and concise. If you cite content from other releases, or from the original community, you must explain it at the top. + +- Software **must not** be imported if it exists in **Blacklist**. + +- Each software introduction decision is taken as a case and a reference for subsequent similar software introduction decisions. technical + Committ is responsible for the consistency of software introduction principles. + +**4.2. Architecture support** + +- The package maintainer should try to ensure that it can be successfully compiled on several architectures such as aarch64, x86_64, and MIPS. Later, as openKylin supports other architectures, the requirements for building may be increased. + +**4.3. Software Splitting** + +- The splitting of the software needs to be implemented in accordance with the openKylin software splitting rules. + +- Create corresponding binary package entries in the **Debian/control** file for all binary packages. + +- list all file paths in the corresponding **Debian/binarypackagename.install** file + +**4.4. Naming rules** + +- The name of the package consists of **package name-package version number**. If the fetched upstream source code is of the form + **hello-0.9.12.tar.gz**, you can use **hello** as the upstream source code name and put + **0.9.12** as the upstream version number. + +- Compose openKylin + There are certain restrictions on character selection for package names. The most obvious restriction should be the prohibition of uppercase letters in package names. Here is a summary of the rules in regular expression form: + + Upstream package name (**-p**): [-+.a-z0-9]{2,} + + Binary package name (**-b**): [-+.a-z0-9]{2,} + + Upstream version number (**-u**): [0-9][-+.:\~a-z0-9A-Z]\* + + openKylin revision (**-r**): [0-9][+.\~a-z0-9A-Z]\* + +- The rules for version comparison can be summarized as follows: + + Strings are compared in order from start to end. + + Characters are larger than numbers. + + Numbers are compared in integer order. + + Characters are compared in ASCII-encoded order. + +**4.5. Format specification** + +use **debmake** +The necessary template files conforming to the deb package specification can be created for package maintainers. In the generated file, comment lines starting with +**\#** +Get started, which contains some tutorial text. You must remove or modify such comment lines before uploading the package to the openKylin repository. + +Among the generated template files, the following files are very important: + +- **Debian/changelog** + The file records the history of the package and defines the version of the upstream package and openKylin on its first line + revision. All changes should be documented in a clear, formal and concise language style. + +- **debian/control** + The file describes the compiled binary package, compilation dependencies and installation dependencies of the current software package. + +- **debian/rules** file describing how to build this package + +**4.6. Dependencies** + +- Make sure that the compilation and installation dependencies of the package already exist in the openKylin repository. If not, it needs to be packaged and imported together. Compilation dependencies and installation dependencies need to be confirmed by yourself to ensure completeness. Try to avoid circular dependencies. + +- **Depends** + +This field describes the collection of all packages that this package depends on, and it can be installed only after all the packages it depends on have been installed. Please specify all the software packages that your software package must depend on here. If the dependent software packages are not installed, the software package may not work properly. + +- **Recommends** + +The packages in this item are not strictly required to be installed to ensure that the program runs. When a user installs a package, all front-end package management tools will ask if they want to install these recommended packages. **aptitude** +and **apt-get** +Will automatically install recommended packages when installing your package (users can disable this default behavior). **dpkg** +This is ignored. + +- **Suggests** + +Packages in this entry may work better with this program, but are not required. All frontends may not ask to install suggested packages when the user installs the program. **aptitude** +Can be configured to automatically install suggested packages when installing software, but this is not the default. **dpkg** and +**apt-get** will ignore this. + +- **Pre-Depends** + +Dependencies in this item are stronger than **Depends** items. Packages are only installed if pre-dependencies are installed and *configured correctly* +Then it can be installed normally. This should be used *very cautiously*, only in TC +Only available after discussion. Remember: don't use this at all. :-) + +- **Conflicts** + +This package can only be installed if all conflicting packages have been removed. Use this when the program does not run at all or has serious problems with the presence of certain packages. + +- **Breaks** + +Packages listed will be corrupted after this package is installed. Usually **Breaks** +It should be accompanied by a description of "how much the version number is less than". In this way, the package management tool will choose to upgrade the specific version of the package that is broken as a solution. + +- **Provides** + +Some types of packages define multiple alternate virtual names. Use this if your program provides the functionality of an existing virtual package. + +- **Replaces** + +When your program replaces some files in other packages, or completely replaces another package (with +**Conflicts** together). Some files in the listed packages will be overwritten by files in your package. + +**4.7. Compile and Build** + +- **Debian/rules** + The script repackages the upstream build system to compile the source code files and install the files into + \*\*\$(DESTDIR), \*\* and store the generated files in each **deb** binary package file. + +- by adding the appropriate **override_dh\_**\* + Target and write the corresponding rules, which can realize the flexible customization of **debian/rules** scripts. + +- if some specific \*\*dh_\*\**foo* needs to be invoked in the **dh** command + command to take some special action, any action that is automatically executed can be disabled by **debian/rules** + Overridden by additional Makefile targets like \*\*override_dh_\*\**foo* added in . + +- Do not embed timestamps based on system time. + +- Use "**dh \$@**" in **Debian/rules** to apply the latest **debhelper** features. + +- Export the environment variable "**LC_ALL=C.UTF-8**" in the build environment. + +- For timestamps used in upstream source code, use environment variables provided by debhelper + The value of **\$SOURCE_DATE_EPOCH**. + +### **5. An example** + +**5.1. Overall process** + +Build a single non-native Debian from the upstream source tarball **debhello-0.0.tar.gz** +The general flow of the software package can be summarized as follows: + +- The maintainer takes the upstream source tarball **debhello-0.0.tar.gz** and extracts its contents to + **debhello-0.0** directory. + +- The **debmake** command makes debian + debianize, specifically, creating a **debian** + directory and add various template files only to that directory. + +- A symbolic link named **debhello_0.0.orig.tar.gz** is created and points to + **debhello-0.0.tar.gz** file. + +- Maintainers must edit and modify template files by themselves. + +- The **debuild** command builds binary packages based on debianized source trees. + +- **debhello-0.0-1.debian.tar.xz** will be created, which contains the **debian** directory. + +**Approximate flow of software package construction.** + +\$ tar -xzmf debhello-0.0.tar.gz + +\$ cd debhello-0.0 + +\$ debmake + +... manual customization + +\$ debuild + +... + +**5.2. Template files** + +Among them, debmake is used to generate debianized template files, and the specific structure is as follows: + +**The source tree after running the basic debmake command. ** + +\$ tree + +├── debhello-0.0 + +│ ├── LICENSE + +│ ├── Makefile + +│ ├── debian + +│ │ ├── README. Debian + +│ │ ├── changelog + +│ │ ├── control + +│ │ ├── copyright + +│ │ ├── patches + +│ │ │ └── series + +│ │ ├── rules + +│ │ ├── source + +│ │ │ ├── control + +│ │ │ ├── format + +│ │ │ ├── local-options + +│ │ │ ├── options + +│ │ │ └── patch-header + +│ │ ├── tests + +│ │ │ └── control + +│ │ ├── upstream + +│ │ │ └── metadata + +│ │ └── watch + +│ └── src + +│ └── hello.c + +├── debhello-0.0.tar.gz + +└── debhello_0.0.orig.tar.gz -\> debhello-0.0.tar.gz + +7 directories, 19 files + +The **Debian/rules** files here are build scripts that should be provided by the package maintainer. At this point the file is created by +Template files generated by the **debmake** command. + +**5.3. Edit template file** + +As a maintainer, making a proper Debian package will of course require some manual tweaking of the template contents. + +In order to make the installation file part of the system file, **\$(prefix)** default in **Makefile** +The value of **/usr/local** needs to be overridden to **/usr**. To do this, follow the method given below, in the +Add the file named **override_dh_auto_install** to the **Debian/rules** file +target, set "**prefix=/usr**" in it. + +**debian/rules (maintainer version): .** + + +``` +$ vim debhello-0.0/debian/rules + ... hack, hack, hack, ... +$ cat debhello-0.0/debian/rules +#!/usr/bin/make -f +export DH_VERBOSE = 1 +export DEB_BUILD_MAINT_OPTIONS=hardening=+all +export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +export DEB_LDFLAGS_MAINT_APPEND = -Wl, --as-needed + +%: + dh $@ + +override_dh_auto_install: + dh_auto_install --prefix=/usr +``` + + +Exporting the =**DH_VERBOSE** environment variable in the **Debian/rules** file as above can force **debhelper** +The tool outputs fine-grained build reports. + +Export **DEB_BUILD_MAINT_OPTION** variable as above can be as **dpkg-buildflags** +In the man page "FEATURE +AREAS/ENVIRONMENT" section, set the hardening options. + +Exporting **DEB_CFLAGS_MAINT_APPEND** as above can force the C compiler to give all types of warnings. + +Export **DEB_LDFLAGS_MAINT_APPEND** as above +It is possible to force the linker to only link against the libraries that are really needed. + +For Makefile-based build systems, **dh_auto_install** +What the command does is basically "**\$(MAKE) install DESTDIR=Debian/debhello**". created here +The **override_dh_auto_install** target modifies its behavior to "**\$(MAKE) install +DESTDIR=Debian/debhello prefix=/usr**". + +Here are the maintainer versions of the **Debian/control** and **Debian/copyright** files. + +**Debian/control (maintainer version): .** + + +``` +$ vim debhello-0.0/debian/control + ... hack, hack, hack, ... +$ cat debhello-0.0/debian/control +Source: debhello +Section: devel +Priority: optional +Maintainer: Osamu Aoki +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.5.1 +Homepage: https://salsa.debian.org/debian/debmake-doc +Rules-Requires-Root: no + +Package: debhello +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Simple packaging example for debmake + This Debian binary package is an example package. + (This is an example only) +``` + + +in **Debian/** +There are some other template files in the directory. Depending on the scenario, they also need to be updated. The package can then be built. + +**5.4. Building packages with debuild** + +You can use **debuild** or an equivalent command tool to build a non-native Debian inside this source tree +package. + +**Debhello version 0.0 uses the debuild command to generate files: .** + + +``` +$ cd .. +$ tree -FL 1 +. +├── debhello-0.0/ +├── debhello-0.0.tar.gz +├── debhello-dbgsym_0.0-1_amd64.deb +├── debhello_0.0-1.debian.tar.xz +├── debhello_0.0-1.dsc +├── debhello_0.0-1_amd64.build +├── debhello_0.0-1_amd64.buildinfo +├── debhello_0.0-1_amd64.changes +├── debhello_0.0-1_amd64.deb +└── debhello_0.0.orig.tar.gz -> debhello-0.0.tar.gz +1 directory, 9 files +``` + + +You can see all generated files. + +- **debhello_0.0.orig.tar.gz** is a symlink to the upstream source tarball. + +- **debhello_0.0-1.debian.tar.xz** contains content generated by the maintainer. + +- **debhello_0.0-1.dsc** is the metadata file for Debian source packages. + +- **debhello_0.0-1_amd64.deb** is a Debian binary package. + +- **debhello-dbgsym_0.0-1_amd64.deb** is the Debian debug symbols binary package. + +- **debhello_0.0-1_amd64.build** is the build log file. + +- **debhello_0.0-1_amd64.buildinfo** is **dpkg-genbuildinfo** + Generated metadata file. + +- **debhello_0.0-1_amd64.changes** is the metadata file for Debian binary packages. + + + + + + + diff --git a/en/Community-Developer-Guides/openKylin_SDK_Guide_V2.0.md b/en/Community-Developer-Guides/openKylin_SDK_Guide_V2.0.md new file mode 100644 index 0000000000000000000000000000000000000000..4c6d033dc941cf8df20b2e236dc11b86649db449 --- /dev/null +++ b/en/Community-Developer-Guides/openKylin_SDK_Guide_V2.0.md @@ -0,0 +1,3134 @@ +![Enter a picture description](assets/system_input_method_adaptation_guide/image3.png) + +# openSDK V2.0 ------ Development Guide + +![Enter a picture description](assets/system_input_method_adaptation_guide/image1.png) + +![Enter a picture description](assets/system_input_method_adaptation_guide/image2.png) + +openSDK SIG + + +Table of contents + + +``` +1 Overview +2 Deployment methods +3 System Capability SDK + 3.1 System Information + 3.1.1 System time reporting + 3.1.2 Get hardware information + 3.1.3 Get package list information + 3.1.4 Obtain resource information + 3.1.5 Obtain basic operating system information + 3.1.6 Get network information + 3.1.7 Get system runtime information + 3.1.8 Get current geographic information + 3.2 Power Management + 3.2.1 Lock Screen Settings + 3.3 File Management + 3.4 AI capabilities + 3.4.1 OCR character recognition function + 3.5 Printer Management +4 Application Support SDK + 4.1 QT self-developed control module + 4.1.1 Form module + 4.1.2 Dialog Module + 4.1.3 Input box module + 4.1.4 Button module + 4.1.5 Bar module + 4.1.6 Slider Module + 4.1.7 Message Prompt Module + 4.1.8 Breadcrumbs KBreadCrumb + 4.1.9 KCommentPanel + 4.1.10 KListView + 4.1.11 KTags + 4.1.12 KTranslucentFloor + 4.2 Wayland-helper + 4.2.1 WindowManager + 4.2.2 WindowInfo + 4.2.3 UkuiStyleHelper + 4.3 Apply general function modules + 4.3.1 Log module + 4.3.2 System related modules + 4.3.3 d-bus module------will be obsolete soon + 4.3.4 System information module +5 Basic Development SDK + 5.1 log + 5.2 Timers + 5.3 C language string extension + 5.4 Linked list module + 5.5 Configuration file operation + 5.6 Unit conversion +``` + + + +# 1 Overview + + + The openKylin self-developed developer kit (hereinafter referred to as openSDK) is based on the openKylin community operating system, providing a safe, reliable, fast, and stable developer interface for ecological construction and software development. Compared with other developer kits or frameworks in the community, openSDK focuses more on solving the problems of compatibility, adaptation, transplantation, optimization and other aspects of the open Kylin desktop operating system. openSDK currently focuses on three major modules, including application support SDK, system capability SDK, and basic development SDK, while fully considering the compatibility of openSDK. + + This document aims to provide developers with an efficient way to refer to the declaration and usage of openSDK interfaces when developing applications on the openKylin system. Reduce the learning cost for developers when using openSDK. + + The overall modules of the SDK are introduced as follows: + +| module | describe | +|---|---| +| Application support SDK | Focusing on the application display layer, it provides developers with Kirin self-developed controls, provides graphical development functions for graphical applications, and can use a unified UI framework to manage application windows and interact with the system, reducing application development and application migration. study cost; | +| System Capability SDK | Focus on providing developers with more system capabilities, developers can quickly obtain basic system, hardware information, current runtime information, etc., improve development efficiency, and help development focus more on actual business content;| +| Basic Development SDK | Focus on the application development process, providing developers with log management, package string processing and other capabilities to improve development efficiency; | + + +# 2 Deployment method + + + When downloading and using the openKylin community self-developed developer kit, you need to add the openSDK source address in advance. The installation steps are as follows: + + (1) Software source: + + +``` +deb http://archive.build.openKylin.top/openkylin/ yangtze main cross pty + +deb http://archive.build.openKylin.top/openkylin/ yangtze-security main cross pty + +deb http://archive.build.openKylin.top/openkylin/ yangtze-updates main cross pty +``` + + +(2) Update source after configuration: + + +``` +$ sudo apt update +``` +# 3 System Capability SDK + + Each software package in the system capabilities SDK expresses one or a type of system capabilities, such as operating system information, hardware management, system built-in security policies, network management, etc.; + + Install command: + +``` +$ sudo apt-get install libkysdk-system libkysdk-system-dev +``` + +## 3.1 System information + + The design of this layer mainly provides applications with functional interfaces related to the operating system, and re-realizes OS-related functions (such as file systems, hardware information, communication, etc.) from the perspective of functions in three ways: self-development, combination, and packaging; Development complexity and debugging difficulty brought about by system differences and platform differences. + +### 3.1.1 System time reporting + + The com.kylin.kysdk.TimeServer Dbus service will send out a time signal when the system time is at an integral minute or when the system time is modified. + + +``` +$ sudo apt-get install libdbus-1-dev libdbus-glib-1-dev libkysdk-systime libkysdk-systime-dev +``` + + (1) dbus service name: com.kylin.kysdk.TimeServer + + (2) Path name: /com/kylin/kysdk/Timer + + (3) Interfaces: com.kylin.kysdk.TimeInterface + + (4) Signal: + + System time modification signal: TimeChangeSignal + + Timed timing signal: TimeSignal + + System time modification time reporting + +
submoduleProgramming languageStatementDescription
System time reportingCVoid TimeChangeSignal(const char* t)When the system time is modified, the com.kylin.kysdk.TimeServerDbus service will send out a time signal
parameter descriptionreturn value description
t: current time such as: "2021/09 /26 21:13:28"none
+ + + + + system time full minutes + + +
SubmoduleProgramming languageStatementDescription
System time reportingCvoid TimeSignal(const char* t)When the system time is in full minutes, the com.kylin.kysdk.TimeServerDbus service will send out a time signal
parameter descriptionreturn value description
t: current time such as: "2021/ 09/26 21:07:00"none
+ + +### **3.1.2** Get hardware information + +``` + +$ sudo apt-get install libkysdk-hardware libkysdk-hardware-dev +``` + +#### **3.1.2.1** Get CPU information + + Encapsulate C interface to obtain CPU information + + (1) CMakeLists.txt build project + ``` + + aux_source_directory(. SOURCESCODE) + + include_directories(.) + + add_library(kyhw SHARED \${SOURCESCODE}) + + add_executable(kycpu-test test/kycpu-test.c) + + target_link_libraries(kyhw kylog kyconf pthread systemd udev) + + target_link_libraries(kycpu-test kyhw) + ``` + + (2) To obtain hardware CPU information, a header file needs to be added: +``` +#include "kysdk/kysdk-system/libkycpu.h" +``` + + Get CPU architecture + + +
submoduleProgramming languageStatementDescription
Get CPU informationCextern const char* kdk_cpu_get_arch()Get CPU Architecture
Parameter DescriptionReturn value description
Noneconst char* schema Information, such as "x86_64"; the return is const char*, not free
+ + + + Get CPU Manufacturer + +| submodule | Programming language | statement | describe | +|---------|------|-----------------------------------------|------------------------------------------------------------| +| Get CPU information | C | extern const char* kdk_cpu_get_vendor() | Get the CPU manufacturer | +| | | Parameter Description | Return value description | | +| | | none | const char* manufacturer string, such as "GenuineIntel"; return const char*, do not free | + + + + Get CPU model + + +| submodule | Programming language | statement | describe | +|---------|------|----------------------------------------|----------------------------------------------------------------------------------------| +| Get CPU information | C | extern const char* kdk_cpu_get_model() | Get the CPU model | +| | | Parameter Description | Return value description | | +| | | none | const char* CPU model name, such as "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz"; return const char*, do not free | + + + + + + Get the rated CPU frequency + + +| submodule | Programming language | statement | describe | +|---------|------|-------------------------------------------|---------------------------------------------------------------| +| Get CPU information | C | extern const char* kdk_cpu_get_freq_MHz() | Obtain CPU rated main frequency | +| | | Parameter Description | Return value description | | +| | | none | const char* rated main frequency hertz number, such as "1794.742", the unit is MHz; return const char*, do not free | + + + + + Get the number of CPU cores + + +| submodule | Programming language | statement | describe | +|---------|------|--------------------------------------------|---------------------------| +| Get CPU information | C | extern unsigned int kdk_cpu_get_corenums() | Get the number of CPU cores | +| | | Parameter Description | Return value description | | +| | | none | unsigned int number of all available CPU cores | + + + + Get CPU support for virtualization + + +| submodule | Programming language | statement | describe | +|---------|------|--------------------------------|--------------------------------------------------------------------------| +| Get CPU information | C | const char* kdk_cpu_get_virt() | Get CPU support for virtualization | +| | | Parameter Description | Return value description | | +| | | none | const char* If the CPU supports virtualization, return virtualization technology, such as "vmx"; if not, return NULL; return const char*, do not free | + + + +#### **3.1.2.2** Get network card information + + Encapsulate the C interface to obtain the hardware information of the network card. + + (1) CMakeLists.txt build project + ``` + aux_source_directory(. SOURCESCODE) + + include_directories(.) + + add_library(kyhw SHARED \${SOURCESCODE}) + + add_executable(kync-test test/kync-test.c) + + target_link_libraries(kyhw kylog kyconf pthread systemd udev) + + target_link_libraries(kync-test kyhw) + ``` + + (2) To obtain network card information, you need to add a header file: + +``` + #include "kysdk/kysdk-system/libkync.h" +``` + Get all network cards in the system + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------|-----------------------------------------------------------------------| +| Get network card information | C | extern char** kdk_nc_get_cardlist() | Get all network cards in the system | +| | | Parameter Description | Return value description | | +| | | none | char** A list of network card names, ending with a NULL string; generated by alloc and needs to be recycled by kdk_nc_freeall; if an error occurs, return NULL; | + + + Check whether the specified network card is in UP state + + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------|-------------------| +| Get network card information | C | extern int kdk_nc_is_up(const char *nc) | Detect whether the specified network card is in the UP state | +| | | Parameter Description | Return value description | | +| | | nc:Network card name, such as eno1 | int Up returns 1, Down returns 0 | + + + + Get the list of network cards currently in link up state in the system + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------|-----------------------------------------------------------------------| +| Get network card information | C | extern char** kdk_nc_get_upcards() | Get the list of network cards currently in link up state in the system | +| | | Parameter Description | Return value description | | +| | | none | char** A list of network card names, ending with a NULL string; generated by alloc and needs to be recycled by kdk_nc_freeall; if an error occurs, return NULL; | + + + + Get the physical MAC address of the specified network card + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------|-------------------------------------------------| +| Get network card information | C | extern char* kdk_nc_get_phymac(const char *nc) | Obtain the physical MAC address of the specified network card | +| | | Parameter Description | Return value description | | +| | | nc:Network card name, such as eno1 | char* Physical MAC address, generated by alloc, should be free; if the specified network card does not exist, return NULL | + + + + Get the first IPv4 address of the specified network card + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------------|-----------------------------| +| Get network card information | C | extern char* kdk_nc_get_private_ipv4(const char *nc) | Get the first IPv4 address of the specified network card | +| | | Parameter Description | Return value description | | +| | | nc:Network card name, such as eno1 | char* IPv4 address, get an error or return NULL if there is no IP | + + + + Get all IPv4 addresses of the specified network card + + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------------|----------------------------------------------------------------------| +| Get network card information | C | extern char** kdk_nc_get_ipv4(const char* nc) | Get all IPv4 addresses of the specified network card | +| | | Parameter Description | Return value description | | +| | | nc:Network card name, such as eno1 | char** IPv4 address list, ending with NULL, generated by alloc, needs to be reclaimed by kdk_nc_freeall; if there is an error in obtaining, return NULL; | + + + + Get the first IPv6 address of the specified network card + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------------|-----------------------------| +| Get network card information | C | extern char* kdk_nc_get_private_ipv6(const char *nc) | Get the first IPv6 address of the specified network card | +| | | Parameter Description | Return value description | | +| | | nc:Network card name, such as eno1 | char* IPv6 address, get an error or return NULL if there is no IP | + + + Get all IPv6 addresses of the specified network card + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------------|----------------------------------------------------------------------| +| Get network card information | C | extern char** kdk_nc_get_ipv6(const char *nc) | Get all IPv6 addresses of the specified network card | +| | | Parameter Description | Return value description | | +| | | nc:Network card name, such as eno1 | char** IPv6 address list, ending with NULL, generated by alloc, needs to be reclaimed by kdk_nc_freeall; if there is an error in obtaining, return NULL; | + + + + Get the wired/wireless type of the specified network card + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------|----------------| +| Get network card information | C | extern int kdk_nc_is_wireless(const char *nc); | Get the wired/wireless type of the specified network card | +| | | Parameter Description | Return value description | | +| | | nc:Network card name, such as eno1 | 0 : Wired
1 : Wireless | + + + + + Get the manufacturer name and device model of the specified network card + +
submoduleProgramming languagestatementdescribe
Get network card informationCextern int kdk_nc_get_vendor_and_product(const char *nc, char *vendor, char *product);Get the manufacturer name and device model of the specified network card
Parameter DescriptionReturn value description
nc:Network card name, such as eno1vendor:Buffer accepting vendor name product: Buffer accepting device model0 : success 1 : failure
+ + + List of recycled strings + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------------|---------| +| Get network card information | C | extern inline void kdk_nc_freeall(char **ptr) | list of recycled strings | +| | | Parameter Description | Return value description | | +| | | ptr:list of strings | none | + + + +#### **3.1.2.3** get disk information + + Encapsulate the C interface to obtain the hardware information of the network card. + + (1)CMakeLists.txt build project +``` + aux_source_directory(. SOURCESCODE) +add_library(kydiskinfo SHARED ${SOURCESCODE}) +set_target_properties(kydiskinfo PROPERTIES VERSION 1.2.0 SOVERSION 1) +add_executable(test-getdiskinfo test/getdiskinfo.c) +add_executable(test-getdisklist test/getdisklist.c) +find_library(UDEV_LIB udev) +target_link_libraries(kydiskinfo blkid kylog pthread systemd kyconf ${UDEV_LIB}) +target_link_libraries(test-getdiskinfo kydiskinfo) +target_link_libraries(test-getdisklist kydiskinfo) +``` + (2)Get network card information,Need to add header file: +``` + #include "kysdk/kysdk-system/libkydiskinfo.h" +``` + Get a list of all disks in the system + + +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------|-----------------------------------------| +| get disk information | C | extern char** kdk_get_disklist() | Get a list of all disks in the system | +| | | Parameter Description | Return value description | | +| | | none | char**, Each string represents the absolute path of a disk, ending with a NULL character | + + + Free the list of disks returned by kdk_get_disklist + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------|----------------------------| +| get disk information | C | extern void kdk_free_disklist(char** disklist) | Free the list of disks returned by kdk_get_disklist | +| | | Parameter Description | Return value description | | +| | | disklist :String pointer returned by kdk_get_disk_list | none | + + + + Obtain the disk information of the specified disk in the system + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------------------|-------------------------------| +| get disk information | C | extern kdk_diskinfo *kdk_get_diskinfo(const char *diskname) | Get the disk information of the specified disk | +| | | Parameter Description | Return value description | | +| | | diskname:Specifies the disk name, which should be an absolute path such as /dev/sda, or an element in disklist | kdk_diskinfo* The detailed information of the disk, the specific information is self-obtained | + + + + Free the disk information structure returned by kdk_get_diskinfo + +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|-------------------------------| +| get disk information | C | extern void kdk_free_diskinfo(kdk_diskinfo *disk); | Release the disk information structure returned by kdk_get_diskinfo | +| | | Parameter Description | Return value description | | +| | | disk:Structure pointer returned by kdk_get_diskinfo | none | + + + +#### 3.1.2.4 Get bios information + + Encapsulate C interface to obtain bios hardware information. + + (1) CMakeLists.txt build project +``` +aux_source_directory(. SOURCESCODE) +include_directories(.) +add_library(kyhw SHARED ${SOURCESCODE}) +add_executable(kybios-test test/kycpu-test.c) +target_link_libraries(kyhw kylog kyconf pthread systemd udev) +target_link_libraries(kybios-test kyhw) +``` + (2)To get bios information, you need to add a header file: +``` + #include "kysdk/kysdk-system/libkybiosinfo.h" +``` + Get bios vendor information + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------|---------------------| +| get disk information | C | extern const char *kdk_bios_get_vendor(); | Obtain bios vendor information | +| | | Parameter Description | Return value description | | +| | | none | Successfully returns the bios manufacturer, fails and returns null | + + + + Get bios version information + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------------------|---------------------| +| get disk information | C | extern const char *kdk_bios_get_version(); | Get bios version information | +| | | Parameter Description | Return value description | | +| | | none | Successfully returns the bios version, fails to return null | + + + + Free memory + + +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------|---------------| +| get disk information | C | extern void kdk_bios_free(char* info); | Release the memory requested by the information acquisition interface | +| | | Parameter Description | Return value description | | +| | | Get the pointer returned by the information interface | none | + + + +#### 3.1.2.5 Obtain motherboard information + + The package C interface gets the motherboard hardware information. + + (1) CMakeLists.txt build project +``` +aux_source_directory(. SOURCESCODE) +include_directories(.) +add_library(kyhw SHARED ${SOURCESCODE}) +add_executable(kyboard-test test/kycpu-test.c) +target_link_libraries(kyhw kylog kyconf pthread systemd udev) +target_link_libraries(kyboard-test kyhw) +``` + (2)To obtain motherboard information, you need to add header files: +``` + #include "kysdk/kysdk-system/libkyboardinfo.h" +``` + Obtain motherboard product name information + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------|---------------------| +| get disk information | C | extern const char *kdk_board_get_name(); | Get motherboard product name | +| | | Parameter Description | Return value description | | +| | | none | Successfully returns the product name of the mainboard, and fails to return null | + + + + Get the motherboard production date + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------|---------------------| +| get disk information | C | extern const char *kdk_board_get_date(); | Get the motherboard production date | +| | | Parameter Description | Return value description | | +| | | none | If it succeeds, it will return the production date of the motherboard, if it fails, it will return null | + + + Get the motherboard serial number + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------------------|--------------------| +| get disk information | C | extern const char *kdk_board_get_serial(); | Get the motherboard serial number | +| | | Parameter Description | Return value description | | +| | | none | Returns the serial number of the motherboard successfully, and returns null if it fails | + + + Obtain motherboard manufacturer information + + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------------------|---------------------| +| get disk information | C | extern const char *kdk_board_get_vendor(); | Obtain motherboard manufacturer information | +| | | Parameter Description | Return value description | | +| | | none | Successfully returns motherboard manufacturer information, fails to return null | + + + + Free memory + + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------|---------------| +| get disk information | C | extern void kdk_board_free(char* info); | Release the memory requested by the information acquisition interface | +| | | Parameter Description | Return value description | | +| | | Get the pointer returned by the information interface | none | + + + +#### 3.1.2.6 Get usb device information + + Encapsulate the C interface to obtain the hardware information of the usb device. + + (1) CMakeLists.txt build project +``` +aux_source_directory(. SOURCESCODE) +include_directories(.) +add_library(kyhw SHARED ${SOURCESCODE}) +add_executable(kyusb-test test/kyusb-test.c) +target_link_libraries(kyhw kylog kyconf pthread systemd udev) +target_link_libraries(kyusb-test kyhw) +``` + (2)To obtain usb device information, you need to add header files: + +``` + #include "kysdk/kysdk-system/libkyusbinfo.h" +``` + Get all usb device information + + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------------------|----------------------------------------| +| get disk information | C | extern pDriverInfoList kdk_usb_get_list(); | Get usb device information | +| | | Parameter Description | Return value description | | +| | | none | pDriverInfoList : The structure pointer of the usb device information, the specific information is self-obtained | + + free memory + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------|--------------| +| get disk information | C | extern void kdk_usb_free(pDriverInfoList list); | Release the memory allocated when obtaining information | +| | | Parameter Description | Return value description | | +| | | list:kdk_usb_get_list()return pointer | none | + + + +### **3.1.3** Get package list information + + Encapsulates the C interface to obtain all package information in the system. + + +``` +$ sudo apt-get install libkysdk-package libkysdk-package-dev +``` + + (1)CMakeLists.txt build project + +``` +aux_source_directory(. SOURCESCODE) +include_directories(.) +add_library(kypackage SHARED ${SOURCESCODE}) +add_executable(kypackage-test test/kypackage-test.c) +target_link_libraries(kypackage-test kypackage) +``` + (2)Get package list information, you need to add header files: +``` + #include "kysdk/kysdk-system/libkypackages.h" +``` + Get a list of all packages in the system + + +| submodule | Programming language | statement | describe | +|---------|------|--------------------------------------------------------|----------------------------------------------------------------------| +| Get package list information | C | extern kdk_package_list* kdk_package_get_packagelist() | Get a list of all packages in the system | +| | | Parameter Description | Return value description | | +| | | none | kdk_package_list* package describe structure list; the returned structure needs to be recycled by kdk_package_free_packagelist() | + + + + Get the version number of the specified package in the system + + +| submodule | Programming language | statement | describe | +|---------|------|--------------------------------------------------------|---------------------------------------------| +| Get package list information | C | extern char* kdk_package_get_version(const char *name) | Get the version number of the specified package in the system | +| | | Parameter Description | Return value description | | +| | | name:package name | char* version number, generated by alloc, needs to be free; if the given package does not exist, return NULL | + + + + Check whether the package with the specified package name is installed correctly + + +
submoduleProgramming languagestatementdescribe
Get package list informationCextern int kdk_package_is_installed(const char *name, const char *version)Check whether the package with the specified package name is installed correctly
Parameter DescriptionReturn value description
name:Package name version: version number, NULL in most cases, reserved for snapint returns 0 on success, returns an error code on failure
+ + +### **3.1.4** Get resource information + + Encapsulate the C interface to obtain the usage rate of memory, swap partition, and cpu. + + +``` +$ sudo apt-get install libkysdk-proc libkysdk-proc-dev + +``` + + + (1)CMakeLists.txt build project +``` +aux_source_directory(. SOURCESCODE) +include_directories(.) +add_library(kyrtinfo SHARED ${SOURCESCODE}) +add_executable(kyrtinfo-test test/kyrtinfo-test.c) +target_link_libraries(kyrtinfo-test kyrtinfo) +``` + (2)Get package list information, you need to add header files: +``` + #include "kysdk/kysdk-system/libkyrtinfo.h" +``` + Get the total size of physical memory in the system + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------------|-----------------------------| +| Get resource information | C | extern unsigned long kdk_rti_get_mem_res_total_KiB() | Get the total size of physical memory in the system | +| | | Parameter Description | Return value description | | +| | | none | unsigned long Physical memory size, in KiB | + + + + Get physical memory usage + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------------------------|---------------| +| Get resource information | C | extern float kdk_rti_get_mem_res_usage_percent() | Get physical memory usage | +| | | Parameter Description | Return value description | | +| | | none | float physical memory usage | + + + + Get the physical memory usage size + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------------|------------------------------------| +| Get resource information | C | extern unsigned long kdk_rti_get_mem_res_usage_KiB() | Get the size of physical memory usage, note that Buffer/Cache is calculated as used memory | +| | | Parameter Description | Return value description | | +| | | none | unsigned long Physical memory usage size, in KiB | + + + + Get the actual available physical memory size + + +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------------|-------------------------------------------| +| Get resource information | C | extern unsigned long kdk_rti_get_mem_res_available_KiB() | Get the actual available physical memory size,This value is approximately equal to Free + Buffer + Cache | +| | | Parameter Description | Return value description | | +| | | none | unsigned long Available physical memory size, in KiB | + + + + Get the actual free physical memory size + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------------------|---------------------------------------| +| Get resource information | C | extern unsigned long kdk_rti_get_mem_res_free_KiB() | Get the actual free physical memory size,Note that Buffer/Cache is counted as used memory | +| | | Parameter Description | Return value description | | +| | | none | unsigned long Free physical memory size, in KiB | + + + Get the total amount of virtual memory requested by all applications + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------------|-------------------------------| +| Get resource information | C | extern unsigned long kdk_rti_get_mem_virt_alloc_KiB() | Get the total amount of virtual memory requested by all applications | +| | | Parameter Description | Return value description | | +| | | none | unsigned long The total application amount of virtual memory, in KiB | + + + Get the total size of the Swap partition in the system + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------------|-------------------------------| +| Get resource information | C | extern unsigned long kdk_rti_get_mem_swap_total_KiB() | Get the total size of the Swap partition in the system | +| | | Parameter Description | Return value description | | +| | | none | unsigned long SwapPartition size, in KiB | + + + + Get Swap partition usage + +| submodule | Programming language | statement | describe | +|--------|------|---------------------------------------------------|-----------------| +| Get resource information | C | extern float kdk_rti_get_mem_swap_usage_percent() | Get Swap partition usage | +| | | Parameter Description | Return value description | | +| | | none | float Swap Partition usage | + + + + Get Swap partition usage + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------------|--------------------------------| +| Get resource information | C | extern unsigned long kdk_rti_get_mem_swap_usage_KiB() | Get Swap partition usage | +| | | Parameter Description | Return value description | | +| | | none | unsigned long Swap partition usage, in KiB | + + + + Get free size of Swap partition + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------------|---------------------------------| +| Get resource information | C | extern unsigned long kdk_rti_get_mem_swap_free_KiB() | Get free size of Swap partition | +| | | Parameter Description | Return value description | | +| | | none | unsigned long Swap partition free size, in KiB | + + + + Get the instantaneous CPU usage + + +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------|--------------------------| +| Get resource information | C | extern float kdk_rti_get_cpu_current_usage() | Get the instantaneous CPU usage | +| | | Parameter Description | Return value description | | +| | | none | float Instantaneous CPU usage, the value < 1.00 | + + + Get the operating system boot time + + +| submodule | Programming language | statement | describe | +|--------------------|----------------|------------------------------------------------------------------------------------------------------------|------------| +| Get resource information | C | extern int kdk_rti_get_uptime(unsigned int *day, unsigned int *hour, unsigned int *min, unsigned int *sec) | Get the operating system boot time | +| | | Parameter Description | Return value description | | +| | | day:The number of working days
hour, the value must be < 24
min: the number of minutes, the value must be < 60
sec: the number of seconds, the value must be < 60 | int Return 0 for success, return non-zero for failure | + + + Get the CPU usage of the specified process + + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------------------------------------|---------------| +| Get resource information | C | extern float kdk_get_process_cpu_usage_percent(int proc_num) | Get the CPU usage of the specified process | +| | | Parameter Description | Return value description | | +| | | proc_num:process number | float CPU usage | + + + + Get the memory usage of the specified process + + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------------------------------------|--------------| +| Get resource information | C | extern float kdk_get_process_mem_usage_percent(int proc_num) | Get the memory usage of the specified process | +| | | Parameter Description | Return value description | | +| | | proc_num:process number | float memory usage | + + + + Get the process status of the specified process + + +| submodule | Programming language | statement | describe | +|--------|------|---------------------------------------------------|-------------| +| Get resource information | C | extern char* kdk_get_process_status(int proc_num) | Get the process status of the specified process | +| | | Parameter Description | Return value description | | +| | | proc_num:process number | char* process status | + + + + Get the port number occupied by the specified process + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------------|--------------| +| Get resource information | C | extern int kdk_get_process_port(int proc_num) | Get the port number occupied by the specified process | +| | | Parameter Description | Return value description | | +| | | proc_num:process number | char* port number used | + + + + Get the startup time of the specified process + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------------|-------------| +| Get resource information | C | extern char* kdk_get_process_start_time(int proc_num) | Get the startup time of the specified process | +| | | Parameter Description | Return value description | | +| | | proc_num:process number | char* Start Time | + + Get the running time of the specified process + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------------|-------------| +| Get resource information | C | extern char* kdk_get_process_start_time(int proc_num) | Get the running time of the specified process | +| | | Parameter Description | Return value description | | +| | | proc_num:process number | char* running time | + + + + Get the cpu time of the specified process + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------------------|--------------| +| Get resource information | C | extern char* kdk_get_process_cpu_time(int proc_num) | Get the cpu time of the specified process | +| | | Parameter Description | Return value description | | +| | | proc_num:process number | char* cpu时间 | + + + + Get the Command of the specified process + + +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get resource information | C | extern char* kdk_get_process_command(int proc_num) | Get the Command of the specified process | +| | | Parameter Description | Return value description | | +| | | proc_num:process number | char* Command | + + + +Get the owner of the specified process + + +
submoduleProgramming languageStatementDescription
Get resource informationCextern char* kdk_get_process_user(int proc_num)Get the owner of the specified process
Parameters DescriptionReturn value description
proc_num: process numberchar* owner
+ + +Get the CPU usage of the specified process +
submoduleProgramming languageStatementDescription
Get resource informationCextern float kdk_procname_get_process_cpu_usage_percent(char *proc_name)Get the CPU usage of the specified process
Parameter descriptionReturn value description< /td>
proc_name process namefloat CPU usage
+ +Get information about the specified process +
submoduleProgramming languageStatementDescription
Get resource informationCextern char** kdk_procname_get_process_infomation(char *proc_name)Get the information of the specified process
Parameter descriptionReturn value description< /td>
proc_name process namechar** process information list, ending with NULL, generated by alloc, needs to be reclaimed by kdk_proc_freeall; if there is an error in obtaining, return NULL;
+ + Get all information about the process +
submoduleProgramming languageStatementDescription
Get resource informationCchar** kdk_get_process_all_information()Get all process information
Parameter DescriptionReturn value description
Nonechar** process All information lists, end with NULL, are generated by alloc and need to be recycled by kdk_proc_freeall; if there is an error in obtaining, return NULL;
+ +List of recycled strings +
submoduleProgramming languageStatementDescription
Get resource informationCextern inline void kdk_proc_freeall(char **ptr)recycle string list
parameters DescriptionReturn value description
ptr: string listnone
+ + +### **3.1.5** Obtain the basic information of the operating system + + Encapsulate C interface to obtain system name, version number, activation information, etc. + +``` +$ sudo apt-get install libkysdk-sysinfo libkysdk-sysinfo-dev + +``` + + + (1)CMakeLists.txt build project + + +``` +aux_source_directory(. SOURCESCODE) + +include_directories(.) + +find_library(GLIBC_LIB glib-2.0) + +find_library(DBUS_LIB dbus-1) + +find_library(DBUS_GLIB_LIB dbus-glib-1) + +add_library(kysysinfo SHARED ${SOURCESCODE}) + +add_executable(kysysinfo-test test/kysysinfo_test.c) + +target_link_libraries(kysysinfo kylin-activation kylog systemd kyconf + +${GLIBC_LIB} ${DBUS_LIB} ${DBUS_GLIB_LIB}) + +target_link_libraries(kysysinfo-test kysysinfo) +``` + + + (2)To obtain operating system information, you need to add header files: +``` + #include "kysdk/kysdk-system/libkysysinfo.h" +``` + Get operating system architecture information + +| submodule | Programming language | statement | describe | +|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|------|------------------------------------------------------|----------------------------------------------------------------------------| +| Get basic system information | C | extern char* kdk_system_get_architecture() | Get system architecture information | +| | | Parameter Description | Return value description | | +| | | none | char* system architecture, for example: x86_64 | | + + Get OS name +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char* kdk_system_get_systemName() | Get OS name | +| | | Parameter Description | Return value description | | +| | | none | char* system name, for example: Kylin | | + + Get the operating system version number +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char* kdk_system_get_version(bool verbose) | Get the system version number | +| | | Parameter Description | Return value description | | +| | | verbose: 0 for abbreviated version number, 1 for detailed version number | char* System version number, for example: system brief version: xxxx desktop operating system; system detailed version: Desktop-V10-Professional-Release-Build1-210203 | + + Get the kernel version number +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char* kdk_system_get_kernelVersion() | Get the kernel version number | +| | | Parameter Description | Return value description | | +| | | none | char* | kernel version number | | + + Get the username of the currently logged in user +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char* kdk_system_get_eUser() | Get the username of the currently logged in user(Effect User) | +| | | Parameter Description | Return value description | | +| | | none | char* returns a string on success, and NULL on failure. The returned string needs to be freed | | + + Get operating system item number name +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char* kdk_system_get_projectName() | Get operating system item number name | +| | | Parameter Description | Return value description | | +| | | none | char* returns a string on success, and NULL on failure. The returned string needs to be freed | | + + Get OS project subnumber name +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char* kdk_system_get_projectSubName() | Get OS project subnumber name | +| | | Parameter Description | Return value description | | +| | | none | char* returns a string on success, and NULL on failure. The returned string needs to be freed | | + + Obtain the operating system product identification code +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern unsigned int kdk_system_get_productFeatures() | Obtain the operating system product identification code | +| | | Parameter Description | Return value description | | +| | | none | unsigned int return flag code
0000: abnormal information
0001: only PC features
0010: only tablet features
0011: support tablet and PC features | + + Obtain the virtual machine type of the operating system host +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char* kdk_system_get_hostVirtType() | Obtain the virtual machine type of the operating system host | +| | | Parameter Description | Return value description | | +| | | none | char* returns NULL if the acquisition fails, and returns a string if the acquisition succeeds. The content of the string is as follows:
[none, qemu, kvm, zvm, vmware,hyper-v, orcale virtualbox, xen, bochs, uml,parallels,bhyve,qnx,arcn,openvz,lxc,lxc-libvirt,systemd-nspawn,docker,podman,rkt,wsl] | + + Obtain the cloud platform type of the operating system host +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char* kdk_system_get_hostCloudPlatform() | Obtain the cloud platform type of the operating system host | +| | | Parameter Description | Return value description | | +| | | none | char* returns NULL if the acquisition fails, and returns a string if the acquisition succeeds. The content of the string is as follows:
[none, huawei] | + + Determine whether the current operating system is a dedicated machine system +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern bool kdk_system_is_zyj(void) | Determine whether the current mirroring system is a dedicated machine system | +| | | Parameter Description | Return value description | | +| | | none | bool
true means yes
false means no | + + Get system resolution information +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern char** kdk_system_get_resolving_power() | Get system resolution information | +| | | Parameter Description | Return value description | | +| | | none | char** Resolution information list, ending with NULL, generated by alloc, needs to be reclaimed by kdk_resolving_freeall; if there is an error in obtaining, return NULL; | | + + list of recycled strings +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------|----------------| +| Get basic system information | C | extern inline void kdk_resolving_freeal(char **ptr) | list of recycled strings | +| | | Parameter Description | Return value description | | +| | | ptr: list of strings | none | + + + + +### **3.1.6** Get network information + + Get network connection status + + +| submodule | Programming language | statement | describe | +|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|---------------------------------------------------------------------|------------------------------------| +| Get basic system information | dbus interface | bus: system bus | +| name : org.freedesktop.NetworkManager | +| path: org.freedesktop.NetworkManager | +| method: state()->int arg0; | Get network connection status。 | +| | +| | | Parameter Description | Return value description | | +| | | none | int network connection status | | +| | + +Get network port status + + cpanS="1 ="1" width="91">
submoduleProgramming languageStatementDescription
Get basic system informationCextern int kdk_net_get_port_stat(int port);Get port status
Parameter description< /td>Return value description
port port number int port status FREE: 0TCP_ESTABLISHED:1 TCP_SYN_SENT:2 TCP_SYN_RECV:3 TCP_FIN_WAIT1:4 TCP_FIN_WAIT2:5 TCP_TIME_WAIT:6 TCP_CLOSE:7 TCP_CLOSE_WAIT:8 TCP_LAST_ACL:9 TCP_LISTEN:10 TCP_CLOSING:11
+ + Get the status of multiple network ports +
submoduleProgramming languageStatementDescription
Get system basic informationCint kdk_net_get_multiple_port_stat(int start, int end, int *result)Get [start, end] port status
parameter descriptionreturn value description
start start port number end end port number result int with enough space array. Accept port statusSuccess returns 0 Failure returns port status
+ +get default gateway +
submoduleProgramming languageStatementDescription
Get basic system informationCextern prouteMapList kdk_net_get_route();Get Default Gateway
Parameter DescriptionReturn value description
NoneprouteMapList network management information, The specific information is fetched by yourself, and NULL is returned if it fails
+ +Get firewall status + +
submoduleProgramming languageStatementDescription
Get system basic informationCextern pChain kdk_net_get_iptable_rules()Get Firewall Information
Parameter Description Return value description
NonepChain firewall information, specific Information self-fetching, failure returns NULL
+ + + +### **3.1.7** Obtain system runtime information + + Encapsulate C++ class to obtain network speed, cpu temperature, hard disk temperature, etc. + + +``` +$ sudo apt-get install libkyrealtimeinfo libkyrealtimeinfo-dev +``` + + + (1) CMakeLists.txt build project + +``` +include_directories("smartctl/") +aux_source_directory(./smartctl CODE) +add_library(kyrealtime SHARED libkyrealtimeinfo.cpp libkyrealtimeinfo.h ${CODE}) +set_target_properties(kyrealtime PROPERTIES VERSION 1.2.0 SOVERSION 1) + +add_executable(realtimetest test/getrealtimeinfo.cpp) +target_link_libraries(realtimetest kyrealtime) +``` + +(2) To obtain the runtime information of the operating system, a header file needs to be added: + +``` +#include "kysdk/kysdk-system/libkyrealtimeinfo.h" +``` + + Get Instantaneous Internet Speed + +
submoduleProgramming languageStatementDescription
Get basic system informationC++RealTimeInfo::float kdk_real_get_net_speed();Get Instantaneous Internet Speed
Parameter Description Return value description
nonefloat Instantaneous network speed
+ + + Get cpu temperature + +
submoduleProgramming languageStatementDescription
Get basic system informationC++RealTimeInfo::float kdk_real_get_cpu_temperatu();Get instantaneous cpu temperature
Parameter description Return value description
nonefloatcpu Instantaneous temperature
+ + Get HDD temperature +
submoduleProgramming languageStatementDescription
Get basic system informationC++RealTimeInfo::float kdk_real_get_disk_temperatu(const char * name);Get the instantaneous hard disk temperature
Parameter descriptionReturn value description
name: the absolute path of the hard diskfloat specifies the instantaneous temperature of the hard disk
+ + Get disk speed +
submoduleProgramming languageStatementDescription
Get system basic informationC++RealTimeInfo::int kdk_real_get_disk_rate(const char *name);Get disk speed
Parameter descriptionReturn value description
name: the absolute path of the hard diskint specifies the disk speed
+ + + +### **3.1.8** Get current geographic information + + Encapsulates the C interface to obtain the geographic information of the current ip address. + +``` +$ sudo apt-get install libkylocation libkylocation-dev + +``` + + (1) CMakeLists.txt build project +``` +include_directories("/usr/include/python3.8") +add_library(kylocation SHARED libkylocation.c) +set_target_properties(kylocation PROPERTIES VERSION 1.2.0 SOVERSION 1) +target_link_libraries(kylocation -lpython3.8) +add_executable(locationtest test/getlocation.c) +target_link_libraries(locationtest kylocation) +``` + +(2) To obtain the geographical information of the IP address, a header file needs to be added: + +``` +#include "kysdk/kysdk-system/libkylocation.h" +``` + + Get local location + + +| submodule | Programming language | statement | describe | +|----------|------|----------------------------------|----------------| +| Get basic system information | C | extern char *kdk_loaction_get(); | Get the location of this machine | +| | | Parameter Description | Return value description | | +| | | none | Describe the json string of the geographic location | + + + +## **3.2** Power Management + + The design of this layer is mainly for the application power management interface. + +### **3.2.1** Lock Screen Settings + + Encapsulate the C++ interface to provide the ability to set the lock screen. + + Set to prohibit lock screen + + +| submodule | Programming language | statement | describe | +|---------------|-------|--------------------------------------------------------------------------------|--------| +| power management module | C++ | uint32_t kdk_set_inhibit_lockscreen(const char *appName , const char *reason) | Set to prohibit lock screen | +| | +| | | Parameter Description | Return value description | +| | | appName:Application name
reason: Reason for prohibiting lock screen | 0: Failed
>0: Successful (greater than 0) | + + + + Unban lock screen + +| submodule | Programming language | statement | describe | +|-----------------|-------|-----------------------------------------------|--------| +| power management module | C++ | int kdk_un_inhibit_lockscreen(uint32_t flag) | Unban lock screen | +| | +| | | Parameter Description |Return value description | +| | | flag:The return value of prohibiting the lock screen interface | 0: success
-1: failure | + + +## **3.3** File Management + + The module design is mainly for developers to monitor file changes in the file system and provide interface definitions; reduce + + Differences between system versions due to changes in some file systems; + + Installation method: + +``` + $ sudo apt install libkysdk-filesystem libkysdk-filesystem-dev +``` + + +| statement | describe | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------| +| QStringList addWatchTargetRecursive(QString url, FileWatcherType type = PERIODIC, int attr = OPEN`|`CLOSE`|`MODIFY`|`DELETE, int maxdepth = 5, int recurType = DIR`|`REGULAR); | Add the file path that needs to be monitored. For directories, recursive monitoring of subdirectories is enabled by default | +| QStringList addWatchTargetListRecursive(QStringList urlList, FileWatcherType type = PERIODIC, int attr = OPEN`|`CLOSE`|`MODIFY`|`DELETE, int maxdepth = 5, int recurType = DIR`|`REGULAR); | Increase the list of files that need to be monitored | +| QStringList removeWatchTargetRecursive(QString url, int maxdepth = 5, int recurType = ALLFILE); | Remove the specified file from the listen list | +| void clearWatchList(); | clear watch list | +| void pauseWatcher(); | Pause file monitoring | +| void restartWatcher(); | resume file monitoring | + + + + +## **3.4** AI Capabilities + + The design of this layer mainly provides the AI recognition function interface for the application, and adds OCR to the OS. + Text recognition function; shielding needs + + The development complexity and debugging difficulty brought by the introduction of AI functions. + +### **3.4.1** OCR text recognition function + + Encapsulate C++ interface to provide OCR text recognition function. + + Get text box + + +| submodule | Programming language | statement | | describe | +|--------------------|------|-----------------------------------------------------------------------------|------------------|----------------------------------| +| OCR text recognition function | C++ | Std::vector>> kdk::kdkOCR::getRect(const std::string &imagePath) || get text box | +| | | Parameter Description | Return value description | | +| | | String Image file path | Vector
The coordinate matrix of the text box points, and the number of text boxes | + + + + Get text content + +| submodule | Programming language | statement || describe | +|----------------|---------|-------------------------------------------------------------------|-|--------| +| OCR text recognition function | C++ | Std::vector>>getCls(const std::string &imagePath,int nums) || get text content | +| | | Parameter Description | Return value description | | +| | | String Image file path
VectorText string in the image | Int nums Number of literal stacks to process simultaneously | | + + +## **3.5** Printer Management + + This layer mainly provides a printer management interface for the application, which can realize the delivery of printing tasks, printing methods, and printing tasks. + + cancellation of service. + + Get a list of system printers + + +| submodule | Programming language | statement | describe | +|------------|----------|---------------------------------------|------------------------| +| printer management | C | extern char** kdk_printer_get_list(); | Get a list of printers | +| | | Parameter Description | Return value description | +| | | none | char ** System Printer List | + + Get a list of available printers on the system + +| submodule | Programming language | statement | describe | +|------------|----------|-------------------------------------------------|------------------------| +| printer management | C | extern char** kdk_printer_get _availablelist(); | Get a list of available printers | +| | | Parameter Description | Return value description | +| | | none | char ** System Printer List | + +Set print parameters + +| submodule | Programming language | statement | describe | +|------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------| +| printer management | C | extern void kdk_printer_set_options(int number_up,const char *media,const char *number_up_layout,const char *sides); | Set print parameters | +| | | Parameter Description | Return value description | +| | | number_up:Print several pages on one paper
media: paper type
number_up_layout: cups attribute, such as lrtb
sides: single-sided one-sided, double-sided (long side flip): two_sided_long_dege
double-sided (short flip side):
two_sided_short_dege | none | + + print documents +| submodule | Programming language | statement | describe | +|------------|----------|-----------------------------------------------------------------------------------|------------------| +| printer management | C | extern int kdk_printer_print_local_file(const char *printername, char *filepath); | print documents | +| | | Parameter Description | Return value description | +| | | printername: printer name
filepath:Print the absolute path of the file | int id of the print job | + + Cancel print job +| submodule | Programming language | statement | describe | +|-----------------|-------|-----------------------------------------------|--------| +| printer management | C | extern int kdk_printer_cancel_all_jobs(const char *printername); | cancel print job | +| | | Parameter Description | Return value description | | +| | | printername:printer name | int
Success: 0
Failed:-1 | + + Get printer status +| submodule | Programming language | statement | describe | +|------------|----------|-------------------------------------------------------------|----------------| +| printer management | C | extern int kdk_printer_get_status(const char *printername); | Get printer status | +| | | Parameter Description | Return value description | +| | | printername,printer name | printer status code | + + + Parse the downloaded filename from the url +| submodule | Programming language | statement | describe | +|------------|----------|------------------------------------------------------------------------|-----------------------| +| printer management | C | extern void kdk_printer_get_filename(const char *url, char *filename); | Parse downloaded filename from url | +| | | Parameter Description | Return value description | +| | | url,download link | | +| | | filename,parsed filename | | + + + Get current print job status + +| submodule | Programming language | statement | describe | +|------------|----------|----------------------------------------------------------------------------|----------------------| +| printer management | C | extern int kdk_printer_get_job_status(const char *printername, int jobid); | Get current print job status | +| | | Parameter Description | Return value description | +| | | printername,printer name | print task status code | + + + Download network files to local +| submodule | Programming language | statement | describe | +|------------|----------|-------------------------------------------------------------------------------------------|--------------------| +| printer management | C | extern int kdk_printer_print_download_remote_file(const char *url, const char *filepath); | Download network files to local | +| | | Parameter Description | Return value description | +| | | url,network file | download status code | +| | | filepath,The file path to save, user-defined | | + + + + +# **4** Application support SDK + + + In the openSDK application support layer, all packages provide graphical development functions for graphical applications, such as graphical controls, theme styles, etc.; this layer is usually bound to a specific development framework, such as QT, GTK; When installing the application support layer SDK, two virtual packages need to be installed: libkysdk-application, libkysdk-applications-dev, and other packages generate multiple real packages according to functional classification, such as: QT control class: libkysdk-qtwidgets, wayland display protocol compatible interface libkysdk -waylandhelper, apply common module libkysdk-kabase etc. + + Install command: + + +``` +$ sudo apt install libkysdk-applications libkysdk-applications-dev + +``` + +## **4.1** QT self-developed control module + + The QT self-developed control module kysdk-qtwidgets is a submodule of kysdk-application, and the installation method is as follows: + + +``` +sudo apt install libkysdk-qtwidgets libkysdk-qtwidgets-dev +``` + + + According to different project types, you can refer to the following demos: + + (1) .pro file build project + + Added to the qt project .pro file: + +``` +CONFIG += link_pkgconfig +PKGCONFIG += kysdk-qtwidgets + +``` + + (2) CMakeLists.txt build project + + +``` +cmake_minimum_required(VERSION 3.5) +find_package(Qt5 COMPONENTS Widgets REQUIRED) +find_package(PkgConfig REQUIRED) +pkg_check_modules(KYSDKQTWIDGETS_PKG kysdk-qtwidgets) +target_include_directories(demo PRIVATE ${KYSDKQTWIDGETS_PKG_INCLUDE_DIRS}) +target_link_directories(demo PRIVATE ${KYSDKQTWIDGETS_PKG_LIBRARY_DIRS}) +target_link_libraries(demo Qt5::Widgets ${KYSDKQTWIDGETS_PKG_LIBRARIES}) +``` + + + In a specific project, you need to introduce the corresponding header file and namespace in the code, such as: + + +``` +#include "kwidget.h" +using namespace kdk; +``` + + +Some controls use translation files, you can load translation files in the main() function, currently supported + + Chinese, Tibetan, and English, the translation files have been compiled into the dynamic library, and the loading method is as follows: + + +``` +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + QTranslator trans; + QString locale = QLocale::system().name(); + if(locale == "zh_CN") + { + if(trans.load(":/translations/gui_zh_CN.qm")) + { + a.installTranslator(&trans); + } + } + if(locale == "bo_CN") + { + if(trans.load(":/translations/gui_bo_CN.qm")) + { + a.installTranslator(&trans); + } + } + Widget w; + w.show(); + return a.exec(); +} +``` + + + +### **4.1.1** Form Module +#### **4.1.1.1** Basic form + + + Function description: KWidget, inherited from QWidget, supports responsive theme background switching, responsive icon main + +Title switching, the title color responds to the window activation status, and the window button style conforms to the design style of ukui3.1. + + Divided into four components iconBar, windowButtonBar, sideBar, baseBar. + + iconBar, windowButtonBar default height is 40px, sideBar default width is 200px. + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image4.png) +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image5.png) + + +| enumerated type | LayoutType { VerticalType, HorizontalType, MixedType } | +|------|--------------------------------------------------------| + + +> VerticalType:upper and lower structure +> +> HorizontalType:left and right structure +> +> MixedType:transitional structure + + +| statement | describe | | | +|------------------------------------------------|--------------------------------------------------|---|---| +| QWidget* sideBar(); | Get the left column widget, and add custom content through setlayout. | | | +| QWidget* baseBar(); | Get the widget in the main content area, and add custom content through setlayout. | | | +| void setIcon(const QIcon& icon); | Add form icon via icon | | | +| void setIcon(const QString& iconName); | Set the window icon, iconName needs to directly specify the icon name in the system directory, such as "kylin-music". | | | +| void setWidgetName(const QString& widgetName); | Set the form name. | | | +| KWindowButtonBar* windowButtonBar(); | Gets the window triplet control to control whether to display the maximize, minimize, and drop-down menu buttons. | | | +| KIconBar* iconBar(); | Get window title, icon combination controls to control related styles. | | | +| void setLayoutType(LayoutType type); | Sets the layout structure type. | | | + + + +#### **4.1.1.2** KBubbleWidget +> +> Function description: KBubbleWidget, inherited from QWidget, is a window with a bubble tail + +Body, you can specify the size, display direction and display position of the bubble tail, and you can also set the circle of the form + +> Corners, frosted glass and transparency. Enabled since version 2.0.0.0. + +
enumeration typeenum TailDirection{ TopDirection, LeftDirection, BottomDirection, RightDirection, None };
enum TailLocation{ LeftLocation, MiddleLocation, RightLocation };
+ + +> TailDirection: The display direction of the tail of the bubble +> +> TailLocation: Specify the display position of the tail of the bubble + + +| statement | describe | +|-----------------------------------------------------------------------------------|----------------------| +| void setTailSize(const QSize& size); | Sets the bubble tail size | +| QSize tailSize(); | Get the bubble tail size | +| void setTailPosition(TailDirection dirType, TailLocation locType=MiddleLocation); | Set the display position of the bubble tail | +| TailDirection tailDirection(); | Get the display direction of the bubble tail (left, up, right, down) | +| TailLocation tailLocation(); | Get the display position of the bubble tail (left, center, right) | +| void setBorderRadius(int bottomLeft,int topLeft,int topRight,int bottomRight); | Set the form corner radius | +| void setBorderRadius(int radius); | Set the form corner radius | +| void setEnableBlur(bool flag); | Set whether to enable the frosted glass effect | +| bool enableBlur(); | Get whether the frosted glass effect is enabled | +| void setOpacity(qreal opacity); | set transparency | +| qreal opacity(); | get transparency | + + +### **4.1.2** Dialog Module + +#### **4.1.2.1** Basic Dialog + +> Function description: KDialog, inherited from QDialog, supports switching of responsive theme and background, corresponding icon main + +Title switching, the window button style conforms to the design style of ukui3.1, and the title color responds to the activation state of the window. + + +| statement | describe | +|----------------------------------------------|-----------------------------------------------------------------------| +| void setWindowIcon(const QIcon &icon); | Settings dialog icon | +| void setWindowIcon(const QString& iconName); | Set the window icon directly according to the icon name, for example:dialog->setWindowIcon("kylin-music"); | +| void setWindowTitle(const QString &); | Set the dialog title name | +| QPushButton* maximumButton(); | Get the maximize button | +| QPushButton* minimumButton(); | Get the minimize button | +| QPushButton* closeButton(); | get the close button | +| KMenuButton* menuButton(); | Get the drop-down menu button, which is hidden by default and not displayed。 | +| QWidget* mainWidget(); | Get the main content area and add content through setLayout(). For example:dialog->mainWidget()->setLayout(hLayout); | + + + +#### **4.1.2.2** About Dialog +> +> Function description: KAboutDialog, the main contents include: application icon, application name, version + +ID, team mailbox and specific application description, note that the default application description is not displayed. can pass + +> Control whether it needs to be displayed through setBodyTextVisible(bool). +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image6.png) +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image7.png) +| statement | describe | +|------------------------------------------------|---------------------------| +| void setAppIcon(const QIcon& icon); | set application icon | +| void setAppName(const QString& appName); | set application name | +| QString appName(); | get application name | +| void setAppVersion(const QString& appVersion); | Set the application version number | +| QString appVersion(); | Get application version number | +| void setBodyText(const QString& bodyText); | Set application-specific description content | +| QString bodyText(); | Get application-specific description content | +| void setAppSupport(const QString& appSupport); | Set service and support mailboxes, with default defaults | +| QString appSupport(); | Get Service and Support Email | +| void setBodyTextVisiable(bool flag); | Set whether to display the description content | +| void setAppPrivacyLabelVisible(bool flag); | Set whether the privacy button is visible (enabled since version 1.2.0.10) | +| bool AppPrivacyLabelIsVisible(); | Returns whether the privacy button is visible (enabled since version 1.2.0.10) | + + + +#### **4.1.2.3** Input Dialog +> +> Function description: input dialog KInputDialog, inherited from QDialog, refer to QInputDialog +> +> Source code, adjusted the layout and style of sub-controls, the function is the same as QInputDialog. +> +> (1)QString KInputDialog::getText(QWidget \*parent, const QString +> &label, +> +> QLineEdit::EchoMode mode, const QString &text, bool \*ok, +> +> Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints) +> +> Text input dialog, same as QInputDialog + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image8.png) + +> (2)QString KInputDialog::getMultiLineText(QWidget \*parent,const +> QString&label, +> +> const QString &text, bool \*ok, Qt::WindowFlags flags, +> +> Qt::InputMethodHints inputMethodHints) +> +> Multi-line text input box, same as QInputDialog + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image9.png) + +> (3) +``` +int KInputDialog::getInt(QWidget *parent,const QString &label, int value, +int min, int max, int step, bool *ok, Qt::WindowFlags flags) +``` +> Integer number input dialog, same as QInputDialog +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image10.png) +> +> (3) + +``` +double KInputDialog::getDouble(QWidget *parent,const QString &label, +double value, double minValue, double maxValue, +int decimals, bool *ok, Qt::WindowFlags flags) +``` + +> Floating-point number input dialog, same as QInputDialog +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image11.png) +> +> enumerated type + +| enum | InputDialogOption { NoButtons, UseListViewForComboBoxItems, UsePlainTextEditForTextInput } | +|-------|--------------------------------------------------------------------------------------------| +| flags | InputDialogOptions | +| enum | InputMode { TextInput, IntInput, DoubleInput } | + + + +| constant | describe | +|--------------------------------------------|------------------------------------------------------------| +| QInputDialog::NoButtons | Don't show OK and Cancel buttons | +| QInputDialog::UseListViewForComboBoxItems | Use QListView instead of non-editable QComboxItems to display items set with SetComboxItems(). | +| QInputDialog::UsePlainTextEditForTextInput | Use QPlainTextEdit for multi-line text input. In this value was introduced in 5.2. | + + + +| constant | describe | +|---------------------------|---------------| +| QInputDialog::TextInput | Used to enter text strings. | +| QInputDialog::IntInput | Used to enter integers. | +| QInputDialog::DoubleInput | For floating-point numbers entered in double precision. | + + + +| statement | describe | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------| +| void setInputMode(InputMode mode); | set input mode | +| InputMode inputMode() const; | get input mode | +| void setLabelText(const QString &text); | set label text | +| QString labelText() const; | get label text | +| void setOption(InputDialogOption option, bool on = true); | Setting Options | +| bool testOption(InputDialogOption option) const; | test options | +| void setOptions(InputDialogOptions options); | Setting Options | +| InputDialogOptions options() const; | Get input box options | +| void setTextValue(const QString &text); | set text value | +| QString textValue() const; | get text value | +| void setTextEchoMode(QLineEdit::EchoMode mode); | set text mode | +| QLineEdit::EchoMode textEchoMode() const; | get text mode | +| void setComboBoxEditable(bool editable); | Set the combo box to be editable | +| bool isComboBoxEditable() const; | Return whether the combo box can be edited | +| void setComboBoxItems(const QStringList &items); | Set combo box item | +| QStringList comboBoxItems() const; | Return combo box list | +| void setIntValue(int value); | Set the value of type int | +| int intValue() const; | Get the value of type int | +| void setIntMinimum(int min); | Set the lowest value of type int | +| int intMinimum() const; | Get the lowest value of int | +| void setIntMaximum(int max); | Set the maximum value of int type | +| int intMaximum() const; | Get the maximum value of int | +| void setIntRange(int min, int max); | set int range | +| void setIntStep(int step); | set int steps | +| int intStep() const; | Get int steps | +| void setDoubleValue(double value); | set double value | +| double doubleValue() const; | get double value | +| void setDoubleMinimum(double min); | Set the double minimum value | +| double doubleMinimum() const; | Get the minimum value of double | +| void setDoubleMaximum(double max); | Set the maximum value of double | +| double doubleMaximum() const; | Get the maximum value of double | +| void setDoubleRange(double min, double max); | set double range | +| void setDoubleDecimals(int decimals); | set two decimals | +| int doubleDecimals() const; | returns the number of decimal places | +| void setOkButtonText(const QString &text); | Set confirm button text | +| QString okButtonText() const; | Get the confirm button text | +| void setCancelButtonText(const QString &text); | Set cancel button text | +| QString cancelButtonText() const; | get cancel button text | +| void open(QObject *receiver, const char *member); | This function connects one of its signals to the receiver and the slot specified by the member. The specific signal depends on the parameters specified in the member. | +| void setVisible(bool visible) override; | Whether the setting is visible | +| QSize minimumSizeHint() const override; | Min Size Tips | +| QSize sizeHint() const override; | size tips | +| static QString getText(QWidget *parent,const QString &label,QLineEdit::EchoMode echo = QLineEdit::Normal,const QString &text = String(), bool *ok = nullptr,Qt::WindowFlags flags = Qt::WindowFlags(),Qt::InputMethodHints inputMethodHints = Qt::ImhNone); | get text | +| static QString getMultiLineText(QWidget *parent,const QString &label,const QString &text = QString(), bool *ok = nullptr,Qt::WindowFlags flags = Qt::WindowFlags(),Qt::InputMethodHints inputMethodHints = Qt::ImhNone); | get multiline text | +| static QString getItem(QWidget *parent,const QString &label,const QStringList &items, int current = 0, bool editable = true,bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags(),Qt::InputMethodHints inputMethodHints = Qt::ImhNone); | get item | +| static int getInt(QWidget *parent,const QString &label, int value = 0,int minValue = -2147483647, int maxValue = 2147483647,int step = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()) | get int type text | +| static double getDouble(QWidget *parent,const QString &label,double value = 0, double minValue = -2147483647,double maxValue = 2147483647, int decimals = 1, bool *ok = nullptr,Qt::WindowFlags flags = Qt::WindowFlags()); | Get double type text | +| void setDoubleStep(double step); | Set the number of double steps | +| double doubleStep() const; | Get the number of double steps | +| void setPlaceholderText(const QString &); | Set the text content of PlaceholderText (enabled since 1.2.0.12) | +| QString placeholderText() const; | Get the text content of PlaceholderText (enabled since 1.2.0.12) | + + + +#### **4.1.2.4** Progress dialog +> +> Function description: KProgressDialog, inherited from QDialog, refer to QProgressDialog source code, +The style of the child control ProgressBar has been adjusted. You can set whether specific download information needs to be displayed, set the suffix of the progress value, etc. + + +``` +KProgressDialog *progress2 = new KProgressDialog(tr("Download"),tr("Cancel"),0,100,this); +progress2->setSubContent("Downloading..."); +progress2->setSuffix("MB"); +progress2->setWindowTitle("Progress Dialog"); +progress2->setWindowIcon("kylin-music"); +progress2->setValue(50); +progress2->setShowDetail(false); +``` + + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image12.png) +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image13.png) + + + + +| statement | describe | +|-----------------------------------------------|---------------------------------------------------------------------------------------------------------| +| void setLabel(QLabel *label); | Set the label to label. The progress dialog resizes to fit. The label becomes the ownership of the progress dialog and will be deleted if necessary, so don't pass the address of the object on the stack. | +| void setCancelButton(QPushButton *button); | Set the cancel button to the button, cancelButton. The progress dialog takes ownership of the button, and the button will be deleted if necessary, so instead of passing the address of an object on the stack, use new() to create the button. If nullptr is passed, the cancel button will not be displayed. | +| void setBar(QProgressBar *bar); | Set the progress bar widget to bar. The progress dialog resizes to fit. The progress bar dialog takes ownership of the progress bar, which will be deleted if necessary, so don't use a progress bar allocated on the stack. | +| void setSuffix(const QString& suffix); | Set the suffix of detail | +| void setShowDetail(bool flag); | Set whether to display detailed information | +| int minimum() const; | return minimum | +| int maximum() const; | return the maximum value | +| int value() const | return the current value | +| QString labelText() const; | Return to prompt content | +| void setAutoReset(bool reset); | Sets whether the progress dialog calls reset() immediately when value() equals maximum(), defaults to true. | +| bool autoReset() const; | Returns whether to reset automatically | +| void setAutoClose(bool close); | Set whether to automatically close the dialog box | +| bool autoClose() const; | Returns whether to automatically close the dialog | +| QProgressBar* progressBar(); | get progress bar | +| void cancel(); | Cancel the progress bar. | +| void reset(); | Reset the progress bar. | +| void setMaximum(int maximum) | Set the highest value represented by the progress bar, the default value is 100. | +| void setMinimum(int minimum) | Set the minimum value represented by the progress bar, the default value is 0. | +| void setRange(int minimum, int maximum) | Set the range of the progress bar. If the maximum value is smaller than the minimum value, the minimum value becomes the only legal value. If the current value is outside the new range, reset the progress box with reset(). | +| void setValue(int progress) | Set the current progress value. | +| void setLabelText(const QString &text) | Set the hint label text. | +| void setCancelButtonText(const QString &text) | Set the cancel button text. | +| void setSubContent(const QString &text) | Set secondary content. | + + + + + +#### **4.1.2.5** Program uninstall dialog +> +> Function description: KUninstallDialog, the code is integrated from the Kylin installer, and supports displaying application diagrams + +Logo, application name, package name, version number and other information, excluding the specific uninstallation behavior. Just pass the + +> Enter the package name and the last two parameters of the version. + + +``` +KUninstallDialog *uninstallDialog = new KUninstallDialog("browser360-cn-stable","104",this); +``` + + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image14.png) + + +| statement | describe | +|----------------------------------|------------------| +| QLabel* debAppNameLabel(); | Get the label of the application name | +| QLabel* debNameLabel(); | Get the label of the package name | +| QLabel* debIconLabel(); | Get the label of the application icon | +| QLabel* debVersionLabel(); | Get the label of the package version | +| QPushButton* uninstallButtton(); | Get the uninstall button pushbutton | + + + + +### **4.1.3** Input box module + +#### **4.1.3.1** Password input box + + +> Function description: KPasswordEdit, supports switching between plain text/dark text of the input content, supports settings + +Password verification result (blue border for normal input, green border for correct password, and green border for wrong password + +> red border), supports loading status, and supports setting whether to enable clearButton. +> +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image15.png) +> +> enumerated type + + +| | | +|-------|-----------------------------------------------| +| enum  | LoginState{Ordinary,LoginSuccess,LoginFailed} | + +| statement | describe | +|------------------------------------------|------------------------| +| void setState(LoginState state); | set login status | +| LoginState state(); | Return to login status | +| void setLoading(bool flag); | Set whether to enable the loading state. | +| bool isLoading(); | Determine whether it is in the loading state | +| QString placeholderText(); | Return the text content of placeholderText | +| void setPlaceholderText(QString&text); | Set the text content of PlaceholderText | +| void setClearButtonEnabled(bool enable); | Set whether to enable ClearButton | +| bool isClearButtonEnabled() const; | Returns whether ClearButton is enabled | +| void setEchoModeBtnVisible(bool enable); | Set whether EchoModeBtn is visible | +| bool echoModeBtnVisible(); | Return whether EchoModeBtn is visible | +| void setClearBtnVisible(bool enable); | Set whether ClearBtn is visible | +| bool clearBtnVisible(); | Return whether ClearBtn is visible | +| void setEnabled(bool); | Set whether KLineEdit is available | + + +#### **4.1.3.2** Search input box +> +> Function description: You can set the text content and alignment of placeHolder, and the alignment of input text +> +> mode, whether to enable the clear button, etc. +> + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image16.png) + + + +| statement | describe | +|---------------------------------------------------|---------------------------| +| void setEnabled(bool); | Is the setting available | +| bool isEnabled(); | return is available | +| void setClearButtonEnabled(bool enable); | Set whether to display the clear button | +| bool isClearButtonEnabled() const; | Returns whether to display the clear button | +| QStringplaceholderText() const; | return placeholder | +| void setPlaceholderText(const QString &); | Set the text of the placeholder | +| Qt::Alignment placeholderAlignment() const; | Returns the alignment of the placeholder | +| void setPlaceholderAlignment(Qt::Alignment flag); | Set the alignment of the placeholder | +| Qt::Alignment alignment() const; | Returns the alignment of the input text | +| void setAlignment(Qt::Alignment flag); | Sets the alignment of the input text. | +| void clear(); | Clear the contents of the search box. | +| void setTranslucent(bool flag); | Set whether to enable translucent effect (enabled since 1.2.0.10) | +| bool isTranslucent(); | Get whether translucency is enabled (enabled since 1.2.0.10) | + + + +### **4.1.4** Button module + +#### **4.1.4.1** Bordered buttons + +> Function description: KBoderButton, inherited from QPushButton, is encapsulated in style. able to pass +> +> setPalette() to further adjust the style. +> +> Such as: + + +``` +QPalette palette = m_pBtn1->palette(); +palette.setColor(QPalette::ButtonText,QColor(255,0,0)); +m_pBtn1->setPalette(palette); +``` + +> All interfaces in QPushButton are applicable and support four construction methods. + + +| statement | describe | +|-----------------------------------------------------------------------------------|-------------------| +| KBorderButton(QWidget* parent = nullptr); | only one button | +| KBorderButton(const QString &text, QWidget *parent = nullptr); | Construct a button with text | +| KBorderButton(const QIcon &icon, const QString &text, QWidget *parent = nullptr); | Constructs a button with text and icon | +| KBorderButton(const QIcon &icon, QWidget *parent = nullptr); | Construct a button with an icon | +| void setIcon(const QIcon &icon); | Settings button icon | + + +#### **4.1.4.2** Borderless buttons +> +> Function description: KboderlessButton, inherited from QPushButton, is encapsulated in style. same +> +> You can further adjust the style through setPalette(). + +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image17.png) + +> All interfaces in QPushButton are applicable and support four construction methods. + + +| statement | describe | +|---------------------------------------------------------------------------------------|-------------------| +| KBorderlessButton(QWidget* parent = nullptr); | only one button | +| KBorderlessButton(const QString &text, QWidget *parent = nullptr); | Construct a button with text | +| KBorderlessButton(const QIcon &icon, const QString &text, QWidget *parent = nullptr); | Constructs a button with text and icon | +| KBorderlessButton(const QIcon &icon, QWidget *parent = nullptr); | Construct a button with an icon | +| void setIcon(const QIcon &icon) | Set borderless button icons. | + + + +#### **4.1.4.3** Drop-down menu button +> +> Function description: KMenuButton, inherited from QPushButon, the default ICon is "open-menu-symbolic", the first-level menu contains 5 options, namely: "Settings", "Theme", "Help", "About", " Exit", the theme includes 3 secondary options, namely: "Follow Theme", "Light Theme", and "Dark Theme". + +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image18.png) + +> Each interface of QPushButton applies. + + +| statement | describe | +|---------------------------|--------------| +| QMenu* menu(); | get main menu | +| QMenu* themeMenu(); | Get theme menu | +| QAction* settingAction(); | Get settings action | +| QAction* themeAction(); | Get theme Action | +| QAction* assistAction(); | Get HelpAction | +| QAction* aboutAction() | Get About Action | +| QAction* quitAction(); | Get leave Action | +| QAction* autoAction(); | Get the following topic Action | +| QAction* lightAction(); | Get light theme Action | +| QAction* darkAction(); | Get dark theme Action | + + +#### **4.1.4.4** switch button +> +> Function description: KSwitchButton, inherited from QPushButton, redraws the button to indicate the on/off state. +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image19.png) + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image20.png) + + +| statement | describe | +|---------------------------------|--------------------------| +| void setCheckable(bool); | Whether the setting is optional | +| bool isCheckable() const; | Returns whether it is selectable | +| bool isChecked() const; | Return whether selected | +| void setChecked(bool); | Is the setting selected | +| void setTranslucent(bool flag); | Set whether to enable translucent effect (enabled since 1.2.0.10) | +| bool isTranslucent() | Get whether translucency is enabled (enabled since 1.2.0.10) | + + + +#### **4.1.4.5** Tool Buttons +> +> Function description: KToolButton, inherited from QToolButton, supports three styles, supports loading status, and supports whether to display the drop-down button. +> +![Enter image description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image21.png) +> +> enumerated type + +| | | +|-------|-------------------------------------------| +| enum  | KToolButtonType{Flat,SemiFlat,Background} | + + +| statement | describe | +|---------------------------------------|---------------------------------| +| KToolButtonType type(); | return type | +| void setType(KToolButtonType type); | setting type | +| void setIcon(const QIcon& icon); | Set Icon | +| void setLoading(bool flag); | Set the loading state, which is only supported by toolbuttuons without arrows | +| bool isLoading(); | Returns whether it is loading | +| QIcon icon(); | getIcon | +| void setArrow(bool flag); | Set whether to display the down arrow, the default is not displayed | +| bool hasArrow() const; | Returns whether to display the arrow | +| void setPixmapSize(const QSize&size); | Set pixmap size | +| QSize pixmapSize() const; | Get pixmap size | + + +#### **4.1.4.6** KPushButton +> +> Function description: KPushButton, inherited from QPushButton, provides a translucent effect on the basis of QPushButton. You can set the button rounded corners, background color, whether the icon follows the system highlight, and you can also set the button type, which is divided into normal type and round shape (the size needs to be set to achieve a perfect circle). Enabled since version 1.2.0.10. + +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image22.png) + +> enumerated type + + +| | | +|-------|----------------------------------------| +| enum  | ButtonType { NormalType, CircleType }; | + +| statement | describe | +|--------------------------------------------------------------------------------|-------------------------------------| +| void setBorderRadius(int radius); | Set button rounded corners by corner radius (same for each corner) | +| void setBorderRadius(int bottomLeft,int topLeft,int topRight,int bottomRight); | Set rounded corners by four points | +| int borderRadius(); | Get button rounded corners | +| void setBackgroundColor(QColor color); | Set button background color | +| QColor backgroundColor(); | Get button background color | +| void setButtonType(ButtonType type); | Set the type of KPushButton | +| ButtonType buttonType(); | Get the type of KPushButton | +| void setTranslucent(bool flag); | Set whether the KPushButton is translucent | +| bool isTranslucent(); | Determine whether KPushButton is translucent | +| void setIconHighlight(bool flag); | Set whether the icon follows the system highlight color or not by default | +| bool isIconHighlight(); | Determine whether the icon follows the system highlight color | +| void setIconColor(QColor color); | Set the color of the button add icon (enabled since 1.2.0.13) | +| QColor IconColor(); | Get the color of the button add icon (enabled since 1.2.0.13) | +| void setBackgroundColorHighlight(bool flag); | Set whether the background color of the button follows the system highlight color or not by default (enabled since 1.2.0.13) | +| bool isBackgroundColorHighlight(); | Determine whether the background color of the button follows the system highlight color (enabled since 1.2.0.13) | + + +#### **4.1.4.7** KPressButton +> +> Function description: KPressButton, inherited from QPushButton, provides translucent effect on the basis of QPushButton, can set rounded corners, whether it is selectable, whether it is selected, and can also set the type of button and whether to enable the loading state. Enabled since version 1.2.0.10. +> +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image23.png) +> +> enumerated type + + +| | | +|-------|----------------------------------------| +| enum  | ButtonType { NormalType, CircleType }; | + +| statement | describe | +|--------------------------------------------------------------------------------|----------------------| +| void setBorderRadius(int radius); | Set button rounded corners by corner radius (same for each corner) | +| void setBorderRadius(int bottomLeft,int topLeft,int topRight,int bottomRight); | Set rounded corners by four points | +| void setCheckable(bool); | Whether the setting is optional | +| bool isCheckable() const; | Returns whether it is selectable | +| void setChecked(bool); | Is the setting selected | +| bool isChecked() const; | Return whether selected | +| void setButtonType(ButtonType type); | Set the button type | +| ButtonType buttonType(); | Get the type of KPushButton | +| void setTranslucent(bool flag); | Set whether the KPushButton is translucent | +| bool isTranslucent(); | Determine whether KPushButton is translucent | +| void setLoaingStatus(bool flag); | Set whether to enable the loading state | +| bool isLoading(); | Return whether loading status is enabled | + + + + +### **4.1.5** Bar module +#### **4.1.5.1** KIconBar + +> Function description: A component of KWidget and KDialog, used to display icons and window names. +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image24.png) + + + +| statement | describe | +|-----------------------------------------------|-----------| +| void setIcon(const QString& iconName); | set icon name | +| void setIcon(const QIcon& icon); | settings icon | +| void setWidgetName(const QString& widgetName) | set title | +| QLabel* nameLabel(); | Get title label | +| QLabel* iconLabel(); | Get icon label | + + + +#### **4.1.5.2** KWindowButtonBar +> +> Function description: A component of KWidget and KDialog, used for drop-down menu, minimize, maximize, and close buttons. +> +> enumerated type + + +| | | +|-------|-------------------------------------| +| enum  | MaximumButtonState{Maximum,Restore} | + + + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image25.png) + + +| statement | describe | +|-------------------------------------------------------|---------------------| +| QPushButton* minimumButton(); | Get the minimize button | +| QPushButton* maximumButton(); | Get the maximize button | +| QPushButton* closeButton(); | get the close button | +| KMenuButton* menuButton(); | get menu button | +| MaximumButtonState maximumButtonState(); | Get the maximize the state of the button (maximize/restore) | +| void setMaximumButtonState(MaximumButtonState state); | Set maximize button icon state (maximize/restore) | + + + +#### **4.1.5.3** Progress bar +> +> Function description: KProgressBar, inherited from QProgressBar, supports three states: normal, completed and failed, supports whether to display the progress value, supports horizontal and vertical. +> +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image26.png) +> +> enumerated type + + +| | | +|-------|-----------------------------------------------------------------| +| enum  | ProgressBarState{NormalProgress,FailedProgress,SuccessProgress} | + +| statement | describe | +|----------------------------------------|------| +| ProgressBarState state(); | get status | +| void setState(ProgressBarState state); | set state | +| QString text() const override; | get text | +| void setOrientation(Qt::Orientation); | set direction | + + +#### **4.1.5.4** KProgressCircle +> +> The circular progress bar supports three states: normal, completed and failed, and supports whether to display the progress value. + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image27.png) + + +| statement | describe | +|---------------------------------------|-----------------| +| int minimum() const | Get the minimum value of the circular progress bar. | +| int maximum() const | Get the maximum value of the circular progress bar. | +| int value() const | Get the value of the circular progress bar. | +| QString text() const | Get the text of the circular progress bar. | +| void setTextVisible(bool visible) | Sets whether the text of the circular progress bar is visible. | +| bool isTextVisible() const | Returns whether the text of the circular progress bar is visible. | +| ProgressBarState state() | Get the status of the circular progress bar. | +| void setState(ProgressBarState state) | Set the state of the circular progress bar. | + + + +#### **4.1.5.5** KTabBar +> +> Function description: Inherited from QTabBar +> +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image28.png) +> +> enumerated type + +| | | +|-------|------------------------------------------------| +| enum  | KTabBarStyle{SegmentDark,SegmentLight,Sliding} | + +| statement | describe | +|----------------------------------------------|---------------------------------------| +| void setTabBarStyle(KTabBarStyle barStyle); | Set the TabBar style | +| KTabBarStyle barStyle(); | Return TabBar style | +| void setBorderRadius(int radius); | Set the corner radius, only valid for SegmentDark and SegmentLight styles | +| int borderRadius(); | Get the corner radius | +| void setBackgroundColor(const QColor &color) | Set KTabBar background color. | + + +#### **4.1.5.6** Navigation Bar +> +> Functional description: KNavigationBar supports displaying three styles of items, the item with icon indicates the first-level navigation item, the item without icon indicates the second-level navigation item, and the item in gray font indicating the group. + +| statement | describe | +|--------------------------------------------------------------------|----------------------| +| void addItem(QStandardItem*item); | Add regular Item | +| void addSubItem(QStandardItem*subItem); | Add secondary Item | +| void addGroupItems(QListitems,const QString& tag); | Add Items in groups, and tags will be displayed in the navigation bar | +| void addTag(const QString& tag); | add tag | +| QStandardItemModel* model(); | get model | +| QListView* listview(); | get listview | + + +#### **4.1.5.7** KPixmapContainer +> +> Function description: It is used to indicate the message prompt information on the upper right of the avatar. You can set the value, font size, background color, and picture size of the prompt information. +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image29.png) + + +| statement | describe | +|----------------------------------------|----------| +| int value() const; | get value | +| void setValue(int value); | Settings | +| void setValueVisiable(bool flag); | Whether the setting value is visible | +| bool isValueVisiable() const; | Gets whether the value is visible | +| void setPixmap(const QPixmap& pixmap); | set pixmap | +| QPixmap pixmap()const; | get pixmap | +| void clearValue(); | clear value | +| QColor color(); | return background color | +| void setColor(const QColor& color); | set background color | +| int fontSize(); | return font size | +| void setFontSize(int size); | set font size | + + +### **4.1.6** Slider module +#### **4.1.6.1** Slider + +> Function description: +> +> Non-step relationship: the number of steps is 1, you can click and drag anywhere; +> +> Step relationship: the number of steps is a fixed value, which can be clicked and dragged according to the step value; +> +> Node relationship: the number of steps is the node interval, which can be clicked and dragged according to the node interval +> +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image30.png) +> +> enumerated type + + +| | | +|-------|--------------------------------------------------------------------| +| enum  | KSliderType{SmoothSlider,StepSlider,NodeSlider,SingleSelectSlider} | + +| statement | describe | +|---------------------------------------|--------------------------| +| void setTickInterval(int interval); | set node interval | +| void setSliderType(KSliderType type); | Set the slider type | +| KSliderType sliderType(); | Get the slider type | +| int | tickInterval() const; | Get node interval | +| void setValue(int); | Settings | +| void setNodeVisible(bool flag); | Set whether to display nodes | +| bool nodeVisible(); | Get whether to display the node | +| void setToolTip(const QString&); | Set tooltip (enabled since 1.2.0.7) | +| QString | toolTip() const; | Get toolTip (enabled since 1.2.0.7) | +| void setTranslucent(bool flag); | Set whether to enable translucent effect (enabled since 1.2.0.10) | +| bool isTranslucent(); | Get whether translucency is enabled (enabled since 1.2.0.10) | + + + +### **4.1.7** Message prompt module +#### **4.1.7.1** KBadge + +> Function description: message reminder bubble. You can set the prompt information value, font size, background color. +> +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image31.png) + + +| statement | describe | +|-------------------------------------|-----------------------------| +| int value(); | return value | +| void setValue(int value); | Setting value, the maximum display value is 999, if it is greater than 999, it will be displayed"..." | +| void setValueVisiable(bool flag); | Whether the setting value is visible | +| bool isValueVisiable() const; | Gets whether the value is visible | +| QColor color(); | get background color | +| void setColor(const QColor& color); | set background color | +| int fontSize(); | get font size | +| void setFontSize(int size); | set font size | + + + +#### **4.1.7.2** KBallonTip +> +> Function description: message prompt box, supports four background colors and corresponding prompt icons. + +![Enter picture description](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image32.png) + +> enumerated type + + +| | | +|-------|--------------------------------------------| +| enum  | TipType{Nothing,Normal,Info,Warning,Error} | + +| statement | describe | +|-------------------------------------------------------------------|---------------------| +| void showInfo(); | Bubbles disappear automatically after a certain period of time after displaying | +| void setTipType(const TipType& type); | setting type | +| TipType tipType(); | return type | +| void setText(const QString& text); | set text content | +| QString text(); | return text content | +| void setContentsMargins(int left, int top, int right, int bottom) | Set the content margin by up, down, left, and right values. | +| void setContentsMargins(const QMargins &margins); | Set the content margins through the QMargins object. | +| void setTipTime(int my_time); | set duration | + + + +#### **4.1.7.3** KSecurityLevelBar +> +> Function description: password strength prompt bar, used to indicate the password strength level. It is divided into three levels: low, medium and high, and the specific division strategy of the level is specified by the application program. + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image33.png) + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image34.png) + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image35.png) + +> enumerated type + +| | | +|-------|--------------------------------| +| enum  | SecurityLevel{Low,Medium,High} | + +| statement | describe | +|---------------------------------------------|--------| +| void setSecurityLevel(SecurityLevel level); | set security level | +| SecurityLevel securityLevel(); | get security level | + + +### **4.1.8** Breadcrumbs KBreadCrumb +> +> Borderless tab bar, you can add text and icons, support click and hover highlight. +> +> Function diagram: + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image36.png) + +> enumerated type + + +| | | +|-------|----------------------------------------------------| +| enum  | KBreadCrumbType { FlatBreadCrumb, CubeBreadCrumb } | + +| statement | describe | +|----------------------------------|-------------------------| +| void setIcon(const QIcon &icon); | settings icon | +| QIcon icon() const; | back icon | +| bool isFlat() const; | Returns whether KBreadCrumb is of flat type. | +| void setFlat(bool flat); | Set whether KBreadCrumb is flat type. | + + + +### **4.1.9** KCommentPanel + + +| | | +|-------|-------------------------------------------------------------------------------| +| enum  | StarLevel {LevelZero =0, LevelOne, LevelTwo, LevelThree, LevelFour,LevelFive} | + + + +> 枚举类型 + + +| statement | describe | +|---------------------------------|--------| +| void setIcon(const QIcon&); | settings icon | +| void setTime(const QString&); | set comment time | +| void setName(const QString&); | set comment name | +| void setText(const QString&); | Set comment content | +| void setGrade(StarLevel level); | set comment level | + + +### **4.1.10** KListView +> +> Provide the display effect of a picture with two lines of text. If there is only one line of text, it will be displayed in the center of the icon. + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image37.png) + +### **4.1.11** KTag +> +> Labels are divided into default and closeable. + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image38.png) + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image39.png) + +> enumerated type + +| | | +|-------|-----------------------------------------------------------| +| enum  | TagStyle { HighlightTag, BoderTag, BaseBoderTag, GrayTag} | + +| statement | describe | +|-----------------------------------|-------------| +| void setClosable(bool flag) | Sets whether the label can be closed. | +| bool closable() | Returns whether the tab can be closed. | +| void setText(const QString &text) | Set the text of the label. | +| void setTagStyle(TagStyle style) | Set the style of the label. | +| TagStyle tagStyle() | Get the label's style. | +| QString text() | Get the label's text. | + + + +### **4.1.12** KTranslucentFloor +> +> KTranslucentFloor, inherited from QFrame, provides a frosted glass bottom plate, which can set rounded corners and whether to add shadow effects. Enabled since version 1.2.0.12. + +![输入图片说明](assets/openKylin%20SDK%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97V2.0/image40.png) + + +| statement | describe | +|-------------------------------------|--------------------------| +| void setBorderRadious(int radious); | set corner radius | +| int borderRadius(); | Returns the corner radius | +| void setShadow(bool flag); | Set whether to show shadows | +| bool shadow(); | Return whether to show shadow | +| void setEnableBlur(bool flag); | Set whether to enable frosted glass effect (enabled since 2.0.0.0) | +| bool enableBlur(); | Get whether the frosted glass effect is enabled (enabled since 2.0.0.0) | +| void setOpacity(qreal opacity); | Set transparency (enabled since 2.0.0.0) | +| qreal opacity(); | Get transparency (enabled since 2.0.0.0) | + + +## 4.2 Wayland-helper +> +> This module is mainly responsible for providing a compatible interface that can take effect under both the X platform and the Wayland platform, so that the application does not need to consider the difference of the display platform. The module is installed as follows: +``` +sudo apt install libkysdk-waylandhelper libkysdk-waylandhelper-dev +``` +> According to different project types, you can refer to the following demos to build projects: +> +> (1) .pro file build project: +> +> Add in the qt project .pro file: + + +``` +CONFIG += link_pkgconfig +PKGCONFIG += kysdk-waylandhelper +``` + + +> (2) CMakeLists.txt build project + + +``` +cmake_minimum_required(VERSION 3.5) +find_package(Qt5 COMPONENTS Widgets REQUIRED) +find_package(PkgConfig REQUIRED) +pkg_check_modules(KYSDKWAYLANDHELPER_PKG kysdk-waylandhelper) +target_include_directories(demo PRIVATE ${KYSDKWAYLANDHELPER_PKG_INCLUDE_DIRS}) +target_link_directories(demo PRIVATE ${KYSDKWAYLANDHELPER_PKG_LIBRARY_DIRS}) +target_link_libraries(demo Qt5::Widgets ${KYSDKWAYLANDHELPER_PKG_LIBRARIES}) +``` + + +### **4.2.1** WindowManager + + +| statement | describe | +|-----------------------------------------------------------------|-------------------------------------------------| +| static WindowManager* self(); | Get the singleton object | +| static WindowInfo getwindowInfo(const WindowId& windowId); | Get window information | +| static WindowId currentActiveWindow(); | Get the current active window | +| static void keepWindowAbove(const WindowId& windowId); | top window | +| static QString getWindowTitle(const WindowId& windowId); | Get window title | +| static QIcon getWindowIcon(const WindowId& windowId); | Get window icon | +| static QString getWindowGroup(const WindowId& windowId); | Get the group name of the group where the window is located | +| static void closeWindow(const WindowId& windowId); | close the window | +| static void activateWindow(const WindowId& windowId); | activate window | +| static void maximizeWindow(const WindowId& windowId); | maximize window | +| static void minimizeWindow(const WindowId& windowId); | minimize window | +| static quint32 getPid(const WindowId& windowId); | Get the window process pid | +| static void showDesktop(); | show current desktop | +| static void hideDesktop(); | undisplay current desktop | +| static QString currentDesktop(); | Get the name of the current desktop | +| static QList windows(); | Get current window list | +| static NET::WindowType getWindowType(const WindowId& windowId); | Get the window type, only applicable in X environment, return normal in wayland | +| static void | setGeometry(QWindow *window,const QRect &rect); | set window position | +| static void setSkipTaskBar(QWindow *window,bool skip); | Set whether to skip the taskbar (enabled since 2.0.0.0) | +| static void setSkipSwitcher(QWindow *window,bool skip); | Set whether to skip window selection (enabled since 2.0.0.0) | +| static bool skipTaskBar(const WindowId& windowId); | Determine whether the form skips the taskbar (enabled since 2.0.0.0) | +| static bool skipSwitcher(const WindowId& windowId); | Determine whether the form skips window selection (enabled since 2.0.0.0) | +| static bool isShowingDesktop(); | Determine whether the desktop is displayed (enabled since 2.0.0.0) | +| static void setOnAllDesktops(const WindowId &windowId); | Settings window is shown in all desktops (enabled since 2.0.0.0) | +| static bool isOnAllDesktops(const WindowId &windowId); | Determine whether the window is displayed on all desktops (enabled since 2.0.0.0) | + + + +### **4.2.2** WindowInfo + + +| statement | describe | +|------------------------------------------------|----------------| +| inline bool isMaximized() const; | Returns whether the window is maximized | +| inline bool isMinimized() const; | Returns whether the window is minimized | +| inline bool isMaximizable() const; | Returns whether the window can be maximized | +| inline bool isMinimizable() const; | Returns whether the window can be minimized | +| inline bool isKeepAbove() const; | Returns whether the window is in the top state | +| inline bool hasSkipTaskbar() const; | Returns whether the window skips the taskbar | +| inline bool isFullscreen() const; | Returns whether the window is full screen | +| inline bool isOnAllDesktops() const; noexcept; | Returns whether the window is shown on all desktops | +| inline bool isValid() const; | Determine whether the window id is valid | +| inline bool isActive() const noexcept; | Returns whether the window is active | + + + +### **4.2.3** UkuiStyleHelper + + +| statement | describe | +|-------------------------------------|---------| +| static UkuiStyleHelper *self(); | Get the singleton object | +| void removeHeader(QWidget* widget); | Remove window title bar | + + + +## 4.3 Application general function module + +### 4.3.1 Log module + + +| submodule | Programming language | statement | describe | +|------|------|--------------------------------------------------------------------------------------------------|--------------------| +| log module | C++ | static void logOutput(QtMsgType type , const QMessageLogContext &context , const QString &msg); | Used by Qt to register logging functions and should not be called alone. | +| | | Parameter Description | Return value description | +| | | type:Log type context: call print log interface file information msg: log information | none | + + + +### 4.3.2 System related modules + +| submodule | Programming language | statement | describe | +|------|------|---------------------------------------------|------------| +| window tube module | C++ | static bool setWindowMotifHint(int winId); | Add window protocol . | +| | | Parameter Description | Return value description | +| | | winId : window id | success : true | +| | | | fail : false | + + + +| submodule | Programming language | statement | describe | +|------|------|------------------------------------------|------------| +| window tube module | C++ | static bool setScalingProperties(void); | Set window scaling properties | +| | | Parameter Description | Return value description | +| | | none | success : true | +| | | | fail : false | + +| submodule | Programming language | statement | describe | +|-----------|------|-----------------------------------------------------------------|---------------| +| session module | C++ | quint32 setInhibitLockScreen(AppName appName , QString reason); | Prohibit system lock screen . | +| | | Parameter Description | Return value description | +| | | appName : application name | success : a positive integer other than 0 | +| | | reason : Reasons why the lock screen is prohibited | fail : 0 | + + + +| submodule | Programming language | statement | describe | +|-----------|------|----------------------------------------|------------| +| session module | C++ | bool unInhibitLockScreen(quint32 flag) | Unblock system lock screen . | +| | | Parameter Description | Return value description | +| | | flag : Prohibition of lock screen logo | success : true | +| | | | fail : false | + + + +### 4.3.3 d-bus Module ------ will be obsolete soon + + +| submodule | Programming language | statement | describe | +|-----------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------| +| d-bus module | C++ | static QList callMethod(QString serviceName, QString objectPath, QString interfaceName, QString methodName, QList args = QList()); | 函数调用 | +| | | Parameter Description | Return value description | +| | | serviceName : Service Name | 函数返回值 | +| | | objectPath : object path | | +| | | interfaceName : interface name | | +| | | methodName : Function name | | +| | | args : parameter list | | + + + +### 4.3.4 System Information Module + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------|-------------------------------| +| System Information Module | C++ | QString getLsbReleaseInformation(QString key); | Obtain information according to the key value of the lsb-release file | +| | | Parameter Description | Return value description | +| | | key : key value | The obtained information, if it is empty, it may be indeed empty or it may fail | + + + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------|------------------------------| +| System Information Module | C++ | QString getOsReleaseInformation(QString key); | Get information according to the key value of the os-release file | +| | | Parameter Description | Return value description | +| | | key : key value | The obtained information, if it is empty, it may be indeed empty or it may fail | + + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------|--------------------------| +| System Information Module | C++ | QString getProjectCodeName(void) | Get the value of the PROJECT_CODENAME field | +| | | Parameter Description | Return value description | +| | | none | empty : failed | +| | | | non-empty: the obtained value | + + + + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------|------------| +| System Information Module | C++ | QString getCpuModelName(void) | Get CPU model | +| | | Parameter Description | Return value description | +| | | none | empty : failed | +| | | | non-empty: the obtained value | + + + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------|------------| +| System Information Module | C++ | QString getHdPlatform(void); | Obtain hardware platform information | +| | | Parameter Description | Return value description | +| | | none | empty : failed | +| | | | non-empty: the obtained value | + + + +# 5 Basic Development SDK +> +> The design of this layer mainly provides an operating system-independent, highly versatile, and basic function set for application development. Reduce the difference and complexity of different applications in realizing the same function. The design of this layer mainly provides application development with a set of functions that are independent of the operating system, highly versatile, and fundamental. Reduce the difference and complexity of different applications in realizing the same function. +> +> Install command: + + +``` +$ sudo apt install libkysdk-base libkysdk-base-dev +``` + + +## **5.1** log +> +> The C language log module provides eight levels of logging interfaces, and non-root programs are recorded in \~/.log +> +> directory, the root program is recorded under /var/log + + +``` +$ sudo apt-get install libkysdk-log llibkysdk-log-dev +``` + + +> (1) CMakeLists.txt build project +> +``` +aux_source_directory(. SOURCESCODE) +add_library(kylog SHARED ${SOURCESCODE}) +add_executable(kylog-testlog test/test-log.c) +add_executable(kylog-testsetdir test/test-setdir.c) +add_executable(kylog-testpressure test/test-pressure.c) +add_executable(kylog-testautowrap test/test-autowrap.c) +find_library(SYSTEMD_LIB systemd) +target_link_libraries(kylog kyconf pthread ${SYSTEMD_LIB}) +target_link_libraries(kylog-testlog kylog) +target_link_libraries(kylog-testsetdir kylog) +target_link_libraries(kylog-testautowrap kylog) +target_link_libraries(kylog-testpressure kylog) +``` +> (2) To call the log module, you need to add a header file: +> +``` +#include "kysdk/kysdk-base/libkylog.h" +``` +> +> output log + + +| type | statement | +|---------------|---------------------------------| +| Output debug level log | #define klog_debug(fmt , ...) | +| Output info level log | #define klog_info(fmt , ...) | +| Output notice level log | #define klog_notice(fmt , ...) | +| Output warning level log | #define klog_warning(fmt , ...) | +| Output error level log | #define klog_err(fmt , ...) | +| Output crit level log | #define klog_crit(fmt , ...) | +| Output alert level log | #define klog_alert(fmt , ...) | +| Output emerg level log | #define klog_emerg(fmt , ...) | + + + +> Initialize logging + +| submodule | Programming language | statement | describe | +|-----|------|-----------------------------------|----------------------------------| +| log | C | extern int | kdk_logger_init(const char *ini) | Initialize the log record, or directly use the above log record macro without calling this function, if run in this way, the program will use the default log configuration file | +| | | Parameter Description | Return value description | | +| | | ini:Log configuration file path, if NULL is passed in, the default log configuration file will be used | int,0 means success, non-zero means failure | + + +> Buffer log write + +| submodule | Programming language | statement | describe | +|-----|------|-------------|--------------------------------| +| log | C | extern void | kdk_logger_flush() DESTRUCTOR; | In the asynchronous writing mode, you can call this function to manually write the logs in the buffer to the file | +| | | Parameter Description | Return value description | | +| | | none | none | + + + +> Set the log storage directory + +| submodule | Programming language | statement | describe | +|-----|------|-------------------------------------------------|---------------------------------------------------------| +| log | C | extern int kdk_logger_setdir(const char* dpath) | Set the log storage directory, if not set, non-root programs will be recorded in ~/.log, root programs will be recorded in /var/log | +| | | Parameter Description | Return value description | | +| | | dpath: log storage path | int | Returns 0 on success, -1 on failure | + + + +> Set log output to wrap automatically + + +| submodule | Programming language | statement | describe | +|-----|------|---------------------------------------------------|------------| +| log | C | extern void kdk_logger_set_autowrap(int autowarp) | Set log output to wrap automatically | +| | | Parameter Description | Return value description | | +| | | autowarp:1 means start line wrapping is enabled, 0 means automatic line wrapping is disabled | none | + + + +## **5.2** Timer +> +> C language timer module, providing timer function interface for C/C++ program. + + +``` +$ sudo apt-get install libkysdk-timer libkysdk-timer-dev +``` + + +> (1)CMakeLists.txt build project +> +``` +aux_source_directory(. SOURCESCODE) +add_library(kytimer SHARED ${SOURCESCODE}) +add_executable(test-kytimer test/test-kytimer.c) +target_link_libraries(kytimer pthread) +target_link_libraries(test-kytimer kytimer) +``` + +> (2)To call the timer module, you need to add a header file: +> +``` +#include "kysdk/kysdk-base/libkytimer.h" +``` +> +> Initialize timer + +| submodule | Programming language | statement | describe | +|-----|------|----------------------|------------------| +| timer | C | int kdk_timer_init() | Initialize the timer core component | +| | | Parameter Description | Return value description | | +| | | none | int,0 means success, non-zero means failure | + + +> start timer + + +| submodule | Programming language | statement | describe | +|-----|------|----------------------|------------------| +| timer | C | size_t | kdk_timer_start(unsigned int intervalms, time_handler callback, KTimerAttribute attr, KTimerType type, void* userdata, int freeOnDelete) | +| | | Parameter Description | Return value description | +| | | intervalms:timer time in milliseconds | The ID of the size_t timer | +| | | callback:The callback function pointer triggered after the timer expires | | +| | | attr:Timer attribute, KTIMER_SINGLESHOT indicates a one-time timer; KTIMER_PERIODIC indicates a periodic timer; KTIMER_NEVER indicates a timer that will not be triggered | | +| | | type:Timer type, KTIMER_ABSOLUTE indicates an absolute time timer, modifying the system time will not affect the timer time; KTIMER_RELATIVE indicates a relative time timer, modifying the system time will affect the timer time | | +| | | userdata:pointer to user data | | +| | | freeOnDelete: [Not Enabled] | | + + + +> stop the given timer + + +| submodule | Programming language | statement | describe | +|-----|------|-------------------------------------|----------| +| timer | C | void kdk_timer_stop(size_t timerfd) | stop the given timer | +| | | Parameter Description | Return value description | | +| | | timerfd:Timer ID returned by kdk_timer_start: | none | + + + +> destroy timer + + +| submodule | Programming language | statement | describe | +|-----|------|--------------------------|-------| +| timer | C | void kdk_timer_destroy() | destroy timer | +| | | Parameter Description | Return value description | | +| | | none | none | + + + +> reset timer + + +| submodule | Programming language | statement | describe | +|-----|------|----------------------------------------------------------------|-------| +| timer | C | void kdk_timer_reset(size_t timerfd , unsigned int intervalms) | reset timer | +| | | Parameter Description | Return value description | +| | | timerfd:Timer ID returned by kdk_timer_start | none | +| | | intervalms:The time interval that needs to be adjusted, in ms | | + + + +## **5.3** C language string extension +> +> This module encapsulates the C interface for string operations, including string cropping, splitting, case conversion, and searching for specific characters. + +``` +$ sudo apt-get install libkysdk-utils libkysdk-utils-dev + +``` + +> (1)To call the C language string extension module, a header file needs to be added: +> +``` +#include "kysdk/kysdk-base/cstring-extension.h" +``` +> +> split string + + +| submodule | Programming language | statement | describe | +|----------|------|-----------------------------------------|--------------------| +| C language string extension | C | static inline char** strsplit(char *str, char delim) | Split the original string with the given delimiter, note that this function will modify the original string | +| | | Parameter Description | Return value description | +| | | str:the string to split | char** List of split strings, NULL terminated. The string list storing all the split strings itself is memory requested by alloc, so it should be freed after use; and the split strings are not the requested memory, but point to the specific memory in the original string. position, so they do not need to be freed separately | +| | | delim:delimiter | | + + + +> lowercase string + +| submodule | Programming language | statement | describe | +|----------|------|-----------------------------------------|--------------------| +| C language string extension | C | static inline void str2lower(char *str) | Converts all uppercase letters in a string to lowercase | +| | | Parameter Description | Return value description | | +| | | str:A pointer to the string to operate on | none | + + + +> uppercase string + + +| submodule | Programming language | statement | describe | +|----------|------|-----------------------------------------|---------------------| +| C language string extension | C | static inline void str2upper(char *str) | Convert all lowercase letters in a string to uppercase | +| | | Parameter Description | Return value description | | +| | | str:A pointer to the string to operate on | none | + + + +> count occurrences + +| submodule | Programming language | statement | describe | +|----------|------|----------------------------------------------------------|------------------| +| C language string extension | C | static inline size_t strcounts(const char *str, char ch) | Counts the number of occurrences of a given character in a string | +| | | Parameter Description | Return value description | +| | | str:original string | size_t:the number of occurrences of the character | +| | | ch:characters to be counted | | + + +> Suffix judgment + + +| submodule | Programming language | statement | describe | +|----------|------|--------------------------------------------------------------------|-------------------------------| +| C language string extension | C | static inline int strendwith(const char *str, const char *postfix) | It is case-sensitive to determine whether str ends with postfix | +| | | Parameter Description | Return value description | +| | | str:original string | int Returns 0 if str ends with postfix; otherwise returns 1 | +| | | postfix:The string suffix to match | | + + + +> Find the first occurrence of a substring + + +| submodule | Programming language | statement | describe | +|----------|------|--------------------------------------------------------|-------------------------------| +| C language string extension | C | static inline int strfirstof(const char* str, char ch) | Finds the position of the first occurrence of the given character in the given string; counting starts at 0 | +| | | Parameter Description | Return value description | +| | | str:original string | position of the first occurrence of int, or -1 if the given character is not found | +| | | ch:character to look for | | + + + +> Find the last occurrence of a substring + + +| submodule | Programming language | statement | describe | +|----------|------|-------------------------------------------------------|--------------------------------| +| C language string extension | C | static inline int strlastof(const char* str, char ch) | Finds the position of the last occurrence of the given character in the given string; counting starts at 0 | +| | | Parameter Description | Return value description | +| | | str:original string | position of the last occurrence of int, or -1 if the given character is not found | +| | | ch:character to look for | | + + + +> remove spaces and tabs + + +| submodule | Programming language | statement | describe | +|----------|------|---------------------------------------------|--------------------------------------| +| C language string extension | C | static inline void strstripblank(char *str) | Delete spaces and horizontal tabs (tab) before and after the given string, note that this operation will modify the original string | +| | | Parameter Description | Return value description | | +| | | str:String pointer to modify | none | + + + +> Skip all leading spaces, tabs, newlines + + +| submodule | Programming language | statement | describe | +|----------|------|-------------------------------------------------------|---------------------------------| +| C language string extension | C | static inline const char *strskipspace(const char *p) | Skip all spaces, tabs, and newlines before the string; this operation does not modify the original string | +| | | Parameter Description | Return value description | | +| | | p:pointer to the original string | const char* Pointer to the character string after skipping the space | + + + +> Prefix judgment (case sensitive) + + +| submodule | Programming language | statement | describe | +|----------|------|----------------------------------------------------------------------|------------------------------| +| C language string extension | C | static inline int strstartswith(const char *str, const char *prefix) | Determine whether str starts with prefix, this function is case sensitive | +| | | Parameter Description | Return value description | +| | | str:original string | int Returns 0 if str begins with prefix; otherwise returns 1 | +| | | prefix:string prefix to match | | + + + +> Prefix judgment (case insensitive) + + +| submodule | Programming language | statement | describe | +|----------|------|-----------------------------------------------------------------------------|------------------------------| +| C language string extension | C | static inline int strstartswith_nocase(const char *str, const char *prefix) | Determine whether str starts with prefix; case insensitive | +| | | Parameter Description | Return value description | +| | | str:original string | int Returns 0 if str begins with prefix; otherwise returns 1 | +| | | prefix:string prefix to match | | + + +> Delete the specified characters before and after the string + + +| submodule | Programming language | statement | describe | +|----------|------|-------------------------------------------------|--------------------------------------------| +| C language string extension | C | static inline void strstrip(char *str, char ch) | Perform a strip operation on a given string, and delete the specified characters before and after the string; note that this operation will modify the original string | +| | | Parameter Description | Return value description | +| | | str:The pointer to the string that needs to be stripped | none | +| | | ch:characters to delete | | + + + +> Skip all leading spaces, horizontal tabs + + +| submodule | Programming language | statement | describe | +|----------|------|-------------------------------------------------------|------------------------------------| +| C language string extension | C | static inline const char *strskipblank(const char *p) | Skip all spaces and horizontal tabs before the string; this operation does not modify the original string | +| | | Parameter Description | Return value description | | +| | | p: pointer to the original string | const char* Pointer to the character string after skipping the space | + + + +> Delete leading and trailing spaces, tabs, newlines + + +| submodule | Programming language | statement | describe | +|----------|------|---------------------------------------------|-----------------------------------| +| C language string extension | C | static inline void strstripspace(char *str) | Delete spaces, tabs, and newlines before and after the given string. Note that this operation will modify the original string | +| | | Parameter Description | Return value description | | +| | | str:A pointer to a string that needs to be stripped | none | + + +## **5.4** Linked list module +> +> This module implements the related interface of linked list operation in C language. + +``` +$ sudo apt-get install libkysdk-utils libkysdk-utils-dev +``` + + +> (1) CMakeLists.txt build project +> +``` +aux_source_directory(linklist/skip_linklist SOURCESCODE) +add_library(kydatastruct SHARED ${SOURCESCODE}) +add_subdirectory(linklist) +include_directories(linklist) +include_directories(linklist/skip_linklist) +add_executable(test-delete linklist/skip_linklist/test/delete_test.c) +add_executable(test-insert linklist/skip_linklist/test/insert_test.c) +add_executable(test-search linklist/skip_linklist/test/search_test.c) +target_link_libraries(test-delete kydatastruct) +target_link_libraries(test-insert kydatastruct) +target_link_libraries(test-search kydatastruct) +``` +> +> (2)To call the timer module, you need to add a header file: +> +``` +#include "kysdk/kysdk-base/skip_linklist.h" +``` +> +> Create skip list + + +| | | | | +|-----|------|------------------------------------------------|---------------------| +| submodule | Programming language | statement | describe | +| linked list | C | extern kysdk_skiplist* kysdk_create_skiplist() | Create skip list | +| | | Parameter Description | Return value description | | +| | | none | kysdk_skiplist* jump table | + + +> destroy jump list + + +| | | | | +|-----|------|----------------------------------------------------------|-------------------------------------------| +| submodule | Programming language | statement | describe | +| linked list | C | extern void kysdk_destroy_skiplist(kysdk_skiplist *list) | Destroy the jump list and reclaim all allocated memory; note that the memory pointed to by data.ptr (if it exists) will not be released | +| | | Parameter Description | Return value description | | +| | | list:jump table | none | + + + +> Delete the node corresponding to the key value + + +| | | | | +|-----|------|-----------------------------------------------------------------|---------------------| +| submodule | Programming language | statement | describe | +| linked list | C | extern int kysdk_skiplist_delete(kysdk_skiplist *list, int key) | Delete the node corresponding to the key value | +| | | Parameter Description | Return value description | +| | | list:linked list to be manipulated | int, Successful deletion returns 0, failure returns -1 | +| | | key:key | | + + + +> insert node + + +| | | | | +|-----|------|--------------------------------------------------------------------------------------|--------------------| +| submodule | Programming language | statement | describe | +| linked list | C | extern int kysdk_skiplist_insert(kysdk_skiplist *list, int key, kysdk_listdata data) | insert node | +| | | Parameter Description | Return value description | +| | | list:linked list to be manipulated | int,Successful insertion returns 0, failure returns -1 | +| | | key:key | | +| | | data:data | | + + +> Search the content of data according to the given key + + +| | | | | +|-----|------|----------------------------------------------------------------------------|-----------------------------------------| +| submodule | Programming language | statement | describe | +| linked list | C | extern kysdk_listdata kysdk_skiplist_search(kysdk_skiplist *list, int key) | Search data content according to the given key | +| | | Parameter Description | Return value description | +| | | list:linked list to be manipulated | kysdk_listdata,When the searched key does not exist, the value of data.num is -1 | +| | | key:key | | + + + +> Set the highest level of skip table + + +| | | | | +|-----|------|--------------------------------------------------------------------------------------|------------------------| +| submodule | Programming language | statement | describe | +| linked list | C | extern int kysdk_skiplist_setmaxlevels(kysdk_skiplist *list, unsigned int maxlevels) | Set the highest level of the skip list, this option must be used when the skip list is empty | +| | | Parameter Description | Return value description | +| | | list:Jump table that needs to be modified | int,Returns 0 on success, -1 on failure | +| | | maxlevels:layers | | + + + +## **5.5** Configuration file operation +> +> KYSDK configuration file processing library, supports standard format, XML (not implemented), JSON (not implemented) +> +> Configuration file processing, including reading and writing operations of configuration files. +> +> sudo apt-get install libkysdk-config libkysdk-config-dev +> +> (1) CMakeLists.txt build project +> +``` +aux_source_directory(. SOURCESCODE) +add_library(kyconf SHARED ${SOURCESCODE}) +add_executable(kyconf-test-struct test/test_structlist.c) +target_link_libraries(kyconf-test-struct kyconf kylog pthread) +``` +> +> (2) To call the configuration file module, a header file needs to be added: +> +``` +#include "kysdk/kysdk-base/libkyconf.h" +``` +> +> Initialize configuration file + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------------------|------------------------------| +| Profile Operations | C | extern int kdk_conf_init(const char* confpath) | Initialize the configuration file | +| | | Parameter Description | Return value description | | +| | | confpath:The path to the configuration file | int Successfully returns the handle number (non-negative value), fails to return an error code (negative value) | + + + +> Destroy the specified configuration file handle + + +| submodule | Programming language | statement | describe | +|--------|------|--------------------------------------|-------------| +| Profile Operations | C | extern void kdk_conf_destroy(int id) | Destroys the specified profile handle | +| | | Parameter Description | Return value description | | +| | | id:The configuration file handle returned by kdk_conf_init | none | + + + +> reload configuration file + + +| submodule | Programming language | statement | describe | +|--------|------|------------------------------------|-------------------| +| Profile Operations | C | extern int kdk_conf_reload(int id) | reload configuration file | +| | | Parameter Description | Return value description | | +| | | id:The configuration file handle returned by kdk_conf_init | int Returns 0 on success, returns an error code on failure | + + + +> Get the value of the specified configuration item + + +| submodule | Programming language | statement | describe | +|--------|------|-----------------------------------------------------------------------------------|----------------------------------------| +| Profile Operations | C | extern const char* kdk_conf_get_value(int id, const char* group, const char* key) | Get the value of the specified configuration item | +| | | Parameter Description | Return value description | +| | | id:The configuration file handle returned by kdk_conf_init | const char* The value owned by the configuration item, if the key does not exist, an empty string will be returned | +| | | group:The group name of the key | | +| | | key:Configuration item name | | + + + +> enumeration key value + + +| submodule | Programming language | statement | describe | +|--------------|----------|------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------| +| Profile Operations | C | extern char** const kdk_conf_list_key(int id, const char* group) | List the key values under the specified Group of the configuration file corresponding to the id, and end with a NULL pointer | +| | | Parameter Description | Return value description | +| | | id:Handle value returned by kdk_conf_init | const char** const is a NULL-terminated string list, each string is a key name, and the string list itself is memory allocated by alloc and needs to be released by free; the string does not need to be released | +| | | group:Group name to be listed | | + + + +> Enumerate the Group of the configuration file + + +| submodule | Programming language | statement | describe | +|--------|------|-------------------------------------------------|--------------------------------------------------------------------------------------| +| Profile Operations | C | extern char** const kdk_conf_list_group(int id) | List all the groups whose id corresponds to the configuration file, and end with a NULL pointer | +| | | Parameter Description | Return value description | | +| | | id:Handle value returned by kdk_conf_init | const char** const NULL-terminated string list, each string is a group name, the string list itself is memory allocated by alloc and needs to be released by free; the string does not need to be released | + + + +## **5.6** Unit conversion + + +``` +$ sudo apt-get install libkysdk-utils libkysdk-utils-dev +``` + + +> (1) To call the C language string extension module, a header file needs to be added: +> +``` +#include "kysdk/kysdk-base/cstring-extension.h" +``` +> +> Character format unit conversion + +| submodule | Programming language | statement | describe | +|--------|------|----------------------------------------------------------------------------------------------------------------------|-----------------| +| Profile Operations | C | extern int kdkVolumeBaseCharacterConvert(const char* origin_data, KDKVolumeBaseType result_base, char* result_data); | character format unit conversion | +| | | Parameter Description | Return value description | +| | | Entry parameters: | Int type value, whether the interface execution is successful | +| | | origin_data:Data of the original character type, ending with a specific base unit, if not, the default is 'B' | 0 - no exception | +| | | result_base:desired result unit | 1- Illegal base | +| | | Out of parameters: | 2- Illegal parameter | +| | | result_data:Character data converted into base system, with base unit | 3- Illegal data format | +| | | | 4-Unknown error caused by abnormal system operation | + + +> Digital format unit conversion + + +| submodule | Programming language | statement | describe | +|--------|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------| +| Profile Operations | C | extern int kdkVolumeBaseNumericalConvert(double origin_numerical, KDKVolumeBaseType origin_base, KDKVolumeBaseType result_base, double* result_numerical); | Digital format unit conversion | +| | Parameter Description | Return value description | | +| | Entry parameters: | Int type value, whether the interface execution is successful | | +| | origin_numerical:raw numeric data | 0 - no exception | | +| | origin_base:original base unit | 1- Illegal base | | +| | Out of parameters: | 2- Illegal parameter | | +| | result_base:desired base unit | 3- Illegal data format | | +| | result_numerical:Number type data in the desired base | 4-Unknown error caused by abnormal system operation | | \ No newline at end of file diff --git a/en/Community-Engagement-Guides/Adaptation_Tasks_Collection.md b/en/Community-Engagement-Guides/Adaptation_Tasks_Collection.md new file mode 100644 index 0000000000000000000000000000000000000000..f87ba301f22c8986ca28ec1c41f0585aefd7b375 --- /dev/null +++ b/en/Community-Engagement-Guides/Adaptation_Tasks_Collection.md @@ -0,0 +1,11 @@ +--- +title: A collection of adaptation tasks +description: +published: true +date: 2022-05-17T07:16:22.277Z +tags: +editor: markdown +dateCreated: 2022-03-11T03:17:01.294Z +--- + +# Adaptation task collection \ No newline at end of file diff --git a/en/Community-Engagement-Guides/Translation_Assignment_Collection.md b/en/Community-Engagement-Guides/Translation_Assignment_Collection.md new file mode 100644 index 0000000000000000000000000000000000000000..019444c5173ff4c8fc4a1ffbea79d4eeebfc41c0 --- /dev/null +++ b/en/Community-Engagement-Guides/Translation_Assignment_Collection.md @@ -0,0 +1,13 @@ +--- +title: A Collection of Translation Tasks +description: +published: true +date: 2022-05-17T07:16:20.488Z +tags: +editor: markdown +dateCreated: 2022-03-11T03:16:58.824Z +--- + +# Translation task collection + +Note: Please place the entire translated file in the openKylin/docs/en directory, and the subsequent sig group will classify it separately \ No newline at end of file diff --git a/en/Community-Engagement-Guides/View_Source_Code.md b/en/Community-Engagement-Guides/View_Source_Code.md new file mode 100644 index 0000000000000000000000000000000000000000..a0a0fb5de43fbd9098903ec7dbdbabb078441d44 --- /dev/null +++ b/en/Community-Engagement-Guides/View_Source_Code.md @@ -0,0 +1,11 @@ +--- +title: view source code +description: +published: true +date: 2022-05-17T07:16:18.690Z +tags: +editor: markdown +dateCreated: 2022-03-11T03:16:56.375Z +--- + +# view source code \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/.keep b/en/Development-And-Common-Documents/Basic_Operation/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Development-And-Common-Documents/Basic_Operation/Address_Source_Lanzhou_University_Mirror.md b/en/Development-And-Common-Documents/Basic_Operation/Address_Source_Lanzhou_University_Mirror.md new file mode 100644 index 0000000000000000000000000000000000000000..04ec9ebc1bd7cc8512b627055f0d7dfb57b60813 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Address_Source_Lanzhou_University_Mirror.md @@ -0,0 +1,22 @@ +#
Replace the address of the source server with the mirror image of Lanzhou University
+####
Author: lerambo
+####
2022-08-04 11:25:00
+ + +### 1. Enter the command +```bash +sudo pluma /etc/apt/sources.list +``` +### 2. Replace the mirror address of the file content +```bash +#Original mirror address +#deb http://archive.build.openkylin.top/openkylin/ yangtze main cross pty +#deb http://archive.build.openkylin.top/openkylin/ yangtze-security main cross pty +#deb http://archive.build.openkylin.top/openkylin/ yangtze-updates main cross pty + + +#Lanzhou University mirror address +deb http://mirror.lzu.edu.cn/openkylin/ yangtze main cross pty +deb http://mirror.lzu.edu.cn/openkylin/ yangtze-security main cross pty +deb http://mirror.lzu.edu.cn/openkylin/ yangtze-updates main cross pty +``` \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Attributes_View_Permissions_File.md b/en/Development-And-Common-Documents/Basic_Operation/Attributes_View_Permissions_File.md new file mode 100644 index 0000000000000000000000000000000000000000..a445d277594c28ec142cd7f7791f6ec70e1ff474 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Attributes_View_Permissions_File.md @@ -0,0 +1,21 @@ +# openkylin basic properties Check the read, write and execute permissions of the file +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + + +Right click on the file - Properties + +![image](../assets/KVM/image/ok-showfilepri-1.png) + +View file permissions + +![image](../assets/KVM/image/ok-showfilepri-2.png) + +Permissions are read, write, execute + +Classification includes user, user's group, other + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Brief_Description_Installation_Process.md b/en/Development-And-Common-Documents/Basic_Operation/Brief_Description_Installation_Process.md new file mode 100644 index 0000000000000000000000000000000000000000..dddd2fa177a94f696af052604ffae07ca79293aa --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Brief_Description_Installation_Process.md @@ -0,0 +1,45 @@ +# Openkylin basics Brief description of the installation process +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Welcome and selection interface + +![image](../assets/KVM/image/openkylin-install-1.png) + +Check the platter for errors + +![image](../assets/KVM/image/openkylin-install-2.png) + +test memory + +![image](../assets/KVM/image/openkylin-install-3.png) + +If you use vmware, set the default disk size allocated to the virtual machine to 50G + +Full disk installation and custom installation + +![image](../assets/KVM/image/ok-install-dipar-1.png) + +![image](../assets/KVM/image/ok-install-dipar-2.png) + +Pay attention to the file system of each partition. There are knowledge points here. Interested students can study it in detail. + +![image](../assets/KVM/image/ok-install-dipar-3.png) + +![image](../assets/KVM/image/ok-install-dipar-4.png) + +mount point + +``` c +/ +/boot +/data +/backup +/home +/tmp +``` + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Burn_Create_ISO_Image.md b/en/Development-And-Common-Documents/Basic_Operation/Burn_Create_ISO_Image.md new file mode 100644 index 0000000000000000000000000000000000000000..6a2a746387c9d0023dab7b9fe6f35bc65106601d --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Burn_Create_ISO_Image.md @@ -0,0 +1,24 @@ +# openkylin Basics Burning Creating ISO images +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +Logo in the lower left corner - Other - Burning + +![image](../assets/KVM/image/ok-createiso-1.png) + +Add burn data + +![image](../assets/KVM/image/ok-createiso-2.png) + +create mirror + +![image](../assets/KVM/image/ok-createiso-3.png) + +Check the created object + +![image](../assets/KVM/image/ok-createiso-4.png) + +The form of installing files in the ISO can generally be used in: the virtual machine transfers files by mounting the image + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Check_Machine_Information.md b/en/Development-And-Common-Documents/Basic_Operation/Check_Machine_Information.md new file mode 100644 index 0000000000000000000000000000000000000000..2d2145d1e40da0f0af505510b51e679d18bf9471 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Check_Machine_Information.md @@ -0,0 +1,28 @@ +# openKylin Foundation Toolbox View full machine information +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Toolbox View machine information Hardware parameters Hardware monitoring Driver management + +Check machine information + +![image](../assets/KVM/image/ok-toolshowpc-1.png) + +hardware parameters + +![image](../assets/KVM/image/ok-toolshowpc-2.png) + +hardware monitoring + +![image](../assets/KVM/image/ok-toolshowpc-3.png) + +driver management + +![image](../assets/KVM/image/ok-toolshowpc-4.png) + +I installed openkylin on a virtual machine, so all I see on the driver management interface are the driver names of the virtual machine software + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Compression_And_Decompression.md b/en/Development-And-Common-Documents/Basic_Operation/Compression_And_Decompression.md new file mode 100644 index 0000000000000000000000000000000000000000..7f7c787cecd590569d1bf2e1a94e5331117182b0 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Compression_And_Decompression.md @@ -0,0 +1,27 @@ +# openkylin basic archive manager compression and decompression +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + + +![image](../assets/KVM/image/ok-zip-1.png) + +Archive Manager is a compression and decompression tool + +![image](../assets/KVM/image/ok-zip-2.png) + +Unzip a single archive + +![image](../assets/KVM/image/ok-zip-3.png) + +Compress multiple files + +![image](../assets/KVM/image/ok-zip-4.png) + +Set password and split + +![image](../assets/KVM/image/ok-zip-5.png) + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Desktop_Display.md b/en/Development-And-Common-Documents/Basic_Operation/Desktop_Display.md new file mode 100644 index 0000000000000000000000000000000000000000..853db35627c37f94e23b144a7376314e0d724c80 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Desktop_Display.md @@ -0,0 +1,28 @@ +# openkylin basic desktop display +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +![image](../assets/KVM/image/ok-desktop-1.png) + +Start Menu + +![image](../assets/KVM/image/ok-desktop-2.png) + +Software Store - Mobile Apps + +![image](../assets/KVM/image/ok-ss-1.png) + +I am using a virtual machine. To install a mobile application, the mobile operating environment needs to be initialized, and the mobile operating environment does not support virtual machines, so the attempt failed. I will have a chance to find a physical machine and try again later. + +![image](../assets/KVM/image/ok-ss-2.png) + +power menu + +![image](../assets/KVM/image/ok-power-1.png) + +Hibernation Sleep Lock Screen Logout Reboot Shutdown + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/How_Upgrade_System.md b/en/Development-And-Common-Documents/Basic_Operation/How_Upgrade_System.md new file mode 100644 index 0000000000000000000000000000000000000000..cfc98a3587d7bc14950b036a8269f81ff0cd1207 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/How_Upgrade_System.md @@ -0,0 +1,12 @@ +# How to upgrade openKylin + +## Download the new installation through the official website + +[Download link](https://www.openkylin.top/downloads/) + +## Users who have already installed openKylin can upgrade via: + +``` +sudo apt update +sudo apt full-upgrade +``` \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basic_U_Disk_Make_System.md b/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basic_U_Disk_Make_System.md new file mode 100644 index 0000000000000000000000000000000000000000..2f4426e2e4c624452100a72b8e44a3f818a423b0 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basic_U_Disk_Make_System.md @@ -0,0 +1,16 @@ +# openkylin basic U disk launcher Make system boot U disk +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Use the U disk launcher to make a system boot U disk + +![image](../assets/KVM/image/ok-upanos-1.png) + +The USB flash drive will be formatted, so the data in the USB flash drive must be copied out in advance. + +Now the USB flash drive is cheap, prepare a 3.0 port, the size is 16G or 32G. + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basics_F1_View_User_Manual.md b/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basics_F1_View_User_Manual.md new file mode 100644 index 0000000000000000000000000000000000000000..6ed77ede9f14ae4c171f77ba9ee1006683430777 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basics_F1_View_User_Manual.md @@ -0,0 +1,35 @@ +# openkylin basics F1 view user manual +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +I know two ways to bring up the user manual + +1. Use the shortcut key F1 +2. Through Settings-Help + +Mainly talk about the operation steps of the second method. + +  + +Logo in lower left corner - settings + +![image](../assets/KVM/image/ok-doc-1.png) + +Set the three horizontal lines in the upper right corner of the interface + +![image](../assets/KVM/image/ok-doc-2.png) + +help + +![image](../assets/KVM/image/ok-doc-3.png) + +user manual + +![image](../assets/KVM/image/ok-doc-4.png) + +By reading the user manual, some problems can be effectively solved + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basics_Nm_Connection_Editor.md b/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basics_Nm_Connection_Editor.md new file mode 100644 index 0000000000000000000000000000000000000000..3e54f025b3e9c0fbb8b297994eb807b84396e8fc --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Openkylin_Basics_Nm_Connection_Editor.md @@ -0,0 +1,17 @@ +# nm-connection-editor Open the network connection configuration tool +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + + +``` bash +nm-connection-editor +``` + +![image](../assets/KVM/image/ok-bash-nm-connection-editor-1.png) + +In this interface, specific network links can be configured + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Quickly_Check_Computer_Equipped_USB30.md b/en/Development-And-Common-Documents/Basic_Operation/Quickly_Check_Computer_Equipped_USB30.md new file mode 100644 index 0000000000000000000000000000000000000000..8e79c312086206194b8c242f344d9c10a347d53c --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Quickly_Check_Computer_Equipped_USB30.md @@ -0,0 +1,12 @@ +#
Quick check if your computer is equipped with USB 3.0
+####
Author: Little K
+####
2022-04-22 23:36:00
+ +More and more computers are coming with USB 3.0 ports, but how do you know if your computer has a 3.0 port and which port is 3.0? Methods as below: +Open a terminal and use the following command: +$ lsusb +This command displays USB-related information in the system. Check the results. If the words "3.0 root hub" are displayed, it means that the system has USB 3.0. + + +Next, how to identify which port is USB 3.0? +Usually, USB 3.0 ports are marked with SS (short for Super Speed). If the hardware manufacturer doesn't mark SS or USB 3, check the color inside the port, USB 3.0 is usually blue. \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_Global_Search.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_Global_Search.md new file mode 100644 index 0000000000000000000000000000000000000000..7424c1335dd1bd42ad3342853152d98221a6c249 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_Global_Search.md @@ -0,0 +1,12 @@ +# openkylin basics set global search +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Improve global search efficiency by enabling indexing + +![image](../assets/KVM/image/ok-search-v-1.png) + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_Solid_Color_Background.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_Solid_Color_Background.md new file mode 100644 index 0000000000000000000000000000000000000000..b4b417afc0572e749d74dc2369cafa07c83b00db --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_Solid_Color_Background.md @@ -0,0 +1,15 @@ +# openkylin foundation set solid color background +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Settings - Personalization - Background + +![image](../assets/KVM/image/ok-screen-color-1.png) + +Retro style, like XP. +Some software that detects light leakage from the display also uses a solid color background + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_Time_Synchronization_Server.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_Time_Synchronization_Server.md new file mode 100644 index 0000000000000000000000000000000000000000..5cc19729e6597a897693646c1ddabb93579cc408 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_Time_Synchronization_Server.md @@ -0,0 +1,18 @@ +# openkylin basic settings View time zone and time synchronization server +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Settings - Time Language - Time and Date + +![image](../assets/KVM/image/ok-timeconserver-1.png) + +Add another time zone + +![image](../assets/KVM/image/ok-timeconserver-2.png) + +Through the "Add" function, you can view the time in other time zones, but you can't see it on the desktop, you can only view it in the time and date window. + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_View_And_Modify_Resolution.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_And_Modify_Resolution.md new file mode 100644 index 0000000000000000000000000000000000000000..bc3828e449606284d17f3b34e52c0d8030784bc3 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_And_Modify_Resolution.md @@ -0,0 +1,20 @@ +# openkylin basic settings view and modify resolution +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Logo in lower left corner - settings + +![image](../assets/KVM/image/ok-screen-1.png) + +Settings - System + +![image](../assets/KVM/image/ok-screen-2.png) + +Monitor - Resolution + +![image](../assets/KVM/image/ok-screen-3.png) + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Automatic_Login_Startup.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Automatic_Login_Startup.md new file mode 100644 index 0000000000000000000000000000000000000000..eed6646e6beea2a9c5fd067f1a357bf2832bb141 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Automatic_Login_Startup.md @@ -0,0 +1,26 @@ +# openkylin basic settings View account settings and password-free login, automatic login when booting +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Settings - Accounts - Account Information + +![image](../assets/KVM/image/ok-user-1.png) + +New user and related field requirements + +![image](../assets/KVM/image/ok-user-2.png) + +change Password + +![image](../assets/KVM/image/ok-user-3.png) + +view usergroup + +![image](../assets/KVM/image/ok-user-4.png) + +![image](../assets/KVM/image/ok-user-5.png) + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Default_Apps.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Default_Apps.md new file mode 100644 index 0000000000000000000000000000000000000000..a4cf2fd9b82b445bb2a3a201ca85ea3f2e3d6c55 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Default_Apps.md @@ -0,0 +1,14 @@ +# openkylin basic settings view default application +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Settings - Apps - Default Apps + +![image](../assets/KVM/image/ok-defaultsf-1.png) + +In daily use, we install new software, but when we double-click the file to run, we find that the program is still old. At this time, we can solve this problem by modifying the default application to open the file. + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Default_Shortcut_Keys.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Default_Shortcut_Keys.md new file mode 100644 index 0000000000000000000000000000000000000000..76d3a18c72f6d7b8a1094d34c2bcd17a9b359023 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Default_Shortcut_Keys.md @@ -0,0 +1,18 @@ +# openkylin basic settings View system default shortcut keys +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Settings - Devices - Shortcuts + +![image](../assets/KVM/image/ok-sck-1.png) + +hot key + +![image](../assets/KVM/image/ok-sck-2.png) + +I mainly use "Screenshot" and "Take a screenshot of an area", these two shortcut keys. + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Hibernation_Settings.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Hibernation_Settings.md new file mode 100644 index 0000000000000000000000000000000000000000..f9dfd87107576185e2abc2a4a5cf8de0bbdbabc0 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Hibernation_Settings.md @@ -0,0 +1,14 @@ +# openkylin basic settings view hibernation settings +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Settings - System - Power + +![image](../assets/KVM/image/ok-screen-sleep-1.png) + +You can view the sleep settings in the power interface + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Network_Configuration.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Network_Configuration.md new file mode 100644 index 0000000000000000000000000000000000000000..a20c0b324693e4e9481aa5a62f771d93782ed313 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Network_Configuration.md @@ -0,0 +1,34 @@ +# openkylin basic settings view network configuration +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Settings - Network - Wired Network + +![image](../assets/KVM/image/ok-shownetwork-1.png) + +View the network configuration information in use + +![image](../assets/KVM/image/ok-shownetwork-2.png) + +Network configuration information ipv4 + +![image](../assets/KVM/image/ok-shownetwork-3.png) + +Network configuration information ipv6 + +![image](../assets/KVM/image/ok-shownetwork-4.png) + +Back to the main interface - advanced settings + +![image](../assets/KVM/image/ok-shownetwork-5.png) + +![image](../assets/KVM/image/ok-shownetwork-6.png) + +View general Ethernet 802.1X security and more + +![image](../assets/KVM/image/ok-shownetwork-7.png) + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Version_Information.md b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Version_Information.md new file mode 100644 index 0000000000000000000000000000000000000000..47b3a8d8ec32923fcbb2f8c822988157846bfc62 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Settings_View_Version_Information.md @@ -0,0 +1,22 @@ +# openkylin basic settings View system version information +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Logo in lower left corner - settings + +![image](../assets/KVM/image/ok-osinfo-1.png) + +Settings - System + +![image](../assets/KVM/image/ok-osinfo-2.png) + +System - About + +![image](../assets/KVM/image/ok-osinfo-3.png) + +In this interface, you can view related information such as version name, computer name and kernel. + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/System_Monitor_View_Process.md b/en/Development-And-Common-Documents/Basic_Operation/System_Monitor_View_Process.md new file mode 100644 index 0000000000000000000000000000000000000000..7ffd9007def2a9adfcf5e51d7bef25bfc9f7c4f3 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/System_Monitor_View_Process.md @@ -0,0 +1,32 @@ +# openkylin basic system monitor view process +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +System Monitor - Processes - Applications + +![image](../assets/KVM/image/ok-osmonitor-1.png) + +System Monitor - Processes - My Processes + +![image](../assets/KVM/image/ok-osmonitor-2.png) + +system monitor - processes - all in town + +![image](../assets/KVM/image/ok-osmonitor-3.png) + +System Monitor - Services + +![image](../assets/KVM/image/ok-osmonitor-4.png) + +System Monitor - Disk + +![image](../assets/KVM/image/ok-osmonitor-5.png) + +Note that there are rules for disk naming, and interested students can learn about it. + +Students who want to learn the operating system can start from the perspective of the process to understand the status of the process, scheduling algorithm and related dependencies. + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/Terminal_Three_Startup_Methods.md b/en/Development-And-Common-Documents/Basic_Operation/Terminal_Three_Startup_Methods.md new file mode 100644 index 0000000000000000000000000000000000000000..f23aeb997b73d45f8c1f9488f07d5ab14a6adfad --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/Terminal_Three_Startup_Methods.md @@ -0,0 +1,24 @@ +# openkylin basic terminal three startup methods +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +Logo in the lower left corner - MATE terminal + +![image](../assets/KVM/image/ok-openterminal-1.png) + +![image](../assets/KVM/image/ok-openterminal-2.png) + +Right click on desktop - open terminal + +![image](../assets/KVM/image/ok-openterminal-3.png) + +![image](../assets/KVM/image/ok-openterminal-4.png) + +shortcut key ctrl + alt + t + +![image](../assets/KVM/image/ok-openterminal-5.png) + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/View_Computer_Default_Partitions.md b/en/Development-And-Common-Documents/Basic_Operation/View_Computer_Default_Partitions.md new file mode 100644 index 0000000000000000000000000000000000000000..a551b6e99c081fe752d73aae1978594059ea2f58 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/View_Computer_Default_Partitions.md @@ -0,0 +1,24 @@ +# openkylin basics View the default partition of the computer +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +computer + +![image](../assets/KVM/image/ok-osfirstfiles-1.png) + +You can see the file system disk and data disk + +View the root directory + +![image](../assets/KVM/image/ok-osfirstfiles-2.png) + +In the openkylin file system, each folder has its special positioning and function, interested students can learn in depth. + +View the contents of the data disk + +![image](../assets/KVM/image/ok-osfirstfiles-3.png) + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/View_Software_Store.md b/en/Development-And-Common-Documents/Basic_Operation/View_Software_Store.md new file mode 100644 index 0000000000000000000000000000000000000000..cbc870f43b8389ff19261adc6b2bc4ff2b26374e --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/View_Software_Store.md @@ -0,0 +1,18 @@ +# openkylin basics View the software store +#### Author: Shi Wanwu +#### 2022-11-21 22:38:16 +#### openKylin-0.7.5-x86_64 + +  + +software store + +![image](../assets/KVM/image/ok-showss-1.png) + +Easy and safe software installation + +![image](../assets/KVM/image/ok-showss-2.png) + +Can uninstall installed software + +  \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Basic_Operation/View_System_Information.md b/en/Development-And-Common-Documents/Basic_Operation/View_System_Information.md new file mode 100644 index 0000000000000000000000000000000000000000..71e56514351fdf8d1c6dd7fc95ca7ba8100731d8 --- /dev/null +++ b/en/Development-And-Common-Documents/Basic_Operation/View_System_Information.md @@ -0,0 +1,48 @@ +# View system information + +- View kernel version + +``` +uname -a +``` + +- View system version information + +``` +cat /etc/os-release +lsb_release -a +``` + +- View CPU information + +``` +lscpu +``` + +- View memory information + +``` +free +``` + +- View disk information + +``` +df -h +fdisk -l +``` + +- View real-time information of system resources + +``` +top +``` + +- View hard disk read and write speed +``` +iostat -t 1 3 +# 1s once, check 3 times +``` + + +> Copyright statement: This article is original by rechie, authorized according to [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license, please attach the source link and this statement for reprinting. \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Installation-Guide/.keep b/en/Development-And-Common-Documents/Installation-Guide/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Development-And-Common-Documents/Installation-Guide/OpenKylin_Installation_Guide.md b/en/Development-And-Common-Documents/Installation-Guide/OpenKylin_Installation_Guide.md new file mode 100644 index 0000000000000000000000000000000000000000..8a7020df404431393a307f1016cd2c2f54b0d783 --- /dev/null +++ b/en/Development-And-Common-Documents/Installation-Guide/OpenKylin_Installation_Guide.md @@ -0,0 +1 @@ +### openKylin Installation Guide \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/.keep b/en/Development-And-Common-Documents/Novice-Must-See/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Development-And-Common-Documents/Novice-Must-See/Basic_Operation_Linux_Files.md b/en/Development-And-Common-Documents/Novice-Must-See/Basic_Operation_Linux_Files.md new file mode 100644 index 0000000000000000000000000000000000000000..423b96d96356b248b5791ec32f6f4a57b458636f --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/Basic_Operation_Linux_Files.md @@ -0,0 +1,106 @@ +#
Linux file basic operations
+#### Author: winifred +#### Time: 2023.3.15 + +## 1. File directory + +### 1.1 ls command +The `ls` command is used to print the current directory list, and you can view file permissions (including directories, folders, and file permissions) to view directory information, etc. + +Command format: `ls [option] [directory name]` + +Common parameters: +- -a: list all files, including implied files starting with . +- -l: List file permissions, owner, file size and other information +- -t: Sort by file modification time + +### 1.2 cd command +The `cd` command is used to change the current directory to the specified directory. + +Command format: `cd [directory name]` + +Common examples: +- `cd /`: change to the root directory +- `cd ..`: switch to the previous directory +- `cd ~`: switch to user home directory + +### 1.3 pwd command +The `pwd` command is used to determine the exact location of the current directory within the file system. + +Command format: `pwd [option]` + +Common parameters: +- -P: Display the actual physical path +- -L: When the directory is a connection path, display the connection path + +## 2. Basic file operations + +### 2.1 Create a new file +Use the `touch` or `vi` command to create a blank file. + +Common examples: +```linux +touch test.md +vi test.md +``` + +### 2.2 Create a new directory +Use the `mkdir` command to create an empty directory, and you can also specify the permission attribute to create the directory. + +Common examples: +- Create an empty directory named mydir: `mkdir mydir` +- Create multi-level directories: `mkdir -p A/B/C` + +### 2.3 Delete files/directories +Use the `rm` command to delete a file, use the -f parameter to force deletion, and use the -r parameter to delete a directory. + +Common examples: +- Delete the test.md file: `rm test.md` +- Force delete test.md file: `rm -f test.md` +- Delete the A folder: `rm -r A` + +### 2.4 Copy files/directories +Use the `cp` command to copy a file to the specified directory, and use the -r parameter to copy the directory. + +Command format: +- Copy files: `cp [filename] [directory]` +- Copy directory: `cp -r [filename] [directory]` + +Common examples: +- Copy test.md file to C folder: `cp test.md /home/user/A/B/C` +> You need to enter the directory where the test.md file is located +- Copy A to the alphabet folder: `cp -r A alphabet` + +### 2.5 Moving and renaming files +Use the `mv` command to move files (cut) or rename files + +Command format: +- Move files: `mv [source directory file] [destination directory]` +- Rename file: `mv [original filename] [new filename]` + +Common examples: +- Move the file file to the filedir directory: `mv file filedir` +- Rename file file1 to file2: `mv file1 file2` + +### 2.6 View files +#### 2.6.1 cat, tac command +The `cat` and `tac` commands are used to print the contents of the file to the standard output (terminal), where cat displays the number of lines in positive order, and tac displays the number of lines in reverse order. + +Common examples: +- View the /etc/passwd file: `cat /etc/passwd` +- Show line numbers: `cat -n /etc/passwd` + +#### 2.6.2 more command +`more` is used to "read" the contents of a file. You can use Enter to scroll down, Space to print all, and q to quit. + +#### 2.6.3 head, tail command +View the first few lines and the last few lines of the file, the -n parameter is used to indicate the number of lines to view. + +### 2.7 grep command +The `grep` command is used to find matching text in a file, and can accept regular expressions and wildcards, and multiple `grep` command options can be used to generate output in various formats. + +Command format: `grep [option] pattern [file]` + +Common examples: +- Extract the line where root appears in the /etc/passwd file: `grep "root" /etc/passwd` +- Extract the line that does not appear root in the /etc/passwd file: `grep -v "root" /etc/passwd` \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/Commonly_Combination_Commands.md b/en/Development-And-Common-Documents/Novice-Must-See/Commonly_Combination_Commands.md new file mode 100644 index 0000000000000000000000000000000000000000..cb6f6dc5965701abe6748a4563a7658b552e3512 --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/Commonly_Combination_Commands.md @@ -0,0 +1,35 @@ +#
commonly used combination commands
+####
Author: Stranger
+####
2022-04-23 00:16:10
+ +There is not much content, if there are useful commands collected, it will be updated here as soon as possible + +1. Install header files + +``` +sudo apt install linux-headers-`uname -r` +``` + +2. Update boot + +``` +sudo update-grub +``` + +3. Check if a package is installed + +``` +dpkg -l|grep package name or some characters contained in the package name +``` + +4. Dual system time synchronization +``` +sudo timedatectl set-local-rtc 1 +sudo hwclock --localtime --systohc +``` + +5. Merge two files (merge file1.txt and file2.txt into file.txt) + +``` +cat file1.txt file2.txt > file.txt +``` \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/Interesting_Linux_Easter_Eggs.md b/en/Development-And-Common-Documents/Novice-Must-See/Interesting_Linux_Easter_Eggs.md new file mode 100644 index 0000000000000000000000000000000000000000..dc2f22eaeb4426706ab3673418c6b47d89f69685 --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/Interesting_Linux_Easter_Eggs.md @@ -0,0 +1,27 @@ +#
Interesting Linux easter eggs - using sudo to offend users
+####
Author: Little K
+####
2022-04-22 23:36:00
+ +One can configure sudo (which is used to authorize commands) to offend users who mistype their passwords. Let's take a look together! + +First, open a terminal and enter the following command: + +**sudo visudo** + +It is highly recommended to use visudo to edit the /etc/sudoers configuration file. There are two reasons why visudo is used, one is that it can prevent two users from modifying it at the same time; the other is that it can help verify whether the modification is correct. Visudo will not save configuration files with grammatical errors without authorization, it will prompt you about the problems and ask how to deal with them. By default, visudo opens the configuration file in vi, while in Ubuntu Kylin, visudo opens /etc/sudoers in nano by default. + +Then, at the top of the file, add this line: + +**Defaults insults** + +as the picture shows: + +![](https://www.ubuntukylin.com/upload/201602/1456191668463393.jpg) + +Next, save and close the file. If you are using nano, press Ctrl+X to exit and it will prompt you if you want to save the changes. Please press Y to save changes. + +Then, enter sudo -k in the terminal to clear the password cache. Finally, enter the wrong password in the sudo command: + +![](https://www.ubuntukylin.com/upload/201602/1456192456272768.jpg) + +Look, it's still impatient with me. Now you can also cry to your friends that your sudo bullies you^_^. \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/Linux_Facts20_About_Terminals.md b/en/Development-And-Common-Documents/Novice-Must-See/Linux_Facts20_About_Terminals.md new file mode 100644 index 0000000000000000000000000000000000000000..b983b322c4d92c60897c01292c14114b48c46d50 --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/Linux_Facts20_About_Terminals.md @@ -0,0 +1,234 @@ +#
Linux commands and 20 interesting things about Linux terminals
+####
Author: Little K
+####
2022-04-22 23:36:00
+ +Playing Linux is a lot of fun! Ha ha. Do not believe. Mark my words, by the end of this article you will be convinced that Linux is really fun. +![](https://www.ubuntukylin.com/upload/images/tl0.png) +### Command: sl (steam locomotive) +You probably know about the 'ls' command and use it a lot to view the contents of folders. However, there are times when you might spell it 'sl', how are we supposed to have some fun and not see "command not found"? +install sl +![](https://www.ubuntukylin.com/upload/images/tl1.png) +output +![](https://www.ubuntukylin.com/upload/images/tl2.png) +![](https://www.ubuntukylin.com/upload/images/t13.png) +This command also works when you type 'LS' instead of 'ls'. + +### Command: telnet + +No! No! ! It's not as complicated as it usually is. You are probably familiar with telnet. Telnet is a textual two-way network protocol. Nothing needs to be installed here. All you need is a Linux system and a connected network. +![](https://www.ubuntukylin.com/upload/images/t14.png) +![](https://www.ubuntukylin.com/upload/images/tl5.png) + +### Command: fortune + +Try your unknown luck, there are sometimes fun things in the terminal. + +install fortune +![](https://www.ubuntukylin.com/upload/images/tl6.png) + +### Command: rev (reverse) + +It will reverse every string passed to it, isn't it fun. +![](https://www.ubuntukylin.com/upload/images/tl7.png) + +### Command: factor + +Time to talk a bit about Mathematics, this command outputs all the factors of a given number. + +![](https://www.ubuntukylin.com/upload/images/tl8.png) + +### Command: script + +Ok, this is not a command, but a script, a very interesting script. + +![](https://www.ubuntukylin.com/upload/images/tl9.png) + +### Command: Cowsay + +A little cow made up of ASCII codes in the terminal, this little cow will say what you want it to say. + +Install Cowsay +![](https://www.ubuntukylin.com/upload/images/tl10.png) + +output + +![](https://www.ubuntukylin.com/upload/images/tl11.png) + +What if you piped the 'fortune command' command to cowsay? + +root@tecmint:~# fortune | cowsay + +![](https://www.ubuntukylin.com/upload/images/tl12.png) + +Tip: '|' is the pipeline command character. Usually it takes the output of one command as input to the next command. In the above example the output of 'fortune' is used as the output of the 'cowsay' command. Pipeline commands are often used in scripting and programming. + +xcowsay is a graphical interface program. It is similar to cowsay but expressed in a graphic way, so it can be said to be the X version of cowsay. + +![](https://www.ubuntukylin.com/upload/images/tl13.png) + +output + +![](https://www.ubuntukylin.com/upload/images/tl14.png) + +![](https://www.ubuntukylin.com/upload/images/tl15.png) + +cowthink is another command. Run "cowthink Linux is sooo funny" to see how it differs from cowsay. +![](https://www.ubuntukylin.com/upload/images/tl16.png) + +output + +![](https://www.ubuntukylin.com/upload/images/tl17.png) + +### command: yes + +yes is a very interesting and useful command, especially for scripters and system administrators, which can automatically generate a predefined response or pass it to the terminal. + +![](https://www.ubuntukylin.com/upload/images/tl18.png) + +Tip: (doesn't stop until you press ctrl+c) + +### command: toilet + +What? Are you kidding me! Of course not, but sure the name of this command is crazy and I don't know where the name of this command came from. + +install toilet + +![](https://www.ubuntukylin.com/upload/images/tl19.png) + +output + +![](https://www.ubuntukylin.com/upload/images/tl20.png) + +This command even offers some color and font formatting. + +![](https://www.ubuntukylin.com/upload/images/tl21.png) + +Tip: Figlet is another command that produces similar effects to toilet. + +### Command: cmatrix + +You may have watched too much of the Hollywood movie 'The Matrix' and reveled in the ability given to Neo to see anything in the Matrix, or you may have imagined a vivid image of a desktop similar to 'Hacker'. + +install cmatrix + +![](https://www.ubuntukylin.com/upload/images/tl23.png) + +output + +![](https://www.ubuntukylin.com/upload/images/tl24.png) + +### Command: oneko + +Maybe you firmly believe that the Linux mouse pointer is always the same black or white and not vivid at all, then you are wrong. "oneko" is a software package that makes a "Jerry" your mouse pointer attach to your mouse. + +install oneko + +![](https://www.ubuntukylin.com/upload/images/tl25(1).png) + +output + +![](https://www.ubuntukylin.com/upload/images/tl26.png) + +![](https://www.ubuntukylin.com/upload/images/tl27.png) + +Tip: When the terminal running oneko is closed, Jerry will also disappear, and when the terminal is restarted, the project will not appear again. You can add this program to your startup options and continue using it. + +### Fork Bomb + +This is a very under-drawn piece of code. You are responsible for the consequences of running this command. This command is actually a fork bomb, it will multiply itself exponentially until all system resources are used or the system hangs (you can try this command once if you want to see the power of this command, but you will do so at your own risk, remember Close and save all other programs and files before running it). + +![](https://www.ubuntukylin.com/upload/images/tl28.png) + +### Command: while + +The "while" command below is a script that will give you the date and files in color until you hit the interrupt key (ctrl+c). Copy and paste this command into your terminal. + +![](https://www.ubuntukylin.com/upload/images/tl29.png) + +![](https://www.ubuntukylin.com/upload/images/tl30.png) + +Tip: The above script with the following modification will produce similar output but a bit different, try it in your terminal. + +![](https://www.ubuntukylin.com/upload/images/tl31.png) + +### Command: espeak + +Turn up the volume of your multimedia speakers to the maximum, and then copy this command to your terminal to see your reaction when you hear the voice of God. + +install espeak + +![](https://www.ubuntukylin.com/upload/images/tl32.png) + +output + +![](https://www.ubuntukylin.com/upload/images/tl33.png) + +### Command: aafire + +How about setting a fire on your terminal. Type this "aafire" into your terminal, no quotes needed to see the magic. Press any key to middle point to the program. + +install aafire + +![](https://www.ubuntukylin.com/upload/images/tl34.png) + +output + +![](https://www.ubuntukylin.com/upload/images/tl35.png) + + +![](https://www.ubuntukylin.com/upload/images/tl36.png) +### Command: bb + +First install "apt-get install bb", then type "bb" and see what happens. + +![](https://www.ubuntukylin.com/upload/images/tl37.png) + +![](https://www.ubuntukylin.com/upload/images/tl38.png) + +### command: url + +Wouldn't it be cool to use the command line to change your twitter status in front of your friends? Just replace username, password and "your status message" with your username password and your desired status respectively. + +![](https://www.ubuntukylin.com/upload/images/tl39.png) + +###ASCIIquarium + +What should I do if I want to make an aquarium in the terminal? + +![](https://www.ubuntukylin.com/upload/images/tl40.png) + +### Install ASCIIquarium + +Download and install ASCIIquarium. + +![](https://www.ubuntukylin.com/upload/images/tl41.png) + +Finally, run "asciiquarium" or "/usr/local/bin/asciiquarium" in the terminal, remember not to add quotation marks, and a magical scene will be displayed in front of your eyes. + +![](https://www.ubuntukylin.com/upload/images/tl42.png) + +![](https://www.ubuntukylin.com/upload/images/tl43.png) +### Command: funny manpages +First install "apt-get install funny-manpages" and then run the man page of the following command. some of them + +![](https://www.ubuntukylin.com/upload/images/tl44.png) + +### Linux Tweaks +Time to do some optimization + +![](https://www.ubuntukylin.com/upload/images/tl45.png) + +Linux is always sexy: who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep (sweat, if you know what I mean!) + +There are some other commands, but these commands do not work on all systems, so this article does not cover them. For example, dog, filter, banner + +Happy using, you can say thank you to me later :) + + + + + + + + + diff --git a/en/Development-And-Common-Documents/Novice-Must-See/Linux_Must_Master_Basic_Commands.md b/en/Development-And-Common-Documents/Novice-Must-See/Linux_Must_Master_Basic_Commands.md new file mode 100644 index 0000000000000000000000000000000000000000..8c08c9032081ed88f0f21575c5b7ac44d7aeaf48 --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/Linux_Must_Master_Basic_Commands.md @@ -0,0 +1,47 @@ +#
In Linux, you must master the basic network commands!
+####
Author: Little K
+####
2022-04-22 23:36:00
+ + +Whether you are an aspiring Linux system administrator or a Linux fanatic, you must understand these basic and important Linux network commands! + +In the process of learning Linux, everyone will pay great attention to the use of the command line, and must have read a lot of books to learn. In today's article, I (Note: The author is Abhishek Prakash) will summarize the network command set that helped me get high scores in the course of computer network engineering. Everyone is welcome to take out the cheat sheet and jot it down, I hope it will be useful to you too. + +### Network Connectivity +Ping: Send an ICMP echo request message to the host, which lasts until you press Ctrl+C. Ping means that a packet is sent from your machine via ICMP, and then gets a response at the IP layer. Ping can detect whether you are connected to another host. +Telnet host: Interact with the host on the specified port. The telnet port is 23 by default. Other commonly used ports are loopback port 7, which is used to send mail, SMTP 25, and user query 79. Use Ctrl+] to exit telnet. + +### ARP +ARP is used to translate IP addresses into Ethernet addresses. Root users can add/delete ARP entries. Among them, ARP entries are cached in the kernel, and will be automatically deleted after 20 minutes. But the root user can create permanent ARP entries. +arp -a: print ARP table +arp -s[pub]: Add entry +arp -a -d: delete all entries + +### Routing +netstat -r: Print the routing table. The routing table is stored in the kernel, and ip uses it to send packets to the external network. +routed: A BSD daemon that performs dynamic routing. Implement the RIP routing protocol. Can only be used with root privileges. +gated: gated is another routing daemon that implements RIP. Use OSPF/EGP/RIP at the same time. Can only be used with root privileges. +traceroute: It can be used to trace the routing information of IP packets. +netstat -rnf inet: Displays the routing table for IPv4. +sysctl net.inet.ip.forwarding=1: Make packets forward (turn a host into a route). +route: The route command is used to set a static route in the routing table. All information from PC to IP/SubNet goes through the specified gateway IP. This command can also be used to set the default route. +route add|delete [-net|-host]: Add/delete static routes (eg: route add 192.168.20.0/24 192.168.30.4). +route flush: delete all routes. +route add -net 0.0.0.0 192.168.10.2: Add a default route. + +### Important Documents +/etc/hosts: IP address and name +/etc/networks: IP address and network name +/etc/protocols: protocol number and protocol name +/etc/services: the port number corresponding to the tcp/udp service name + +### Tools and network performance analysis +ifconfig[up]: open the interface +ifconfig[down|delete]: stop interface +tcpdump -i -vvv: A tool for grabbing and analyzing packets +netstat -w [seconds] -l [interface]: display network settings and data + +### other +nslookup: Converts IPs to names, or names to IPs, by querying a DNS server. For example, nslookup ubuntukylin.com will get the IP address of ubuntukylin.com. +ftp: transfer files between local host and remote host. +rlogin: log in to the host remotely. \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/Linux_Novice_Gift_Pack.md b/en/Development-And-Common-Documents/Novice-Must-See/Linux_Novice_Gift_Pack.md new file mode 100644 index 0000000000000000000000000000000000000000..b60e102380723b6cbaf9f3cbfddf32bb54232d4b --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/Linux_Novice_Gift_Pack.md @@ -0,0 +1,94 @@ +#
Linux novice gift package: those things you must know to learn Linux
+####
Author: Little K
+####
2022-04-22 23:36:00
+the +Welcome to join the Linux family! For you, this may still be an unfamiliar field, but I believe that with a gradual and in-depth understanding, you will like Linux and open source! First of all, let's take a look at what Linux novice should pay attention to and understand! + +### 1. Know a few big cows + +Linus Torvalds +Born on December 28, 1969 in Helsinki, Finland, he has American citizenship. He is the earliest author of the Linux kernel, then initiated this open source project, served as the chief architect and project coordinator of the Linux kernel, and is one of the most famous computer programmers and hackers in the world today. He also initiated the Git open source project and is the main developer. + +Richard Matthew Stallman +Referred to as RMS, born on March 16, 1953, the spiritual leader of the American Free Software Movement, the founder of the GNU Project and the Free Software Foundation. As a well-known hacker, his main achievements include Emacs and later GNU Emacs, GNU C compiler and GDB debugger. The GNU General Public License he wrote is the most widely used free software license in the world, opening up a new path for the Copyleft concept. + +Eric Steven Raymond +Born on December 4, 1957, programmer, author of "Cathedral and Bazaar", maintainer of "New Hacker Dictionary" ("Jargon File"), and famous hacker. As the main editor and maintainer of "The New Hacker's Dictionary", Raymond has long been regarded as a historian and anthropologist of hacker culture. But after 1997, Raymond was widely recognized as one of the main leaders of the open source movement and the most widely known (and most controversial) hacker. + +### 2. Get to know the star members of the Linux family +**Red Hat Enterprise Linux**: Red Hat Enterprise Linux is the Red Hat Corporation's Linux distribution for the commercial market, including mainframes. Red Hat provides 10-year support for each version of the enterprise version of LINUX starting from Red Hat Enterprise Linux 5. Red Hat Enterprise Linux is often abbreviated as RHEL. Red Hat Enterprise Linux releases a new version about every 3 years. + +**Fedora Linux**: Fedora Linux is one of the better known Linux distributions. It is a free operating system with complete functions and fast updates. For the sponsor, Red Hat, it is a test bed for many new technologies that are considered available and will eventually be added to Red Hat Enterprise Linux. + +**Centos**: The full name of CentOS is "Community Enterprise Operating System", which is one of the Linux distributions. It is compiled from the source code released by Red Hat Enterprise Linux in accordance with the open source code regulations. become. Because it comes from the same source code, some servers that require high stability use CentOS instead of the commercial version of Red Hat Enterprise Linux. The difference between the two is that CentOS does not contain closed source software. CentOS' major modification to the upstream code is to unload trademarks that are not free to use. + +**Ubuntu**: Ubuntu is a GNU/Linux operating system mainly based on desktop applications. Its name comes from the word "Ubuntu" in Zulu or Hausa in southern Africa, which means "humanity". Ubuntu is based on the Debian distribution, which differs from Debian in that it releases a new version every 6 months. + +**SUSE Linux**: SUSE is one of the distributions of the Linux operating system and a distribution in Germany. SUSE Linux is currently focused on the enterprise market. + +**openSUSE**: openSUSE is an open community project, known as "the most beautiful Linux distribution". + +**Debian**: Debian is a free operating system, full name Debian GNU/Linux, maintained by the Debian Project (Debian Project), Debian is an operating environment purely composed of free software. + +**Archlinux**: Arch Linux (or Arch) is a Linux distribution designed with lightweight and concise design. Its development team adheres to the design tenet of simplicity, elegance, correctness and minimal code. The Arch Linux project was inspired by CRUX and started in 2002 by Judd Vinet. + +For more Linux versions, please see here: [Linux system family tree](https://code.csdn.net/groups/7587/discources/935281) + +### 3. Linux basic books that beginners must read +To learn Linux well, you need at least: a good introductory textbook, a linux instruction reference manual, a linux system management manual, and a book explaining the principles of linux systems. Here are a few well-recognized books we recommend: +* ["Brother Bird's Linux Private Kitchen Basic Learning Chapter"](https://book.douban.com/subject/4889838/) by Brother Bird; People's Posts and Telecommunications Press +* ["Brother Bird's Linux Private Kitchen Server Setup"](https://book.douban.com/subject/10794788/) by Brother Bird; Machinery Industry Press +* ["Linux Commands, Editors and Shell Programming"](https://book.douban.com/subject/25750712/) [US] Sobell M.G.; Tsinghua University Press +* ["Linux Device Drivers"](https://book.douban.com/subject/1723151/) by Coppert; China Electric Power Publishing House +* ["In-depth understanding of the Linux kernel"](https://book.douban.com/subject/2287506/) (USA) Bowei, Xister; China Electric Power Publishing House +* ["Advanced Programming in UNIX Environment"](https://book.douban.com/subject/1788421/) W.Richard Stevens / Stephen A.Rago; People's Posts and Telecommunications Press + +### 4. Familiar with Linux common commands + + * man: Whenever you feel unsure about a command line, you can enter "man + command" to find out exactly what the command can do. + * ls: List directory contents. + * pwd : Display the full path of the current working directory in the terminal. + * cd: To change the directory you are currently in. + * mkdir: Create a new directory. + * cp: Copy files/rename files. + * mv: Move files. + * find and locate: Search for files. + * kill: Quickly close a process. + * passwd: Change password. + * md5sum: calculate and verify MD5 information signature + * history : Query history commands. + * sudo: (super user do) command allows authorized users to execute commands of super users or other users. + * touch : Create a new file, or update the file's access and modification time to the current time. + * chmod: Modify the access permissions of the file. + * chown: Change the file owner and user group. + * apt: APT is an advanced package manager developed for Debian series systems (Ubuntu, Kubuntu, etc.). On Gnu/Linux systems, it will automatically and intelligently search, install, upgrade and resolve dependency issues for packages. + +### 5. Beware of several mistakes that novices often make +**DO NOT LOGIN AS ROOT**: It's a Unix convention, don't run anything as root unless you have to. + +**File naming confusion**: Avoid using special characters such as dollar signs ($), brackets, and percent signs (%), which have special meaning to the shell and may cause conflicts. Avoid spaces, don't use invalid characters, "/" is special for the root directory. + +**All files are mixed together**: Put the Home directory on a separate partition, so that you can reinstall the system or even upgrade your entire version without losing your data and personal settings. + +**Trying to click to run .exe files**: Unless you have WINE installed, double-clicking those .exe files does nothing. New users need to know that both Linux and Windows will only run applications developed for their own systems. + +**Send OpenOffice documents to Microsoft Office users in the default format**: Microsoft products are not very friendly to other operating systems and other applications. Many new Linux users often have trouble sharing files with friends because the other party It is not possible to read the file format they share, so new Linux users should pay attention to the format in which the files are stored to ensure that they can be opened by similar applications from Microsoft. + +**Ignore Updates**: New updates may patch some new vulnerabilities. Maintaining updates can create the divide between a vulnerable system and a secure one. Linux security comes from constant maintenance. + +The above are some errors in operating habits, as well as some technical errors, you can check "Avoid Common Errors in UNIX and Linux" + +### 6. Often visit some Linux communities and websites +Domestic professional Linux website +[ChinaUnix](https://www.chinaunix.net/): Founded in 2001, it is an open source technology community mainly discussing Linux/Unix-like operating system technology, software development technology, database technology and network application technology website. + +[LinuxCN](https://linux.cn/): Linux China is a community focusing on Chinese Linux technology and information, where you can get first-hand Linux information and technical knowledge. + +Famous foreign Linux website +[Linux Online](https://www.linux.org/): The most authoritative Linux website, with articles and discussions covering everything, including software and hardware. + +[Linux International](https://li.org/): Has an extensive list of Linux resources. + +[Linux](https://www.linux.com/): The best website to learn Linux, and also the gathering place for Linux experience. + +[Linuxforums](https://www.linuxforums.org/): A comprehensive website that provides Linux software resources, Linux forums, information on Linux server distributions, and LINUX articles and tutorials. \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/OpenKylin_Novice_User_Guide.md b/en/Development-And-Common-Documents/Novice-Must-See/OpenKylin_Novice_User_Guide.md new file mode 100644 index 0000000000000000000000000000000000000000..46bdaba97bd6988bdcd50ef9123b7ff84dc2e0be --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/OpenKylin_Novice_User_Guide.md @@ -0,0 +1,162 @@ +**Author: secretly** + + **Time: February 28, 2023** + +# OpenKylin Novice User Guide + +### 1. System update + +We use the shortcut key Ctrl + Alt + T to open the terminal and enter the following command to complete the system update. + +```shell +sudo apt update +sudo apt upgrade +``` +### 2. The pointer on the touchpad moves slowly, how to adjust it? + +We use the shortcut key Win + I to open the center, and find the `touchpad` function in `devices`. + +Click the pointer speed status bar in the right panel, and we can keep trying the moving speed until the speed is adjusted to suit our habits. + +![Enter image description](./assets/OpenKylin_user_guide/mouse_speed_set.png) + +### 3. Commonly used shortcut keys in the system + +![Enter picture description](./assets/OpenKylin_user_guide/systemhotkey.png) + +### 4. Screenshot shortcut keys + +![Enter picture description](./assets/OpenKylin_user_guide/jietu_hotkey.png) + +### 5. Enable ssh login + +- **Install openssh-server** + +```shell +sudo apt install openssh-server -y +``` +- **Modify configuration file `ssh_config`** + +```shell +sudo vi /etc/ssh/ssh_config +``` + +>Find `# PasswordAuthentication yes`, delete the # in front, save and exit + +![Enter picture description](./assets/OpenKylin_user_guide/vi_ssh_config.png) + +- **restart ssh service** + +```shell +sudo service sshd restart +``` + +- **view ip address** + +```shell +ifconfig +or +ip address +``` + +![ifconfig view ip address](./assets/OpenKylin_user_guide/ifconfig01.png) + +- **ssh remote login** + +We access through the ssh login command in the windows terminal + +```cmd +# Example ssh account name@IP address +ssh anan@192.168.124.82 +``` + +![Enter picture description](./assets/OpenKylin_user_guide/ssh_link_openkylin.png) + +### 6. Apt software installation command + +The execution of the apt command requires super administrator privileges (root), so you need to add the `sudo` command in front of it + +```shell +# install software +sudo apt install package +# Uninstall software +sudo apt remove package +# update software +sudo apt upgrade +# For example +sudo apt install openssh-server +sudo apt install putty +``` +- **Detailed command parameters** + +```shell +apt[] + list - list packages by name + search - search package descriptions + show - show package details + install - Install a package + reinstall - reinstall a package + remove - remove a package + autoremove - remove all automatically installed packages that are no longer in use + update - update the list of available packages + upgrade - update the system by installing/upgrading software + full-upgrade - Update system by uninstall/install/upgrade + edit-sources - Edit software source information files + satisfy - Satisfy the system with dependency strings +``` + +- **Detailed help can be viewed by command** + +```shell +apt -h +``` + +### 7. wget download command + +wget is a free tool for automatically downloading files from the Internet, and supports downloading through the three most common TCP/IP protocols: HTTP, HTTPS, and FTP. + +For programs or packages that have provided download paths on the Internet, we can download them through the wget command, which is most commonly used for downloading deb packages. + +- **Usage:** + +```shell +wget [option arguments]... [Url]..... +``` + +- **Example:** + +```shell +example +wget http://www.xxx.com/download/putty.deb +``` + +- **Detailed help can be viewed by command** + +```shell +wget -h +``` + +### 8. dpkg installation command + +Software installation command dpkg + +dpkg is a debian package management tool, which can install, uninstall, obtain information and other operations on packages in deb format. + +- **Usage:** + +```shell +dpkg -i package_file +dpkg --install package_file +``` +- **Example:** + +```shell +# Connect to the putty.deb file downloaded from the previous example +dpkg -i putty.deb +``` + +- **Detailed help can be viewed by command** + +```shell +dpkg --help +``` \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/Openkylin_Through_New_Bing.md b/en/Development-And-Common-Documents/Novice-Must-See/Openkylin_Through_New_Bing.md new file mode 100644 index 0000000000000000000000000000000000000000..f935e2b9f5e174392c334669ab25b2e72791bbf2 --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/Openkylin_Through_New_Bing.md @@ -0,0 +1,30 @@ +#
Tune openKylin OS through New Bing/chatGPT
+####
Author: Gary
+####
2023-03-10 13:36:00
+ + + +### What is openKylin OS? + +![Image](./assets/chatGPT_openKylin/了解OPenKylin.png) + +### Install openKylin OS +![image](./assets/chatGPT_openKylin/安装OpenKylin.png) + +### Create USB drive for openKylin OS +![Image](./assets/chatGPT_openKylin/USB驱动安装.png) + + +### Features of openKylin OS + + +![Image](./assets/chatGPT_openKylin/WorkWithKylin.png) + + +### Coding with openKylin OS + +![image](./assets/chatGPT_openKylin/coding.png) + +### Install pip on openKylin OS + +![image](./assets/chatGPT_openKylin/安装py.png) \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/View_Linux_System_Information.md b/en/Development-And-Common-Documents/Novice-Must-See/View_Linux_System_Information.md new file mode 100644 index 0000000000000000000000000000000000000000..3b2c8f787fdb5940ad1c4ccdc7d9bca6e1fd49e3 --- /dev/null +++ b/en/Development-And-Common-Documents/Novice-Must-See/View_Linux_System_Information.md @@ -0,0 +1,121 @@ +#
Check the summary of commands related to linux system
+####
Author: Hua Tsai
+####
2023-3-10 10:39:00
+ +The linux command to view system information is the basic knowledge necessary for linux beginners. Usually before carrying out the development work, you need to know the system information, so it is necessary to know the relevant command information in linux. +The following are classified according to different functions and provide the commonly used commands for querying system information in each Linux distribution. You can refer to them. + +## 1. Kernel related commands + +### (1) Check the Linux kernel version command +1. cat /proc/version +2. uname -a + +### (2) List loaded kernel modules +lsmod + + +## 2. System version related commands + +### (1) Check the Linux system version command +1. lsb_release -a +2. cat /etc/redhat-release (Note: only suitable for Redhat Linux), +3. cat /etc/issue + +### (2) Check the operating system version + head -n 1 /etc/issue + ### (3) View CPU information + cat /proc/cpuinfo + ### (4) View system running time, number of users, load + uptime + + ## 3. View process and service related commands +### (1) View all processes +ps -ef +### (2) List all system services +chkconfig –list +### (3) List all started system service programs +chkconfig –list | grep on +### (4) Real-time display process status user +top +### (5) Query process information according to PID +ps -f -p +### (6) View port occupation process +lsof -i: + + +## Four, view system user related commands + ### (1) View the specified user information +id +### (2) View user login log + last +### (3) View all users of the system +cut -d: -f1 /etc/passwd +### (4) View all groups in the system +cut -d: -f1 /etc/group + + +## 5. Query external device commands + +### (1) List all PCI devices +lspci -tv + +### (2) List all USB devices +lsusb -tv +### (3) View the IDE device detection status network at startup + dmesg | grep IDE +### (4) Check the computer name + hostname + ### (5) View hardware information + 1. lshw + 2. lshw -short + 3. dmidecode + + +## Six, system disk related query commands +### (1) View memory usage and swap area usage + free -m +### (2) View the usage of each partition + df -h +### (3) View the size of the specified directory +du -sh +### (4) View the total amount of memory +grep MemTotal /proc/meminfo +### (5) View the amount of free memory + grep MemFree /proc/meminfo +### (6) View system load disks and partitions +cat /proc/loadavg +### (7) View the mounted partition status + mount | column -t +### (8) View all partitions + fdisk -l +### (9) View all swap partitions + swapon -s +### (10) View disk parameters (only for IDE devices) +hdparm -i /dev/hda + +## Seven, query network related information + +### (1) View the properties of all network interfaces +ifconfig +### (2) View firewall settings + iptables -L +### (3) Check the routing table + route-n +### (4) View all listening ports + netstat -lntp +### (5) View all established connections +netstat -antp +### (6) Check the process of network statistics +netstat -s + +## 8. Use scp to copy files between different machines + +### (1) Remotely copy a single file from the local to the target host +scp local_file remote_username@remote_ip:remote_folder +### (2) Remotely copy the folder from the local to the target host +scp -r local_folder remote_username@remote_ip:remote_folder +### (3) Copy a single file from the remote host to the local +scp remote_username@remote_ip:remote_folder/remote_file local_folder +### (4) Copy the folder from the remote host to the local +scp -r remote_username@remote_ip:remote_folder local_folder \ No newline at end of file diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/.keep b/en/Development-And-Common-Documents/Novice-Must-See/assets/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/.keep b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/ifconfig01.png b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/ifconfig01.png new file mode 100644 index 0000000000000000000000000000000000000000..7728a0f115c4a9ba271f9b7f63f3933ddc53d5e0 Binary files /dev/null and b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/ifconfig01.png differ diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/jietu_hotkey.png b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/jietu_hotkey.png new file mode 100644 index 0000000000000000000000000000000000000000..1e29e6580c628e50d058cd9540a50df6bda09f3d Binary files /dev/null and b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/jietu_hotkey.png differ diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/mouse_speed_set.png b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/mouse_speed_set.png new file mode 100644 index 0000000000000000000000000000000000000000..816c21c42ff6ad68d9acb6661edc10adb3863a56 Binary files /dev/null and b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/mouse_speed_set.png differ diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/ssh_link_openkylin.png b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/ssh_link_openkylin.png new file mode 100644 index 0000000000000000000000000000000000000000..7fc11ee9a2cd76469bbf759216d6e25e8f566f15 Binary files /dev/null and b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/ssh_link_openkylin.png differ diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/systemhotkey.png b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/systemhotkey.png new file mode 100644 index 0000000000000000000000000000000000000000..9ec6bdaa03b9ba7d3c7acf94319ca5ef8d362d54 Binary files /dev/null and b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/systemhotkey.png differ diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/vi_ssh_config.png b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/vi_ssh_config.png new file mode 100644 index 0000000000000000000000000000000000000000..15669fac81d52f9d8ab3717d3599a858e691c5cb Binary files /dev/null and b/en/Development-And-Common-Documents/Novice-Must-See/assets/OpenKylin_user_guide/vi_ssh_config.png differ diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/.keep b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git "a/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/USB\351\251\261\345\212\250\345\256\211\350\243\205.png" "b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/USB\351\251\261\345\212\250\345\256\211\350\243\205.png" new file mode 100644 index 0000000000000000000000000000000000000000..bf5558ba71c06d87a3f443644c1fc3ae8dfae432 Binary files /dev/null and "b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/USB\351\251\261\345\212\250\345\256\211\350\243\205.png" differ diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/WorkWithKylin.png b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/WorkWithKylin.png new file mode 100644 index 0000000000000000000000000000000000000000..390a0740442d20ce1e83fb7f769ddd63458a98b9 Binary files /dev/null and b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/WorkWithKylin.png differ diff --git a/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/coding.png b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/coding.png new file mode 100644 index 0000000000000000000000000000000000000000..9f663d7c066cf61b959b7e9df3441781b1c4fc6c Binary files /dev/null and b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/coding.png differ diff --git "a/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\344\272\206\350\247\243OPenKylin.png" "b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\344\272\206\350\247\243OPenKylin.png" new file mode 100644 index 0000000000000000000000000000000000000000..2ede08b36299320eb65c2a8518db133ef48a511e Binary files /dev/null and "b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\344\272\206\350\247\243OPenKylin.png" differ diff --git "a/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\345\256\211\350\243\205OpenKylin.png" "b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\345\256\211\350\243\205OpenKylin.png" new file mode 100644 index 0000000000000000000000000000000000000000..3d10e9c2439ff79acc887cd8dbd30fd9b8e0d2e8 Binary files /dev/null and "b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\345\256\211\350\243\205OpenKylin.png" differ diff --git "a/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\345\256\211\350\243\205py.png" "b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\345\256\211\350\243\205py.png" new file mode 100644 index 0000000000000000000000000000000000000000..26717c0fc37a28d81108b210995130fd6ba77a8e Binary files /dev/null and "b/en/Development-And-Common-Documents/Novice-Must-See/assets/chatGPT_openKylin/\345\256\211\350\243\205py.png" differ diff --git a/en/Development-And-Common-Documents/Wireless_Onetwork_Card_Support.md b/en/Development-And-Common-Documents/Wireless_Onetwork_Card_Support.md new file mode 100644 index 0000000000000000000000000000000000000000..075e6d09f784440c8558ebdec8c7f23bb8f4d317 --- /dev/null +++ b/en/Development-And-Common-Documents/Wireless_Onetwork_Card_Support.md @@ -0,0 +1,191 @@ +#
Wireless network card support
+####
Author: Little K
+####
2022-04-22 23:36:00
+ + + + +## WifiDocs/WirelessCardsSupported (supported wireless cards) + +If you're buying a new computer, it's best to choose one with a wireless component designed for free software like Linux. Network cards designed for freeware will give you better support. Devices compatible with the free software will also work out of the box. + +1. Currently [ThinkPenguin.com](http://thinkpenguin.com/) provides an 802.11N USB card with AR9170 chipset, which can guarantee the compatibility of free software. Also, there are MiniPCI wifi cards for laptops and USB bluetooth adapters to connect bluetooth wireless devices. +2. [Passys](http://www.passys.nl/wirelessnetwork) sells PCI cards that are compatible with Linux (though not freeware) and are suitable for desktop computers. +3. [Wikipedia](http://en.wikipedia.org/wiki/Comparison_of_open_source_wireless_drivers) has more information on which chipsets and drivers are freeware compatible. +4. Some other cards are also compatible with Linux, but not free software. These usually work, but may not work in some cases. + +Even if your wireless card doesn't have a driver designed for Ubuntu, you can use [NDISWrapper](http://ndiswrapper.sourceforge.net/) and a driver for Microsoft Windows to make it work. But this comes at the expense of functionality and reliability. If you use this method, your internet connection is likely to be unstable. + +Other Ubuntu wireless networking wiki pages. + +1.[Wifi information center page](https://help.ubuntu.com/community/WifiDocs) +2. [WifiDocs/WirelessTroubleShootingGuide (Wireless Troubleshooting Guide)](https://help.ubuntu.com/community/WifiDocs/WirelessTroubleShootingGuide) +3. [Wireless Troubleshooting Procedure](https://help.ubuntu.com/community/WirelessTroubleshootingProcedure) + +### Wireless card +To determine what your wireless network card/chipset is, first determine whether it is a separate device plugged into the computer. If it is an independent USB device, open the terminal and enter the following content. + +
  • lsusb
  • + +And look for words like "wireless" to find your card type. the +For chips that are not USB chips but are included in the computer, enter the following. + +
  • lspci -v
  • + +And read the last section. + +### By Manufacturer +The community has created articles for the following manufacturers. + + + | manufacturer | NIC type | + | ---- | -------- | + | 3Com | PCMCIA、PCI、PCI、Low、Profile、USB | + | A-Link | USB | + | Accton | PCI | + | Adaptec | PCMCIA | + | Advent | PCMCIA | + | ADDON | USB | + | Airlink101 | PCMCIA、PCI、USB | + | Aptiva | USB | + | Asus | PCMCIA PCI USB | + | Atlantis Land | PCI + | AVM | USB | + | Belkin | PCMCIA PCI ExpressCard/34 USB | + | Blitzz | Cardbus | + | Broadcom | miniPCI | + | Buffalo | PCMCIA PCI USB | + | Cable & Wireless | Cardbus + | Cisco | PCMCIA Cardbus | + | Cnet | PCMCIA PCI | + | Compaq | USB | + | CompUSA/Realtek | PCI | + | Conceptronic | USB + | Dell | USB | + | Dexlan | PCMCIA | + | Digicom | USB | + | Digitus | PCMCIA PCI Unknown USB | + | D-Link | PCMCIA PCI Unknown USB | + | Edimax | PCMCIA PCI Unknown USB | + | eHome | PCMCIA | + | Encore | PCI USB | + | Gigabyte Technology | miniPCI PCI | + | Hawking | PCMCIA PCI Cardbus USB | + | HP | PCI | + | Intel | miniPCI | + | KCorp | Cardbus | + | Level One | PCMCIA | + | Linksys | PCMCIA PCI USB | + | Longshine | PCMCIA | + | Motorola | PCMCIA + | MSI | miniPCI PCI | + | MyEssentials | USB | + | Netcomm | PCI USB | + | Netcore | USB | + | Netgear | PCMCIA PCI USB | + | Novatech | USB | + | Orient | USB | + | Pheenet | USB | + | Proxim/Orinoco | PCMCIA PCI | + | Qualcomm Atheros | miniPCI | + | RealTek | PCI USB | + | RetailPlus | USB | + | Rosewill | USB | + | Sierra | USB | + | Sitecom | PCMCIA PCI | + | SMC | PCMCIA PCI USB | + | Sonnet | PCMCIA | + | Sweex | PCMCIA PCI USB | + | Topcom | PCMCIA | + | TP-Link | PCMCIA PCI USB | + | Trendnet | PCMCIA PCI USB | + | Trust | Unknown | + | US Robotics | PCMCIA USB | + | Veho | USB | + | Westell | USB | + | Zonet | PCMCIA PCI USB | + | Zyxel | PCMCIA PCI USB | + | Various | miniPCI USB | + + +### By version +Please refer to this page. [WifiDocs/WirelessCardsByVersion (wireless cards are classified by version)](https://help.ubuntu.com/community/WifiDocs/WirelessCardsByVersion) + +### By NIC + +1.[WifiDocs/Device](https://help.ubuntu.com/community/WifiDocs/Device) +2.[WifiDocs/Device/ADDON_ADD-GWP110](https://help.ubuntu.com/community/WifiDocs/Device/ADDON_ADD-GWP110) +3.[WifiDocs/Device/AR5006EG](https://help.ubuntu.com/community/WifiDocs/Device/AR5006EG) +4.[WifiDocs/Device/AR5007](https://help.ubuntu.com/community/WifiDocs/Device/Actiontec) +5.[WifiDocs/Device/Actiontec](https://help.ubuntu.com/community/WifiDocs/Device/Actiontec) +6.[WifiDocs/Device/Airlink101_AWLL3026](https://help.ubuntu.com/community/WifiDocs/Device/Airlink101_AWLL3026) +7.[WifiDocs/Device/AirportExtreme](https://help.ubuntu.com/community/WifiDocs/Device/AirportExtreme) +8.[WifiDocs/Device/Atheros/AR9285](https://help.ubuntu.com/community/WifiDocs/Device/Atheros/AR9285) +9.[WifiDocs/Device/BCM43224 802.11a/b/g/n (rev 01)](https://help.ubuntu.com/community/WifiDocs/Device/BCM43224%20802.11a/b/g/n%20%28rev%2001%29) +10.[WifiDocs/Device/BT_Voyager_1055](https://help.ubuntu.com/community/WifiDocs/Device/BT_Voyager_1055) +11.[WifiDocs/Device/Belkin 300 N F7D2101](https://help.ubuntu.com/community/WifiDocs/Device/Belkin%20300%20N%20F7D2101) +12.[WifiDocs/Device/Belkin F5D8053](https://help.ubuntu.com/community/WifiDocs/Device/Belkin%20F5D8053) +13.[WifiDocs/Device/Belkin_F5D7050_ver_3000_(Ralink_rt73_driver)](https://help.ubuntu.com/community/WifiDocs/Device/Belkin_F5D7050_ver_3000_%28Ralink_rt73_driver%29) +14.[WifiDocs/Device/Belkin_F5D8010](https://help.ubuntu.com/community/WifiDocs/Device/Belkin_F5D8010) +15.[WifiDocs/Device/BuffaloWLIL11GUSB](https://help.ubuntu.com/community/WifiDocs/Device/BuffaloWLIL11GUSB) +16.[WifiDocs/Device/CiscoCB21AG](https://help.ubuntu.com/community/WifiDocs/Device/CiscoCB21AG) +17.[WifiDocs/Device/CompaqW200](https://help.ubuntu.com/community/WifiDocs/Device/CompaqW200) +18.[WifiDocs/Device/D-Link_WUA-1340](https://help.ubuntu.com/community/WifiDocs/Device/D-Link_WUA-1340) +19.[WifiDocs/Device/D-Link_WUA-2340](https://help.ubuntu.com/community/WifiDocs/Device/D-Link_WUA-2340) +20.[WifiDocs/Device/DWA-111](https://help.ubuntu.com/community/WifiDocs/Device/DWA-111) +21.[WifiDocs/Device/DWA-140](https://help.ubuntu.com/community/WifiDocs/Device/DWA-140) +22.[WifiDocs/Device/DWA-552](https://help.ubuntu.com/community/WifiDocs/Device/DWA-552) +23.[WifiDocs/Device/DWL-122](https://help.ubuntu.com/community/WifiDocs/Device/DWL-122) +24.[WifiDocs/Device/DWL-520vE1](https://help.ubuntu.com/community/WifiDocs/Device/DWL-520vE1) +25.[WifiDocs/Device/DWL-G122_(Rev_B)](https://help.ubuntu.com/community/WifiDocs/Device/DWL-G122_%28Rev_B%29) +26.[WifiDocs/Device/DWL-G122_(Rev_C1)](https://help.ubuntu.com/community/WifiDocs/Device/DWL-G122_%28Rev_C1%29) +27.[WifiDocs/Device/DWL-G650+](https://help.ubuntu.com/community/WifiDocs/Device/DWL-G650%2B) +28.[WifiDocs/Device/EdimaxEW7128G](https://help.ubuntu.com/community/WifiDocs/Device/EdimaxEW7128G) +29.[WifiDocs/Device/EdimaxEW7128UG]()https://help.ubuntu.com/community/WifiDocs/Device/EdimaxEW7128UG +30.[WifiDocs/Device/EnGenius EUB9603](https://help.ubuntu.com/community/WifiDocs/Device/EnGenius%20EUB9603) +31.[WifiDocs/Device/F5D7000](https://help.ubuntu.com/community/WifiDocs/Device/F5D7000) +32.[WifiDocs/Device/F5D7010](https://help.ubuntu.com/community/WifiDocs/Device/F5D7010) +33.[WifiDocs/Device/F7D2102](https://help.ubuntu.com/community/WifiDocs/Device/F7D2102) +34.[WifiDocs/Device/Fritz!WLAN_USB_Stick](https://help.ubuntu.com/community/WifiDocs/Device/Fritz%21WLAN_USB_Stick) +35.[WifiDocs/Device/ICIDU_NI-707529_150N_ PCI-E](https://help.ubuntu.com/community/WifiDocs/Device/ICIDU_NI-707529_150N_%20PCI-E) +36.[WifiDocs/Device/IntersilPrism25Wavelan](https://help.ubuntu.com/community/WifiDocs/Device/IntersilPrism25Wavelan) +37.[WifiDocs/Device/Linksys WMP600N](https://help.ubuntu.com/community/WifiDocs/Device/Linksys%20WMP600N) +38.[WifiDocs/Device/Linksys WUSB600N](https://help.ubuntu.com/community/WifiDocs/Device/Linksys%20WUSB600N) +39.[WifiDocs/Device/LinksysWPC54GS-UK](https://help.ubuntu.com/community/WifiDocs/Device/LinksysWPC54GS-UK) +40.[WifiDocs/Device/LinksysWUSB11](https://help.ubuntu.com/community/WifiDocs/Device/LinksysWUSB11) +41.[WifiDocs/Device/LinksysWUSB54GC](https://help.ubuntu.com/community/WifiDocs/Device/LinksysWUSB54GC) +42.[WifiDocs/Device/LinksysWUSB54GP](https://help.ubuntu.com/community/WifiDocs/Device/LinksysWUSB54GP) +43.[WifiDocs/Device/Linksys_WMP54GX](https://help.ubuntu.com/community/WifiDocs/Device/Linksys_WMP54GX) +44.[WifiDocs/Device/Linksys_WUSB54GS_v1_&_v2](https://help.ubuntu.com/community/WifiDocs/Device/Linksys_WUSB54GS_v1_%26_v2) +45.[WifiDocs/Device/NEXXT NW122NXT12](https://help.ubuntu.com/community/WifiDocs/Device/NEXXT%20NW122NXT12) +46.[WifiDocs/Device/NetgearMA111](https://help.ubuntu.com/community/WifiDocs/Device/NetgearMA111) +47.[WifiDocs/Device/NetgearWG111](https://help.ubuntu.com/community/WifiDocs/Device/NetgearWG111) +48.[WifiDocs/Device/Netgear_WG311_v3](https://help.ubuntu.com/community/WifiDocs/Device/Netgear_WG311_v3) +49.[WifiDocs/Device/PENGUIN80211N](https://help.ubuntu.com/community/WifiDocs/Device/PENGUIN80211N) +50.[WifiDocs/Device/Pentagram_Hornet_USB_Lite](https://help.ubuntu.com/community/WifiDocs/Device/Pentagram_Hornet_USB_Lite) +51.[WifiDocs/Device/Proxim RangeLAN-DS](https://help.ubuntu.com/community/WifiDocs/Device/Proxim%20RangeLAN-DS) +52.[WifiDocs/Device/RT3090](https://help.ubuntu.com/community/WifiDocs/Device/RT3090) +53.[WifiDocs/Device/RTL8180L](https://help.ubuntu.com/community/WifiDocs/Device/RTL8180L) +54.[WifiDocs/Device/Ralink RT5390](https://help.ubuntu.com/community/WifiDocs/Device/Ralink%20RT5390) +55.[WifiDocs/Device/RalinkRT2860](https://help.ubuntu.com/community/WifiDocs/Device/RalinkRT2860) +56.[WifiDocs/Device/Ralink_RT5370](https://help.ubuntu.com/community/WifiDocs/Device/Ralink_RT5370) +57.[WifiDocs/Device/Realtek 8172](https://help.ubuntu.com/community/WifiDocs/Device/Realtek%208172) +58.[WifiDocs/Device/RealtekRTL8187b](https://help.ubuntu.com/community/WifiDocs/Device/RealtekRTL8187b) +59.[WifiDocs/Device/Rosewill RNX-N150UBE](https://help.ubuntu.com/community/WifiDocs/Device/Rosewill%20RNX-N150UBE) +60.[WifiDocs/Device/Rosewill RNX-N2LX](https://help.ubuntu.com/community/WifiDocs/Device/Rosewill%20RNX-N2LX) +61.[WifiDocs/Device/RosewillRNXN150UBE](https://help.ubuntu.com/community/WifiDocs/Device/RosewillRNXN150UBE) +62.[WifiDocs/Device/Sabrent 802.11n Wireless PCI](https://help.ubuntu.com/community/WifiDocs/Device/Sabrent%20802.11n%20Wireless%20PCI) +63.[WifiDocs/Device/Sabrent PCI-G802](https://help.ubuntu.com/community/WifiDocs/Device/Sabrent%20PCI-G802) +64.[WifiDocs/Device/SabrentUSB-G802](https://help.ubuntu.com/community/WifiDocs/Device/SabrentUSB-G802) +65.[WifiDocs/Device/SparkLAN WL-850R](https://help.ubuntu.com/community/WifiDocs/Device/SparkLAN%20WL-850R) +66.[WifiDocs/Device/TL-WN722N](https://help.ubuntu.com/community/WifiDocs/Device/TL-WN722N) +67.[WifiDocs/Device/TP-LINK_TL-WN781ND](https://help.ubuntu.com/community/WifiDocs/Device/TP-LINK_TL-WN781ND) +68.[WifiDocs/Device/TP-Link_TL-WN620G_(ndiswrapper)](https://help.ubuntu.com/community/WifiDocs/Device/TP-Link_TL-WN620G_%28ndiswrapper%29) +69.[WifiDocs/Device/Tenda W522U USB](https://help.ubuntu.com/community/WifiDocs/Device/Tenda%20W522U%20USB) +70.[WifiDocs/Device/Tenda_W311M](https://help.ubuntu.com/community/WifiDocs/Device/Tenda_W311M) +71.[WifiDocs/Device/Topcom_Skyracer_USB_4001g_(WLAN-USB-Stick)](https://help.ubuntu.com/community/WifiDocs/Device/Topcom_Skyracer_USB_4001g_%28WLAN-USB-Stick%29) +72.[WifiDocs/Device/WG111T](https://help.ubuntu.com/community/WifiDocs/Device/WG111T) +73.[WifiDocs/Device/WG121](https://help.ubuntu.com/community/WifiDocs/Device/WG121) +74.[WifiDocs/Device/ipn2220](https://help.ubuntu.com/community/WifiDocs/Device/ipn2220) +75.[WifiDocs/Device/wpn111](https://help.ubuntu.com/community/WifiDocs/Device/wpn111) +76.[WifiDocs/Device/xg-301](https://help.ubuntu.com/community/WifiDocs/Device/xg-301) diff --git a/en/Development-And-Common-Documents/assets/KVM/image/.keep b/en/Development-And-Common-Documents/assets/KVM/image/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-bash-nm-connection-editor-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-bash-nm-connection-editor-1.png new file mode 100644 index 0000000000000000000000000000000000000000..7ccfcf542d1715f4e668c76cc9be07c1eab005f6 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-bash-nm-connection-editor-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-1.png new file mode 100644 index 0000000000000000000000000000000000000000..66a8296194e7cedf7b5947ccd35463bd4e7c86f8 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-2.png new file mode 100644 index 0000000000000000000000000000000000000000..90f0d12946bcd049388460355e2f4d6bce366729 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-3.png new file mode 100644 index 0000000000000000000000000000000000000000..7043ba42526fb445293b18ddd86f3b26d84a0710 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-4.png new file mode 100644 index 0000000000000000000000000000000000000000..1b3c75e087de0308422a8cda17acef6d38d33a8c Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-createiso-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-defaultsf-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-defaultsf-1.png new file mode 100644 index 0000000000000000000000000000000000000000..0c8ffed4f72e1cd22df225ea342ddd8f1f154569 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-defaultsf-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-desktop-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-desktop-1.png new file mode 100644 index 0000000000000000000000000000000000000000..d2cf59327066ceea264810f0f1b7f186ed26ee37 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-desktop-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-desktop-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-desktop-2.png new file mode 100644 index 0000000000000000000000000000000000000000..16ce55fb229db062020638983e8aa7237842179c Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-desktop-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-1.png new file mode 100644 index 0000000000000000000000000000000000000000..b5c071fe7ef4a809e944c511f6af08556d92d648 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-2.png new file mode 100644 index 0000000000000000000000000000000000000000..998449c62c77292bc3e8a8d2e959ec11cdc08ab6 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-3.png new file mode 100644 index 0000000000000000000000000000000000000000..e5413f8f415f35e15374394736b3a0c7cef37cc9 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-4.png new file mode 100644 index 0000000000000000000000000000000000000000..51aa9fa66f131315bb268f5ec2ac3c7cbd6005e2 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-doc-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-1.png new file mode 100644 index 0000000000000000000000000000000000000000..ea8cea61c3c1c354f0d78da5a54ff956b4fb0133 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-2.png new file mode 100644 index 0000000000000000000000000000000000000000..6bda622cd8e12bff6b78887037af97ccdbd8482c Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-3.png new file mode 100644 index 0000000000000000000000000000000000000000..ef9d049a879a67a2f26b6ad0050b6c82e858662c Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-4.png new file mode 100644 index 0000000000000000000000000000000000000000..02df031ed75ad153e3ab221bb29f11f907f32f82 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-install-dipar-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-1.png new file mode 100644 index 0000000000000000000000000000000000000000..b11265f6ca91c0c81fb4f11ccfe134663c2d229e Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-2.png new file mode 100644 index 0000000000000000000000000000000000000000..6442b606dc700377bc42e6e667939e20ebaa935a Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-3.png new file mode 100644 index 0000000000000000000000000000000000000000..333182092dfca5a42b6131cd77448e0eeacc9808 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-4.png new file mode 100644 index 0000000000000000000000000000000000000000..c1d97476204f2856e44981f575acbc7f6dc9ef7a Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-5.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-5.png new file mode 100644 index 0000000000000000000000000000000000000000..07316d51c17060f7afe2762e9825dcf0971662f5 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-openterminal-5.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-1.png new file mode 100644 index 0000000000000000000000000000000000000000..7dbb3a47102ed134157f67ac21d9b3cb779d600f Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-2.png new file mode 100644 index 0000000000000000000000000000000000000000..22acb3685c7edf62d251032f62a991051a2f4f40 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-3.png new file mode 100644 index 0000000000000000000000000000000000000000..3f58bb65a53e60ab0fd6e5de722e487473d1cc85 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osfirstfiles-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-1.png new file mode 100644 index 0000000000000000000000000000000000000000..c2c33c7dec8c5b64a241bcbcc15e3d5affb8c8de Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-2.png new file mode 100644 index 0000000000000000000000000000000000000000..f419fc62e137a2fe2586b817dc9c10af2b7a9ab7 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-3.png new file mode 100644 index 0000000000000000000000000000000000000000..11d974d1a339b0aea1f04df77ec619d2174759ae Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osinfo-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-1.png new file mode 100644 index 0000000000000000000000000000000000000000..29e53abb011a6c78d7b965607864d68a51eb7cfc Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-2.png new file mode 100644 index 0000000000000000000000000000000000000000..7f2d9b86155fea217c0b5ee132fbc878cdf95b4f Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-3.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfac30a6ba0479c08c1fa97f792a66f55290875 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-4.png new file mode 100644 index 0000000000000000000000000000000000000000..d4130f96909f4bf6b7d94a5c5e99ead23d605177 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-5.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-5.png new file mode 100644 index 0000000000000000000000000000000000000000..15eae87e8134a4112e9fbb8aeb3ca57f96324a5c Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-osmonitor-5.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-power-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-power-1.png new file mode 100644 index 0000000000000000000000000000000000000000..3c1924131099d3de4e75ff34828276c3a31d4668 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-power-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-sck-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-sck-1.png new file mode 100644 index 0000000000000000000000000000000000000000..acb2c56306c1fdc9db4ae72f03205638a0234737 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-sck-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-sck-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-sck-2.png new file mode 100644 index 0000000000000000000000000000000000000000..4e717f46444106c40f156fe81d7cfd6cd78741d4 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-sck-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-1.png new file mode 100644 index 0000000000000000000000000000000000000000..68caae18cfe2ea123f9e8e833bd31c4bdacac3bb Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-2.png new file mode 100644 index 0000000000000000000000000000000000000000..c4c56381519f9a495a6977e742a324dcf0c7460c Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-3.png new file mode 100644 index 0000000000000000000000000000000000000000..b047e3948354e811da7cf79668e93bb569cb7932 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-color-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-color-1.png new file mode 100644 index 0000000000000000000000000000000000000000..3b2e14b8a7ce57ed177d9e881bae8a70910f0aa0 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-color-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-sleep-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-sleep-1.png new file mode 100644 index 0000000000000000000000000000000000000000..e47b69ef17ae1781ad6ebbafefc81449efe8b854 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-screen-sleep-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-search-v-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-search-v-1.png new file mode 100644 index 0000000000000000000000000000000000000000..9fd73319ce210cfb5dbd06a3f5745deccda5dad5 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-search-v-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-showfilepri-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-showfilepri-1.png new file mode 100644 index 0000000000000000000000000000000000000000..35e60eb64787b06dd4910ef16ae719a2d0b8c865 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-showfilepri-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-showfilepri-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-showfilepri-2.png new file mode 100644 index 0000000000000000000000000000000000000000..86b3f1f2aed1d9e151089e1bd2bb986d6a89a1b2 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-showfilepri-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-1.png new file mode 100644 index 0000000000000000000000000000000000000000..b544a46c022dd820f69ddd3c1d468db0d53522a5 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-2.png new file mode 100644 index 0000000000000000000000000000000000000000..d5cbaaefeb6ff5c957af372f15994ad9f3ad59c7 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-3.png new file mode 100644 index 0000000000000000000000000000000000000000..a7ed609f819034d1e8c81b7b507666e873616c1d Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-4.png new file mode 100644 index 0000000000000000000000000000000000000000..2cda51cdd132d12dbaf440d8f711b709b4efbad6 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-5.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-5.png new file mode 100644 index 0000000000000000000000000000000000000000..b8f2365f3e549822cd8abc309c4d15c9eeffe12b Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-5.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-6.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-6.png new file mode 100644 index 0000000000000000000000000000000000000000..c551cd7a1941763a7b98f3c80ad4b26dc6893f9d Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-6.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-7.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-7.png new file mode 100644 index 0000000000000000000000000000000000000000..8e3d0df7367f7585683bab6c36faaa6a632a97a9 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-shownetwork-7.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-showss-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-showss-1.png new file mode 100644 index 0000000000000000000000000000000000000000..ce3b63c8eae8b9ea179a0b92c6480b510b386ae8 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-showss-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-showss-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-showss-2.png new file mode 100644 index 0000000000000000000000000000000000000000..4a7752a08d29b082487e177ccd507f491590d510 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-showss-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-ss-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-ss-1.png new file mode 100644 index 0000000000000000000000000000000000000000..1ae77644f9870ce4f8acb5ea523c07d8038c8fa0 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-ss-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-ss-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-ss-2.png new file mode 100644 index 0000000000000000000000000000000000000000..c0f3f23e053900381e8dc3798a4edef485d5b59a Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-ss-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-timeconserver-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-timeconserver-1.png new file mode 100644 index 0000000000000000000000000000000000000000..76928713444d09c96ba5a387d8a2caa8f0d0a764 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-timeconserver-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-timeconserver-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-timeconserver-2.png new file mode 100644 index 0000000000000000000000000000000000000000..f3612794d8dc593b306409030a205150c1dcfdb4 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-timeconserver-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-1.png new file mode 100644 index 0000000000000000000000000000000000000000..0c9f875c6e43a1e1fe8c0e3dc689b0733e6048c5 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-2.png new file mode 100644 index 0000000000000000000000000000000000000000..5d0fb5da49573bc112b2d22e6fc60d1a3be0cc6f Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-3.png new file mode 100644 index 0000000000000000000000000000000000000000..bb517eb46b15d9e9552ce886ac1df115861e6ad6 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-4.png new file mode 100644 index 0000000000000000000000000000000000000000..394e3100deecae0196c3dbf56fcd0fd3d51af137 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-toolshowpc-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-upanos-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-upanos-1.png new file mode 100644 index 0000000000000000000000000000000000000000..2a36d6c8b8a169166ba053103e62c0c00b75b088 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-upanos-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-user-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-1.png new file mode 100644 index 0000000000000000000000000000000000000000..ca1008d30173ca1a55eb57094980b951c4e5cc85 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-user-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-2.png new file mode 100644 index 0000000000000000000000000000000000000000..2ded84f813f5bf898d9445015621d03a7f980ef9 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-user-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-3.png new file mode 100644 index 0000000000000000000000000000000000000000..3f29de0ca017a3f5839a6f1fce4193eee97b1aaf Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-user-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-4.png new file mode 100644 index 0000000000000000000000000000000000000000..0fd692b576e19770116724936630bcb134128c51 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-user-5.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-5.png new file mode 100644 index 0000000000000000000000000000000000000000..86d86a77827bff4109e5a7dde875072ef5965c54 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-user-5.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-1.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-1.png new file mode 100644 index 0000000000000000000000000000000000000000..b6466eaba1fc1c4d44861c716e5d85e9fbc91223 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-2.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-2.png new file mode 100644 index 0000000000000000000000000000000000000000..04e8cba0c1b96a0fc5cde4a88c155899df07a1d9 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-3.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-3.png new file mode 100644 index 0000000000000000000000000000000000000000..d92cb707347e94afb82bb043d7dda1e45b5d4e4d Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-3.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-4.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-4.png new file mode 100644 index 0000000000000000000000000000000000000000..0ea728b1016beaf6f0b9f24a10c3e1d46a5c0816 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-4.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-5.png b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-5.png new file mode 100644 index 0000000000000000000000000000000000000000..d08800d9406449b6b26375acf757986fccc86ea5 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/ok-zip-5.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-1.png b/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-1.png new file mode 100644 index 0000000000000000000000000000000000000000..93cf823d892956066616d3a7bcef83f7ff1a821d Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-1.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-2.png b/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-2.png new file mode 100644 index 0000000000000000000000000000000000000000..ce322b58753606814692eae1a7464ed185b082f2 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-2.png differ diff --git a/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-3.png b/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-3.png new file mode 100644 index 0000000000000000000000000000000000000000..dfdafd0c785fea1c886bacb855a7d875449ceaa7 Binary files /dev/null and b/en/Development-And-Common-Documents/assets/KVM/image/openkylin-install-3.png differ diff --git a/openKylin b/openKylin new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391