Shellhttpd Recipe

All applications installed on your platform are described by a recipe.

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

In the meta-subscriber-overrides folder, 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 repository:

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 .

Example output:

└── 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 the Yocto Project concepts. However, let’s highlight the following variables:

  • SRC_URI: It is including the files and shellhttpd.service in the ${WORKDIR}.
  • do_install: It is installing the file from ${WORKDIR} to the Linux distribution root file system.

Check the content of your shellhttpd/shellhttpd/ file:

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) ============================="

The shellhttpd/shellhttpd/ is very similar to the used in the previous tutorials.

This is the shell script executed by the shellhttpd.service file.

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

cat shellhttpd/shellhttpd/shellhttpd.service


Description=Shellhttpd Minimal Web Server
Description=Start up Shellhttpd Application

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


The shellhttpd/shellhttpd/shellhttpd.service is a systemd service. The only variable that should be highlight here is:

  • ExecStart: Execute the script.