lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | DESCRIPTION = "Script" |
| 2 | DEPENDS = "" |
| 3 | SECTION = "app" |
| 4 | LICENSE = "zte" |
| 5 | PV = "1.0.0" |
| 6 | PR = "r0" |
| 7 | |
| 8 | CLASS_COM = " \ |
| 9 | ${@bb.utils.contains('DISTRO_FEATURES', 'procd', 'openwrt openwrt-services', '', d)} \ |
| 10 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ |
| 11 | " |
| 12 | inherit ${CLASS_COM} |
| 13 | |
| 14 | #配置code路径信息。 |
xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame^] | 15 | FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:" |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 16 | SRC_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 | " |
| 25 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808" |
| 26 | S = "${WORKDIR}" |
| 27 | |
| 28 | #引用公用头文件和编译选项。 |
| 29 | include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc |
| 30 | |
| 31 | #编译 |
| 32 | do_compile() { |
| 33 | make -C Script |
| 34 | } |
| 35 | |
| 36 | #库文件的安装,封库的宏MK_SDK_VERSION |
| 37 | do_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 | #清库 |
| 72 | do_cleanlibs () { |
| 73 | } |
| 74 | |
| 75 | addtask cleanlibs after do_clean before do_cleansstate |
| 76 | |
| 77 | #rootfs包含的文件 |
| 78 | FILES_${PN} = "/sbin/ /etc_ro/" |
| 79 | FILES_${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 | |
| 85 | SYSTEMD_SERVICE_${PN} = "udhcpd.service udhcpc.service" |
| 86 | SYSTEMD_AUTO_ENABLE_${PN} = "disable" |