summaryrefslogtreecommitdiff
path: root/meta-unit-core/dynamic-layers/virtualization-layer/recipes-users/useradd/add-user-unitexe.bbappend
blob: 922b0c8131d5ec12dd764de52be003b338003402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
do_install:append() {
    # If linger is not enabled then rootless podman 
    # commands will complain with number of warnings.
    install -d ${D}${localstatedir}/lib/systemd/linger
    touch ${D}${localstatedir}/lib/systemd/linger/${USER_TO_ADD_NAME}

    # Note: Use of .profile here assumes busybox shell.
    # Podman uses these (if defined) for overriding
    # default configuration file locations. This is
    # explained here:
    #   https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md#user-configuration-files
    cat > ${D}/home/${USER_TO_ADD_NAME}/.profile << 'EOF'
export XDG_RUNTIME_DIR=/run/user/$(id -u)
export XDG_CONFIG_HOME=$HOME/.config
EOF
}

FILES:${PN}:append = " ${localstatedir}/lib/systemd/linger/${USER_TO_ADD_NAME}"