Advertisement
Guest User

Untitled

a guest
Dec 30th, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. SUMMARY = "Aradtec content"
  2. LICENSE = "CLOSED"
  3.  
  4. # Compile time & Runtime dependencies
  5. RDEPENDS_${PN} = "systemd sthttpd ppp bash curl"
  6. DEPENDS = "paho-mqtt-c paho-mqtt-cpp curl"
  7.  
  8. # We need to be systemd aware
  9. inherit systemd
  10.  
  11. # We need to add a user for arad
  12. inherit useradd
  13.  
  14. USERADD_PACKAGES = "${PN}"
  15. USERADD_PARAM_${PN} = "-m -s /bin/bash -P '${PN}' ${PN}"
  16.  
  17. # Ignore warning about shttpd not being supported
  18. WRLINUX_SUPPORTED_RECIPE_pn-sthttpd = '2'
  19.  
  20. # Display a nice banner for morale
  21. python do_display_banner() {
  22. bb.plain("*********************");
  23. bb.plain("* *");
  24. bb.plain("* AradTec 1 content *");
  25. bb.plain("* *");
  26. bb.plain("*********************");
  27. }
  28.  
  29. addtask display_banner before do_build
  30.  
  31. # Source files
  32. SRC_URI = "file://aradrouterd.tar.gz \
  33. <------>file://aradbinconf.tar.gz;unpack=false \
  34. <------>file://arad_rsa.pub"
  35.  
  36. # Checksums
  37. #SRC_URI[aradrouterd.md5sum] = "7a47e423ba1e7fcaed4e91e0fa4c58b0"
  38. #SRC_URI[aradrouterd.sha256sum] = "52cb8c37e1e3f618b3dfb2c65da082ece1fe16a844f1fd4f6b187e2233980f64"
  39.  
  40. #SRC_URI[aradbinconf.md5sum] = "0c67475fabad7bfeb43216fa15db0342"
  41. #SRC_URI[aradbinconf.sha256sum] = "6e2a0d8c22aac8b483ba37b4a98297b20623fc92db878d4ad26f27e59fe135d9"
  42.  
  43. # Systemd service
  44. SYSTEMD_AUTO_ENABLE = "enable"
  45. SYSTEMD_SERVICE_${PN} = "aradrouterd.service"
  46.  
  47. # aradrouterd.tar.gz extracts into aradrouterd folder
  48. S = "${WORKDIR}/aradrouterd"
  49.  
  50. USER = "${PN}"
  51. AUTH_KEYS_FILE = "${D}/home/${USER}/.ssh/authorized_keys"
  52.  
  53. do_install() {
  54. # Install the aradrouterd source package
  55. oe_runmake install DESTDIR=${D}
  56.  
  57. # Install public key for user "arad"
  58. install -m 700 -o ${USER} -g ${USER} -d ${D}/home/${USER}/.ssh
  59. if [ -f "${AUTH_KEYS_FILE}" ]; then
  60. cat ${WORKDIR}/arad_rsa.pub >> ${AUTH_KEYS_FILE}
  61. else
  62. install -m 600 -o ${USER} -g ${USER} ${WORKDIR}/arad_rsa.pub ${AUTH_KEYS_FILE}
  63. fi
  64.  
  65. # Add user arad to sudoers
  66. install -m 750 -d ${D}/etc/sudoers.d
  67. echo "${USER} ALL=(ALL) ALL" > ${D}/etc/sudoers.d/001_arad
  68.  
  69. # Install binary and configuration data
  70. tar xvf ${WORKDIR}/aradbinconf.tar.gz --strip-components=1 -C ${D}
  71. }
  72.  
  73. # List installed files
  74. FILES_${PN} = "/home/arad/.ssh/authorized_keys"
  75. FILES_${PN} += "/etc/sudoers.d/001_arad"
  76. FILES_${PN} += "/srv/www"
  77. FILES_${PN} += "/srv/www/*"
  78. FILES_${PN} += "/lib/systemd/system/aradrouterd.service"
  79. FILES_${PN} += "/usr/sbin/aradrouterd"
  80. #FILES_${PN} += "/usr/sbin/aradstatus.sh"
  81. FILES_${PN} += "/usr/sbin/packetreader"
  82. FILES_${PN} += "/etc/aradrouterd/aradrouterd.cfg"
  83. FILES_${PN} += "/etc/thttpd.conf"
  84. #FILES_${PN} += "/etc/ppp/ip-up.d/99-aradrouterd"
  85.  
  86. #PARALLEL_MAKE = ""
  87.  
  88. #BBCLASSEXTEND = "native"
  89.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement