Add Recipe to Yocto
Enable Javascript to display Table of Contents.
Creating the *.bb File
Placing the following content to recipes-core/ssh-authorized-keys/ssh-authorized-keys_0.1.bb
:
DESCRIPTION = "Hack to install my authorized SSH keys to the image"
LICENSE="CLOSED"
SRC_URI = "file://authorized_keys \
"
do_install () {
install -d ${D}/home/myuser/.ssh
install -p ${WORKDIR}/authorized_keys ${D}/home/myuser/.ssh
}
FILES_${PN} += "/home/myuser/.ssh/authorized_keys"
Then create in the same folder of the *.bb file a directory files and place the authorized_keys file there.
Register Recipe
Finally register your recipe:
diff --git a/recipes-core/images/core-image-pu-bsp.bb b/recipes-core/images/core-image-pu-bsp.bb
index 0f88074..73a42ab 100644
--- a/recipes-core/images/core-image-pu-bsp.bb
+++ b/recipes-core/images/core-image-pu-bsp.bb
@@ -44,6 +44,8 @@ IMAGE_INSTALL += "linuxptp"
# for benchmarking
IMAGE_INSTALL += "iperf2"
+IMAGE_INSTALL += "ssh-authorized-keys"
+
# Kernel image isn't needed in the rootfs
# TODO Can this be done more nicely, e.g. from the kernel recipe itself?
drop_boot_from_rootfs() {