Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 37 additions & 22 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,53 @@

DDM uses CMake to configure and build the project.

1. From the project root, create a build directory: `mkdir build`
2. From the build directory, run cmake to the project root. Eg: `cd build && cmake ..`
3. To build, run `make`.
4. To install, run `make install`.
1. From the project root, configure the build directory:
`cmake -B build`
2. To build, run `cmake --build build`.
3. To install, run `cmake --install build`.

CMake accepts a number of standard and extra arguments:

- BUILD_MAN_PAGES, pass -DBUILD_MAN_PAGES=ON to build man pages
- ENABLE_JOURNALD, pass -DENABLE_JOURNALD=OFF
to disable logging to the journal
- `BUILD_MAN_PAGES`, pass `-DBUILD_MAN_PAGES=ON` to build man pages. This
requires `rst2man` from the python `docutils` package.
- `WERROR`, pass `-DWERROR=ON` to build with `-Werror`.
- `LOGIN_DEFS_PATH`, path of `login.defs` used to autodetect `UID_MIN` and
`UID_MAX`. Defaults to `/etc/login.defs`.
- `DDM_INITIAL_VT`, the virtual terminal ddm starts on. Defaults to `1`.
- Install locations such as `CONFIG_FILE`, `CONFIG_DIR`, `SYSTEM_CONFIG_DIR`,
`STATE_DIR`, `RUNTIME_DIR`, `DATA_INSTALL_DIR`, `DBUS_CONFIG_DIR` and
`LOG_FILE` can be overridden in the same way.

By default, a debug build is created. To build for production, use
`cmake -DCMAKE_BUILD_TYPE=Release`.
By default, a `Release` build is created. To build a debug build, use
`cmake -DCMAKE_BUILD_TYPE=Debug -B build`.

To see all the possible arguments, run `cmake -L ..`.
To see all the possible arguments, run `cmake -L -B build`.
For documentation on standard CMake variables, see:
http://www.cmake.org/cmake/help/v3.0/manual/cmake-variables.7.html
https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html

### Post-installation steps

By default, DDM runs as its own user. An `ddm` user needs to be created, with
its home set to `/var/lib/ddm` by default.
DDM runs its greeter as its own user, named **dde**. The user, its group and
its home directory (`/var/lib/ddm` by default) are created by
`systemd-sysusers` from the installed `dde.conf`; the runtime and state
directories are created by `systemd-tmpfiles`. Both are installed by the
package, so on a systemd distribution no manual step is required.

DDM is started by `ddm.service`. It starts `treeland.service` for the login
screen and requires `dde-seatd.service`. Make sure all three units and the PAM
services (`ddm` and `ddm-autologin` in `/etc/pam.d`) are installed.

### Dependencies

DDM depends on PAM for authorization and XCB to communicate with the X server.
Apart from other things, it also depends on Qt for the user interface and event
loop management.
DDM can optionally make use of logind (the systemd login manager API), or
ConsoleKit2, or upower to enable support for suspend, hibernate etc.
In order to build the man pages, you will need `rst2man` installed. It is
provided by the python `docutils` package
DDM depends on PAM for authorization and on systemd-logind for opening user
sessions, and uses libxau to write X authorization files. Apart from other
things, it also depends on Qt 6 for its event loop and D-Bus communication.
It uses wayland-client and the `treeland_ddm_v1` protocol from
treeland-protocols to talk to the Treeland compositor, and dde-seatd to manage
virtual terminals.

X11 sessions additionally require an X server at runtime; the path is
configured with the `X11.ServerPath` option.

Note that DDM makes use of C++11 features for a modern and clean codebase,
therefore it needs a recent version of GCC to compile (4.7 at least).
DDM makes use of C++20 features, therefore it needs a recent version of GCC to
compile.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,65 @@
# DDM

