blob: 81ee868a8781fc366ceeae605174c3eec9e23dae [file] [log] [blame]
William A. Kennington III920f3c02021-03-31 03:16:39 -07001SUMMARY = "Compiles a set of authorized_keys files into a single file"
2PR = "r1"
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
5
6inherit systemd
7
8SRC_URI += " \
9 file://authorized-keys-comp.service \
10 file://authorized-keys-comp.sh \
11 "
12
13S = "${WORKDIR}"
14
15RDEPENDS_${PN} += "bash"
16
17SYSTEMD_SERVICE_${PN} += "authorized-keys-comp.service"
18
19FILES_${PN} += "/home"
20
21AUTHORIZED_KEYS_COMP_USERS ?= "root"
22
23do_install_append() {
24 install -d -m0755 ${D}${libexecdir}
25 install -m0755 authorized-keys-comp.sh ${D}${libexecdir}/
26
27 install -d -m0755 ${D}${systemd_system_unitdir}
28 install -m0644 authorized-keys-comp.service ${D}${systemd_system_unitdir}/
29
30 for user in ${AUTHORIZED_KEYS_COMP_USERS}; do
31 install -d -m0755 ${D}/home/$user/.ssh
32 ln -sv /run/authorized_keys/$user ${D}/home/$user/.ssh/authorized_keys
33 done
34}