summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-core/dropbear/dropbear_%.bbappend
blob: cfa1d0711129ae1274f8ae392cce25dc2811a68e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://enable-ssh.sh"

add_manual_ssh_enable() {
   install -d ${D}/usr/share/misc
   install -m 0755 ${D}/${systemd_unitdir}/system/dropbear@.service ${D}/usr/share/misc/dropbear@.service
   install -m 0755 ${D}/${systemd_unitdir}/system/dropbear.socket ${D}/usr/share/misc/dropbear.socket
   install -m 0755 ${WORKDIR}/enable-ssh.sh ${D}${bindir}/enable-ssh.sh
   # Remove dropbear service and socket by default, if debug-tweaks is disabled
   rm ${D}/${systemd_unitdir}/system/dropbear@.service
   rm ${D}/${systemd_unitdir}/system/dropbear.socket
}

do_install_append() {
   # Add manual ssh enable script if debug-tweaks is disabled
   ${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'debug-tweaks', '', 'add_manual_ssh_enable', d)}
}

FILES_${PN} += "/usr/share/misc"
SYSTEMD_SERVICE_${PN} += "dropbearkey.service"
SYSTEMD_SERVICE_${PN}_remove += " ${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'debug-tweaks', '', 'dropbear.socket', d)}"