The `ddm` project is Display Manager base `SDDM` fork.
`ddm` (Deepin Display Manager) is the display and login manager for the
[Treeland](https://github.com/linuxdeepin/treeland) Wayland compositor. It is based on [SDDM](https://github.com/sddm/sddm), but the
QtQuick greeter it inherited is gone: the login screen is drawn by Treeland
itself, and `ddm` only manages the compositor, authenticates users and starts
their desktop sessions.

See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for how the pieces fit together.

## Dependencies

Check `debian/control` for build-time and runtime dependencies, or use `cmake` to check the missing required dependencies.
Check `debian/control` for build-time and runtime dependencies, or use `cmake`
to check the missing required dependencies.

Core build dependencies:

- Qt 6 (Core, DBus, Network), version 6.6 or newer
- [treeland-protocols](https://github.com/linuxdeepin/treeland-protocols)
- PAM, libsystemd, libxau and wayland-client
- ECM (extra-cmake-modules) 1.4 or newer

Runtime dependencies:

- [treeland](https://github.com/linuxdeepin/treeland) — the greeter and, for
single-mode sessions, the compositor the user session runs in
- [dde-seatd](https://github.com/linuxdeepin/dde-seatd) — seat and virtual
terminal management
- systemd-logind, used to open user sessions

## Building

Regular CMake building steps applies, in short:
Regular CMake building steps apply, in short:

```shell
$ cmake -Bbuild
$ cmake --build build
$ cmake --install build # only do this if you know what you are doing
```

The man pages are only built with `-DBUILD_MAN_PAGES=ON`, and require `rst2man`
from the python `docutils` package.

A `debian` folder is provided to build the package under the *deepin* linux desktop distribution. To build the package, use the following command:

```shell
$ sudo apt build-dep . # install build dependencies
$ dpkg-buildpackage -uc -us -nc -b # build binary package(s)
```

## Running

`ddm` is meant to be started by its systemd unit as the display manager:

```shell
$ systemctl start ddm.service
```

It starts `treeland.service` for the login screen and requires
`dde-seatd.service`. Both units, the PAM services and the `dde` greeter user
are installed by the package.

## Getting Involved

- [Code contribution via GitHub](https://github.com/linuxdeepin/ddm/)
Expand Down
70 changes: 69 additions & 1 deletion README.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1 +1,69 @@
TODO:
# DDM

`ddm`(Deepin Display Manager)是
[Treeland](https://github.com/linuxdeepin/treeland) Wayland 合成器的显示与登录
管理器。它基于 [SDDM](https://github.com/sddm/sddm),但不再使用从
SDDM 继承的 QtQuick greeter:登录界面由 Treeland 自己绘制,`ddm` 只负责管理
合成器、认证用户并启动用户桌面会话。

各组件之间的关系参见 [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)。

## 依赖

查看 `debian/control` 了解构建时和运行时依赖,或者使用 `cmake` 检查缺失的
必要组件。

核心构建依赖:

- Qt 6(Core、DBus、Network),版本 6.6 或更高
- [treeland-protocols](https://github.com/linuxdeepin/treeland-protocols)
- PAM、libsystemd、libxau 和 wayland-client
- ECM(extra-cmake-modules)1.4 或更高

运行时依赖:

- [treeland](https://github.com/linuxdeepin/treeland) —— 提供登录界面,并在
single 模式下作为用户会话所在的合成器
- [dde-seatd](https://github.com/linuxdeepin/dde-seatd) —— seat 与虚拟终端管理
- systemd-logind —— 用于打开用户会话

## 构建

常规的 CMake 构建步骤即可,简要如下:

```shell
$ cmake -Bbuild
$ cmake --build build
$ cmake --install build # 只有明确知道后果时才执行安装
```

只有传入 `-DBUILD_MAN_PAGES=ON` 才会构建 man 手册,且需要 python `docutils`
提供的 `rst2man`。

仓库提供了 `debian` 目录用于在 *deepin* Linux 发行版下打包。构建软件包使用
以下命令:

```shell
$ sudo apt build-dep . # 安装构建依赖
$ dpkg-buildpackage -uc -us -nc -b # 构建二进制软件包
```

## 运行

`ddm` 由自身的 systemd 服务作为显示管理器启动:

```shell
$ systemctl start ddm.service
```

它会启动 `treeland.service` 以提供登录界面,并依赖 `dde-seatd.service`。
这些服务、PAM 配置以及 `dde` greeter 用户均由软件包安装。

## 参与贡献

- [通过 GitHub 贡献代码](https://github.com/linuxdeepin/ddm/)
- [在 GitHub Issues 或 GitHub Discussions 提交问题或建议](https://github.com/linuxdeepin/developer-center/issues/new/choose)

## 许可证

**ddm** 使用 GPL-2.0+ 许可证。详细信息参见 REUSE 文件。
8 changes: 5 additions & 3 deletions data/man/ddm-state.conf.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ ddm configuration
SYNOPSIS
========

~ddm/state.conf
@STATE_DIR@/state.conf

DESCRIPTION
===========

This file carries state configuration for the ddm display manager **ddm**\(1\).
It lives in the home directory of the **dde** user, which is **@STATE_DIR@**.
It is written by ddm and does not need to be edited by hand.

OPTIONS
=======
Expand All @@ -39,6 +41,6 @@ All options are configured in the [Last] section:
SEE ALSO
========

**ddm**\(1\)
**ddm**\(1\), **ddm.conf**\(5\)

The full documentation for ddm is available at https://github.com/ddm/ddm
The full documentation for ddm is available at https://github.com/linuxdeepin/ddm
42 changes: 28 additions & 14 deletions data/man/ddm.conf.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,23 @@ OPTIONS

`CursorTheme=`
Name of the cursor theme to be set before starting
the display server.
an X11 display server.

`CursorSize=`
Cursor size to be set before starting the display server.
Cursor size to be set before starting an X11 display server.

[Autologin] section:

`User=`
User to log in automatically. An empty value disables automatic login.
The user must not be the greeter user **dde**.
Default value is empty.

`Session=`
Session to load for automatic login. This overrides the last used
session. If it is empty, the session remembered in
**ddm-state.conf**\(5\) is used.
Default value is empty.

[X11] section:

Expand All @@ -82,18 +95,16 @@ OPTIONS

`SessionLogFile=`
Path to the user session log file, relative to the home directory.
Default value is ".local/share/ddm/xorg-session.log".
Default value is ".local/share/ddm/xorg-session.log".

`DisplayCommand=`
Path of script to execute when starting the display server.
The script will be executed as root when General.DisplayServer
is "x11", otherwise as ddm user.
Path of script to execute when starting the X11 display server.
The script is executed as root by the ddm daemon.
Default value is "@DATA_INSTALL_DIR@/scripts/Xsetup".

`DisplayStopCommand=`
Path of script to execute when stopping the display server.
The script will be executed as root when General.DisplayServer
is "x11", otherwise as ddm user.
Path of script to execute when stopping the X11 display server.
The script is executed as root by the ddm daemon.
Default value is "@DATA_INSTALL_DIR@/scripts/Xstop".

[Wayland] section:
Expand All @@ -115,9 +126,12 @@ OPTIONS
[Single] section:

`SessionCommand=`
Path of script to execute when starting the user session for Treeland.
This script receives the value of the "Exec" setting in the ".desktop" file
of the selected session and run it.
Path of script to execute when starting the user session for a
single-mode Treeland session (a session whose desktop file sets
X-DDE-SINGLE-WAYLAND=true). Such a session runs inside the already
running Treeland instance instead of starting its own compositor.
The script receives the value of the "Exec" setting in the ".desktop"
file of the selected session and runs it.
Default value is "@WAYLAND_SESSION_COMMAND@".

[Users] section:
Expand All @@ -142,6 +156,6 @@ OPTIONS
SEE ALSO
========

**ddm**\(1\)
**ddm**\(1\), **ddm-state.conf**\(5\)

The full documentation for ddm is available at https://github.com/ddm/ddm
The full documentation for ddm is available at https://github.com/linuxdeepin/ddm
57 changes: 34 additions & 23 deletions data/man/ddm.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,58 @@ ddm [OPTIONS...]
DESCRIPTION
===========

ddm is a display and login manager based on Qt technologies and using
Treeland as greeter.

If pam and systemd are available, the greeter will go through logind,
which will give it access to drm devices.

Distributions without pam and systemd will need to put the **ddm** user
into the **video** group, otherwise errors regarding GL and drm devices
might be experienced.

For X11 sessions, the cookie for X authorization is written into a
temporary file `/tmp/xauth_XXXXXX`, owned and only accessible by the
ddm is the Deepin Display Manager, the display and login manager for the
Treeland Wayland compositor. It authenticates users with PAM, starts their
desktop sessions and keeps the login screen running on the initial virtual
terminal.

The login screen itself is not part of ddm: it is drawn by Treeland, which ddm
starts as the **treeland.service** systemd unit. ddm talks to Treeland through
the private **treeland_ddm_v1** Wayland protocol and through a local socket,
and talks to **dde-seatd** for virtual terminal management. User sessions are
opened through systemd-logind.

X11 sessions are also supported: for those, ddm stops Treeland and starts an X
server instead. For X11 sessions, the cookie for X authorization is written
into a temporary file `/tmp/xauth_XXXXXX`, owned and only accessible by the
user.

OPTIONS
=======

--test-mode
Start daemon in test mode.

--example-config
Print the complete current configuration to stdout
Print the complete current configuration to stdout and exit.

--help, -h
Show help message and exit.

FILES
=====

**@SYSTEM_CONFIG_DIR@**
System configuration directory
**@CONFIG_FILE@**
Local configuration file.

**@CONFIG_DIR@**
Local configuration directory
Local configuration directory, has higher precedence than the
configuration file.

**@CONFIG_FILE@**
Local configuration file for compatibility
**@SYSTEM_CONFIG_DIR@**
System configuration directory, has the lowest precedence.

**@STATE_DIR@/state.conf**
State file remembering the last user and session.
See **ddm-state.conf**\(5\).

**@RUNTIME_DIR@**
Runtime directory, holds the X11 authorization file of the display
server.

**@LOG_FILE@**
Log file, used when ddm does not log to the journal.

SEE ALSO
========

**ddm.conf**\(5\)
**ddm.conf**\(5\), **ddm-state.conf**\(5\)

The full documentation for ddm is available at https://github.com/ddm/ddm
The full documentation for ddm is available at https://github.com/linuxdeepin/ddm
Loading
Loading