systemd_%.bbappend 2.62 KB
Newer Older
1
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
SRC_URI_append = " file://50-video.rules \
3 4 5
                  file://65-android.rules \
                  file://dbus.service \
                  file://dbus.socket \
6 7
                  file://dbus.conf \
                  file://logind.conf"
8 9 10 11 12 13 14

do_install_append() {
    # Setup udev rules for the rights of Android and graphic cards specific devices
    install -m 0644 ${WORKDIR}/50-video.rules ${D}${sysconfdir}/udev/rules.d/50-video.rules
    install -m 0644 ${WORKDIR}/65-android.rules ${D}${sysconfdir}/udev/rules.d/65-android.rules

    # Enables auto-login for ceres
15 16
    install -d ${D}/var/lib/systemd/linger
    touch ${D}/var/lib/systemd/linger/ceres
17
    sed -i "s@agetty --noclear @agetty --autologin ceres @" ${D}/lib/systemd/system/getty@.service
18

19
    # In current systemd versions we have to take care ourselves of the dbus user service, it should be handled in the next versions
20 21
    install -d ${D}/usr/lib/systemd/user/
    install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
22 23
    install -m 0644 ${WORKDIR}/dbus.socket ${D}/usr/lib/systemd/user/dbus.socket
    install -m 0644 ${WORKDIR}/dbus.service ${D}/usr/lib/systemd/user/dbus.service
24 25 26 27
    if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/dbus.socket ]; then
        ln -s /usr/lib/systemd/user/dbus.socket ${D}/home/ceres/.config/systemd/user/default.target.wants/dbus.socket
        ln -s /usr/lib/systemd/user/dbus.service ${D}/home/ceres/.config/systemd/user/default.target.wants/dbus.service
    fi
28 29
    install -d ${D}/etc/systemd/system/user@.service.d/
    install -m 0644 ${WORKDIR}/dbus.conf ${D}/etc/systemd/system/user@.service.d/dbus.conf
30 31

    install -m 0644 ${WORKDIR}/logind.conf ${D}/etc/systemd/logind.conf
32 33
}

34 35
FILES_${PN} += "/home/ceres/.config/systemd/user/default.target.wants/"

36
PACKAGECONFIG_append += "pam"
37 38

RRECOMMENDS_${PN}_remove = "udev-hwdb"
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

ALTERNATIVE_${PN} += "usrsbinhalt usrsbinreboot usrsbinshutdown usrsbinpoweroff"

ALTERNATIVE_TARGET[usrsbinhalt] = "${base_bindir}/systemctl"
ALTERNATIVE_LINK_NAME[usrsbinhalt] = "${sbindir}/halt"
ALTERNATIVE_PRIORITY[usrsbinhalt] ?= "300"

ALTERNATIVE_TARGET[usrsbinreboot] = "${base_bindir}/systemctl"
ALTERNATIVE_LINK_NAME[usrsbinreboot] = "${sbindir}/reboot"
ALTERNATIVE_PRIORITY[usrsbinreboot] ?= "300"

ALTERNATIVE_TARGET[usrsbinshutdown] = "${base_bindir}/systemctl"
ALTERNATIVE_LINK_NAME[usrsbinshutdown] = "${sbindir}/shutdown"
ALTERNATIVE_PRIORITY[usrsbinshutdown] ?= "300"

ALTERNATIVE_TARGET[usrsbinpoweroff] = "${base_bindir}/systemctl"
ALTERNATIVE_LINK_NAME[usrsbinpoweroff] = "${sbindir}/poweroff"
ALTERNATIVE_PRIORITY[usrsbinpoweroff] ?= "300"