1920f3c0fSWilliam A. Kennington IIISUMMARY = "Compiles a set of authorized_keys files into a single file" 2920f3c0fSWilliam A. Kennington IIIPR = "r1" 3920f3c0fSWilliam A. Kennington IIILICENSE = "Apache-2.0" 4920f3c0fSWilliam A. Kennington IIILIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" 5920f3c0fSWilliam A. Kennington III 6920f3c0fSWilliam A. Kennington IIIinherit systemd 7920f3c0fSWilliam A. Kennington III 8920f3c0fSWilliam A. Kennington IIISRC_URI += " \ 9920f3c0fSWilliam A. Kennington III file://authorized-keys-comp.service \ 10920f3c0fSWilliam A. Kennington III file://authorized-keys-comp.sh \ 11920f3c0fSWilliam A. Kennington III " 12920f3c0fSWilliam A. Kennington III 13920f3c0fSWilliam A. Kennington IIIS = "${WORKDIR}" 14920f3c0fSWilliam A. Kennington III 15*4dd03caeSWilly TuRDEPENDS:${PN} += "bash" 16920f3c0fSWilliam A. Kennington III 17*4dd03caeSWilly TuSYSTEMD_SERVICE:${PN} += "authorized-keys-comp.service" 18920f3c0fSWilliam A. Kennington III 19*4dd03caeSWilly TuFILES:${PN} += "/home" 20920f3c0fSWilliam A. Kennington III 21920f3c0fSWilliam A. Kennington IIIAUTHORIZED_KEYS_COMP_USERS ?= "root" 22920f3c0fSWilliam A. Kennington III 23*4dd03caeSWilly Tudo_install:append() { 24920f3c0fSWilliam A. Kennington III install -d -m0755 ${D}${libexecdir} 25920f3c0fSWilliam A. Kennington III install -m0755 authorized-keys-comp.sh ${D}${libexecdir}/ 26920f3c0fSWilliam A. Kennington III 27920f3c0fSWilliam A. Kennington III install -d -m0755 ${D}${systemd_system_unitdir} 28920f3c0fSWilliam A. Kennington III install -m0644 authorized-keys-comp.service ${D}${systemd_system_unitdir}/ 29920f3c0fSWilliam A. Kennington III 30920f3c0fSWilliam A. Kennington III for user in ${AUTHORIZED_KEYS_COMP_USERS}; do 31920f3c0fSWilliam A. Kennington III install -d -m0755 ${D}/home/$user/.ssh 32920f3c0fSWilliam A. Kennington III ln -sv /run/authorized_keys/$user ${D}/home/$user/.ssh/authorized_keys 33920f3c0fSWilliam A. Kennington III done 34920f3c0fSWilliam A. Kennington III} 35