blob: 45fd680fec869bc651eec87f1d75bc35e68d9c52 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001DESCRIPTION = "Script"
2DEPENDS = ""
3SECTION = "app"
4LICENSE = "zte"
5PV = "1.0.0"
6PR = "r0"
7
8CLASS_COM = " \
9 ${@bb.utils.contains('DISTRO_FEATURES', 'procd', 'openwrt openwrt-services', '', d)} \
10 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
11"
12inherit ${CLASS_COM}
13
14#配置code路径信息。
xf.libdd93d52023-05-12 07:10:14 -070015FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:"
lh9ed821d2023-04-07 01:36:19 -070016SRC_URI = " \
17 file://Script \
18 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://udhcpd.init","", d)} \
19 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://udhcpd.service","", d)} \
20 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://udhcpc.init","", d)} \
21 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://udhcpc.service","", d)} \
22 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://udhcpd.sysvinit","", d)} \
23 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://udhcpc.sysvinit","", d)} \
24 "
25LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808"
26S = "${WORKDIR}"
27
28#引用公用头文件和编译选项。
29include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc
30
31#编译
32do_compile() {
33 make -C Script
34}
35
36#库文件的安装,封库的宏MK_SDK_VERSION
37do_install () {
38 ##${D}=/Script/1.0.0-r0/image
39 #install -d ${D}${sbindir}/
40 install -d ${D}/sbin/
41
42 if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then
43 install -Dm 0755 ${WORKDIR}/udhcpd.init ${D}${sysconfdir}/init.d/udhcpd
44 install -Dm 0755 ${WORKDIR}/udhcpc.init ${D}${sysconfdir}/init.d/udhcpc
45 fi
46
47 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
48 install -d ${D}${systemd_unitdir}/system
49 install -m 0644 ${WORKDIR}/udhcpd.service ${D}${systemd_unitdir}/system
50 install -m 0644 ${WORKDIR}/udhcpc.service ${D}${systemd_unitdir}/system
51 fi
52
53 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
54 install -Dm 0755 ${WORKDIR}/udhcpd.sysvinit ${D}${sysconfdir}/init.d/udhcpd
55 install -Dm 0755 ${WORKDIR}/udhcpc.sysvinit ${D}${sysconfdir}/init.d/udhcpc
56 install -d ${D}${sysconfdir}/rcS.d
57 fi
58
59 install -m 0755 ${S}/Script/scripts/*.sh ${D}/sbin/
60 #install -m 0755 ${S}/Script/scripts/*.txt ${D}/sbin/
61 install -m 0755 ${S}/Script/wifi_script/common/*.sh ${D}/sbin/
62
63 install -d ${D}/etc_ro/
64 install -m 0755 ${S}/Script/etc/*.conf ${D}/etc_ro/
65 install -m 0755 ${S}/Script/etc/options.auth ${D}/etc_ro/
66 install -m 0755 ${S}/Script/etc/options.noauth ${D}/etc_ro/
67 install -m 0755 ${S}/Script/etc/initchat ${D}/etc_ro/
68 install -m 0755 ${S}/Script/etc/pap-secrets ${D}/etc_ro/
69 install -m 0755 ${S}/Script/etc/chap-secrets ${D}/etc_ro/
70}
71#清库
72do_cleanlibs () {
73}
74
75addtask cleanlibs after do_clean before do_cleansstate
76
77#rootfs包含的文件
78FILES_${PN} = "/sbin/ /etc_ro/"
79FILES_${PN} += "\
80 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/init.d/udhcpd","", d)} \
81 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/init.d/udhcpc","", d)} \
82 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
83 "
84
85SYSTEMD_SERVICE_${PN} = "udhcpd.service udhcpc.service"
86SYSTEMD_AUTO_ENABLE_${PN} = "disable"