Skip to content

Instantly share code, notes, and snippets.

@dimkr
Created June 1, 2015 20:04
Show Gist options
  • Save dimkr/90e71a2186afd031ccfd to your computer and use it in GitHub Desktop.
Save dimkr/90e71a2186afd031ccfd to your computer and use it in GitHub Desktop.
How to build a standalone logind 204
#!/bin/sh
wget http://www.freedesktop.org/software/systemd/systemd-204.tar.xz
tar -xJvf systemd-204.tar.xz
cd systemd-204/src/login
gperf < logind-gperf.gperf > logind-gperf.c
gcc -std=gnu99 -Wall -pedantic \
-o logind \
-march=i486 -mtune=i686 -Os -fomit-frame-pointer -ffunction-sections -fdata-sections -fmerge-all-constants \
-I../../src -I../../src/shared -I../../src/systemd -I../../src/core \
-DPACKAGE_STRING=\"systemd\" -D_GNU_SOURCE -DX_SERVER=\"Xorg\" -DHAVE_ACL -D_FILE_OFFSET_BITS=64 -DHAVE_DECL_NAME_TO_HANDLE_AT=1 -DHAVE_SECURE_GETENV -o logind -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"/usr/bin/systemd-stdio-bridge\" -DPKGSYSCONFDIR=\"/etc\" \
logind.c logind-gperf.c logind-acl.c logind-action.c logind-button.c logind-dbus.c logind-device.c logind-inhibit.c logind-seat.c logind-seat-dbus.c logind-session.c logind-session-dbus.c logind-user.c logind-user-dbus.c sd-login.c sysfs-show.c ../../src/libsystemd-daemon/sd-daemon.c ../../src/shared/strv.c ../../src/shared/label.c ../../src/shared/set.c ../../src/shared/unit-name.c ../../src/shared/sleep-config.c ../../src/shared/log.c ../../src/shared/mkdir.c ../../src/shared/fileio.c ../../src/shared/path-util.c ../../src/shared/time-util.c ../../src/shared/cgroup-util.c ../../src/shared/hashmap.c ../../src/shared/dbus-common.c ../../src/shared/util.c ../../src/shared/env-util.c ../../src/shared/exit-status.c ../../src/shared/utf8.c ../../src/shared/polkit.c ../../src/shared/acl-util.c ../../src/shared/conf-parser.c ../../src/shared/dbus-loop.c ../../src/shared/cgroup-label.c ../../src/shared/audit.c ../../src/shared/virt.c ../../src/shared/capability.c ../../src/shared/fileio-label.c \
-Wl,-gc-sections -Wl,--sort-common \
`pkg-config --cflags --libs libudev dbus-1` -lpam -lpam_misc -lacl -lcap -lrt
strip --strip-all logind
file logind
du -h logind
ldd logind | grep systemd
nm -D logind | grep sd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment