Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SUMMARY = "Aradtec content"
- LICENSE = "CLOSED"
- # Compile time & Runtime dependencies
- RDEPENDS_${PN} = "systemd sthttpd ppp bash curl"
- DEPENDS = "paho-mqtt-c paho-mqtt-cpp curl"
- # We need to be systemd aware
- inherit systemd
- # We need to add a user for arad
- inherit useradd
- USERADD_PACKAGES = "${PN}"
- USERADD_PARAM_${PN} = "-m -s /bin/bash -P '${PN}' ${PN}"
- # Ignore warning about shttpd not being supported
- WRLINUX_SUPPORTED_RECIPE_pn-sthttpd = '2'
- # Display a nice banner for morale
- python do_display_banner() {
- bb.plain("*********************");
- bb.plain("* *");
- bb.plain("* AradTec 1 content *");
- bb.plain("* *");
- bb.plain("*********************");
- }
- addtask display_banner before do_build
- # Source files
- SRC_URI = "file://aradrouterd.tar.gz \
- <------>file://aradbinconf.tar.gz;unpack=false \
- <------>file://arad_rsa.pub"
- # Checksums
- #SRC_URI[aradrouterd.md5sum] = "7a47e423ba1e7fcaed4e91e0fa4c58b0"
- #SRC_URI[aradrouterd.sha256sum] = "52cb8c37e1e3f618b3dfb2c65da082ece1fe16a844f1fd4f6b187e2233980f64"
- #SRC_URI[aradbinconf.md5sum] = "0c67475fabad7bfeb43216fa15db0342"
- #SRC_URI[aradbinconf.sha256sum] = "6e2a0d8c22aac8b483ba37b4a98297b20623fc92db878d4ad26f27e59fe135d9"
- # Systemd service
- SYSTEMD_AUTO_ENABLE = "enable"
- SYSTEMD_SERVICE_${PN} = "aradrouterd.service"
- # aradrouterd.tar.gz extracts into aradrouterd folder
- S = "${WORKDIR}/aradrouterd"
- USER = "${PN}"
- AUTH_KEYS_FILE = "${D}/home/${USER}/.ssh/authorized_keys"
- do_install() {
- # Install the aradrouterd source package
- oe_runmake install DESTDIR=${D}
- # Install public key for user "arad"
- install -m 700 -o ${USER} -g ${USER} -d ${D}/home/${USER}/.ssh
- if [ -f "${AUTH_KEYS_FILE}" ]; then
- cat ${WORKDIR}/arad_rsa.pub >> ${AUTH_KEYS_FILE}
- else
- install -m 600 -o ${USER} -g ${USER} ${WORKDIR}/arad_rsa.pub ${AUTH_KEYS_FILE}
- fi
- # Add user arad to sudoers
- install -m 750 -d ${D}/etc/sudoers.d
- echo "${USER} ALL=(ALL) ALL" > ${D}/etc/sudoers.d/001_arad
- # Install binary and configuration data
- tar xvf ${WORKDIR}/aradbinconf.tar.gz --strip-components=1 -C ${D}
- }
- # List installed files
- FILES_${PN} = "/home/arad/.ssh/authorized_keys"
- FILES_${PN} += "/etc/sudoers.d/001_arad"
- FILES_${PN} += "/srv/www"
- FILES_${PN} += "/srv/www/*"
- FILES_${PN} += "/lib/systemd/system/aradrouterd.service"
- FILES_${PN} += "/usr/sbin/aradrouterd"
- #FILES_${PN} += "/usr/sbin/aradstatus.sh"
- FILES_${PN} += "/usr/sbin/packetreader"
- FILES_${PN} += "/etc/aradrouterd/aradrouterd.cfg"
- FILES_${PN} += "/etc/thttpd.conf"
- #FILES_${PN} += "/etc/ppp/ip-up.d/99-aradrouterd"
- #PARALLEL_MAKE = ""
- #BBCLASSEXTEND = "native"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement