Install and select a session
You do not need the original CDM application, an /etc/gocdm directory, or an
external dialog executable. GoCDM includes its terminal UI and has usable defaults.
A plain go build or go install installs a binary; it does not install configuration,
themes, documentation, PAM policy or a login service.
Build the development version
Use Linux, Git and Go 1.22 or newer. A normal build requires a C compiler and PAM
development headers: libpam0g-dev on Debian/Ubuntu, or your distribution’s equivalent.
git clone --recurse-submodules https://github.com/arran4/gocdm.git
cd gocdm
go build -o build/gocdm ./cmd/gocdm
sudo install -m 0755 build/gocdm /usr/local/bin/gocdmFor a session selector without PAM build dependencies:
CGO_ENABLED=0 go build -tags=nopam -o build/gocdm-nopam ./cmd/gocdm
sudo install -m 0755 build/gocdm-nopam /usr/local/bin/gocdm-nopamSubstitute gocdm-nopam for gocdm below when using that binary. It cannot authenticate
users in direct getty mode. Install the desktops or shells you intend to launch separately.
Verify a harmless first selection
Create a configuration as your ordinary user:
mkdir -p "$HOME/.config/cdm"
cat > "$HOME/.config/cdm/first-session" <<'CONFIG'
binlist=("/bin/echo GoCDM selected this session")
namelist=("First session")
flaglist=("C")
CONFIG
gocdm -mode=user -config "$HOME/.config/cdm/first-session" -dry-runExpect Dry run: would execute console program: /bin/echo [GoCDM selected this session].
Dry-run does not launch the selected command. On an interactive terminal, repeat without
-dry-run: it prints GoCDM selected this session and returns to your shell.
To discover installed sessions, run bare gocdm from a logged-in virtual console.
No additional PAM login is performed for an ordinary user. Use -menu to show the
menu when there is only one session. Arrow keys select; Enter launches; Escape cancels.
If you see an interactive-TTY error, use a real console for session launch; use dry-run for a headless check. See troubleshooting.
Install supplemental files
From the source checkout, sudo make install installs the PAM binary plus README,
profile example, license, sample config and themes under /usr/local. The example config is installed as
/usr/local/share/doc/gocdm/cdmrc.example. Use
make install DESTDIR=/some/staging/root to inspect a staged installation first.
Nothing enables a login service or overwrites an existing user config.
The system configuration path is /etc/cdmrc; user configuration is optional.
See configuration before installing a system config.
For release assets and Gentoo, see upgrades and packages.