@@ -48,6 +48,9 @@ PACKAGES =+ "${PN}-systemd"
48
48
SYSTEMD_SERVICE_${PN} -systemd += "device-manager.service"
49
49
SYSTEMD_PACKAGES = "${PN} -systemd"
50
50
51
+ INITSCRIPT_NAME = "device-manager-sysv-init"
52
+ INITSCRIPT_PARAMS = "start 10 2 3 4 5 . stop 32 0 1 6 ."
53
+
51
54
# device-cloud-python must be able to coexsit with previous HDC versions. So, install
52
55
# into its own namespace.
53
56
do_install_append () {
@@ -59,11 +62,23 @@ do_install_append() {
59
62
install -d ${D} /${BIN_DIR}
60
63
install -d ${D}${systemd_unitdir} /system /
61
64
install -d ${D} /${sysconfdir} /sudoers . d
65
+ install -d ${D}${sysconfdir} /init . d
62
66
67
+ # sudoers file
63
68
install -m 0400 "${B} /share/sudoers.d/device-cloud" "${D} /${sysconfdir} /sudoers.d/device-cloud"
69
+
70
+ # --------------------------------------------------------
71
+ # install both sysv and systemd. Let the distro features
72
+ # --------------------------------------------------------
73
+
74
+ # systemd service
64
75
cat ${B} /share /device -manager . service . in | sed -e "s|%user%|${DC_USER} |" > "${B} /share/device-manager.service"
65
76
install -m 0644 "${B} /share/device-manager.service" ${D}${systemd_unitdir} /system /
66
77
78
+ # sysv init script
79
+ cat ${B} /share /device -manager -sysv -init . in | sed -e "s|%user%|${DC_USER} |" > "${B} /share/device-manager-sysv-init"
80
+ install -m 0755 "${B} /share/device-manager-sysv-init" ${D}${sysconfdir} /init . d /device -manager -sysv -init
81
+
67
82
# update the working directory
68
83
sed -i "s|^#WorkingDirectory.*|WorkingDirectory=${VAR_DIR} |" ${D}${systemd_unitdir} /system /device -manager . service
69
84
@@ -87,25 +102,12 @@ do_install_append() {
87
102
install -m 0755 "${B} /share/snapshot_util.py" ${D}${BIN_DIR}
88
103
fi
89
104
90
-
91
105
install -m 644 "${B} /COPYING.txt" ${D} /${SHARE_DIR}
92
106
cp -r ${B} /demo ${D} /${SHARE_DIR}
93
107
cp ${B} /README * ${D} /${SHARE_DIR}
94
108
cp -r ${B} /share /example -ota -packages ${D} /${SHARE_DIR}
95
109
96
- # change the #! line to use python not python3 which is the default
97
- sed -i "s/env python\?/env ${PYTHON_PN} /" ${D} /${SHARE_DIR} /demo /*. py
98
-
99
- # fix python version, this is python 2.x, so check for python3
100
- for i in device_manager . py generate_config . py validate_script . py validate_app . py ; do
101
- {
102
- echo "converting ${S} /${i} to ${B} /${i} "
103
- sed -i "s/env python\?/env ${PYTHON_PN} /" ${B} /${i}
104
- } done
105
-
106
- # TODO: update the demo app config/runtime dirs
107
110
# update the runtime dir in iot.cfg
108
- # update the config dir
109
111
sed -i "s|:\" runtime\" |:\" ${VAR_DIR} \" |" ${B} /iot . cfg
110
112
sed -i "s|default_cfg_dir = \" .\" |default_cfg_dir = \" ${ETC_DIR} \" |" ${B} /device_manager . py
111
113
sed -i "s|systemd_controlled = False|systemd_controlled = True|" ${B} /device_manager . py
0 commit comments