From alp at rsu.ru Mon Jan 22 09:23:01 2018 From: alp at rsu.ru (Alexander Pyhalov) Date: Mon, 22 Jan 2018 12:23:01 +0300 Subject: UPower illumos port Message-ID: <38e2c836-0a2a-15c8-4f12-733631c1806c@rsu.ru> Hello, guys. I've created an illumos upower backend, which seems to work on several notebooks where I've tested it. The code itself lives in oi-userland repository: https://github.com/OpenIndiana/oi-userland/pull/3869 (I point to the PR with upower integration, as it has some history). UPower illumos backend is based on OpenBSD backend. It supports systems with one battery and one AC device (or without them :)). UPower daemon is supposed to start at boot as separate service, as we don't support services, automatically activated by dbus requests. There are several patches: Cosmetic changes: 1) https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/sysutils/upower/patches/01-as-needed.patch - this adds check if ld supports '--as-needed' option 2) https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/sysutils/upower/patches/03-up-backend-common.c.patch - We have rather ancient version of ConsoleKit and this one is intended to map 'logind-style' ConsoleKit interfaces to older interfaces (I have no intention to upstream it) 3) https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/sysutils/upower/patches/04-upower-glib-crash.patch - this patch allowed us to avoid crashes of upower client and mate-power-manager when upower service was turned off - client applications expect to get list of devices and don't handle NULL properly. The main patch: https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/sysutils/upower/patches/02-backend-illumos.patch The most methods are wrappers around minor_device_ioctl() function, which looks for acpi_drv device of necessary kind and fires requested IOCTL on it. We currently look only on first found device of kind "ac" and "battery". Luckily, this covers most of notebooks. I'm interested in getting some reviews and upstreaming it. -- Best regards, Alexander Pyhalov, system administrator of Southern Federal University IT department