Shellhttpd Recipe

All applications installed on your platform are described by recipes.

A recipe is a file with the application name, version, and the .bb extension. To create the application shellhttpd, the corresponding recipe will have the name:

In meta-subscriber-overrides, create the recipes-support folder.

mkdir recipes-support

In the recipes-support folder, use git to download the shellhttpd recipe from the extra-meta-subscriber-overrides repo:

cd recipes-support
git remote add fio
git remote update
git checkout remotes/fio/main -- shellhttpd

The shellhttpd recipe should be inside the recipes-support folder:

tree -L 3 .
└── shellhttpd
    ├── shellhttpd
    │   ├──
    │   └── shellhttpd.service

Check the content of your shellhttpd/ file:

cat shellhttpd/
SUMMARY = "Start up Shellhttpd Application"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit allarch systemd
RDEPENDS:${PN} += "bash"

SRC_URI = " \
        file:// \
        file://shellhttpd.service \
SRCREV = "f90f221ce4fcea2fde0062bc909f26cca6dbd1b6"

S = "${WORKDIR}/git"


SYSTEMD_SERVICE:${PN} = "shellhttpd.service"

do_install () {
        install -d ${D}${systemd_system_unitdir}
        install -m 0644 ${WORKDIR}/shellhttpd.service ${D}${systemd_system_unitdir}
        install -d ${D}${datadir}/shellhttpd/
        install -m 0755 ${WORKDIR}/ ${D}${datadir}/shellhttpd/

FILES:${PN} += "${systemd_system_unitdir}/shellhttpd.service"
FILES:${PN} += "${systemd_unitdir}/system-preset"
FILES:${PN} += "${datadir} ${datadir}/app-manager/"

The shellhttpd/ file has all the details for the shellhttpd application.

This tutorial does not intend to cover Yocto Project concepts in detail. However, note the following variables:

  • SRC_URI: This includes the files and shellhttpd.service in the ${WORKDIR}.
  • do_install: instructions to install the files from ${WORKDIR} to the Linux root file system.

Check the content of shellhttpd/shellhttpd/

cat shellhttpd/shellhttpd/
#!/bin/sh -e


RESPONSE="HTTP/1.1 200 OK\r\n\r\n${MSG}\r\n"

while true; do
   echo -en "$RESPONSE" | nc -c -l -p "${PORT}" || true
   echo "= $(date) ============================="

Notice that shellhttpd/shellhttpd/ is similar to used in the other tutorials.

This is the shell script executed by shellhttpd.service.

Check the content of shellhttpd/shellhttpd/shellhttpd.service:

cat shellhttpd/shellhttpd/shellhttpd.service
Description=Shellhttpd Minimal Web Server
Description=Start up Shellhttpd Application

ExecStart=/bin/sh /usr/share/shellhttpd/


shellhttpd/shellhttpd/shellhttpd.service is a systemd service file. The only variable of note is:

  • ExecStart: Executes the script.