lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | DESCRIPTION = "adb" |
| 2 | #adb依赖libnvram库 |
| 3 | DEPENDS = "libnvram" |
| 4 | SECTION = "app" |
| 5 | LICENSE = "zte" |
| 6 | PV = "1.0.0" |
| 7 | PR = "r0" |
| 8 | |
| 9 | CLASS_COM = " \ |
| 10 | ${@bb.utils.contains('DISTRO_FEATURES', 'procd', 'openwrt openwrt-services', '', d)} \ |
| 11 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ |
| 12 | " |
| 13 | inherit ${CLASS_COM} |
| 14 | |
| 15 | #配置code路径信息。 |
xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame] | 16 | FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:" |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 17 | SRC_URI = " \ |
| 18 | file://adb \ |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 19 | ${@bb.utils.contains("DISTRO_FEATURES", "adb_login", "file://adb_shell","", d)} \ |
| 20 | ${@bb.utils.contains("DISTRO_FEATURES", "adb_login", "file://adb_profile","", d)} \ |
| 21 | ${@bb.utils.contains("DISTRO_FEATURES", "adb_login", "file://0001-adb-login.patch","", d)} \ |
| 22 | ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://adb.init","", d)} \ |
| 23 | ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://adb.service","", d)} \ |
| 24 | ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://adb.sysvinit","", d)} \ |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 25 | " |
| 26 | |
| 27 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808" |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 28 | S = "${WORKDIR}/adb" |
| 29 | B = "${WORKDIR}" |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 30 | #引用公用头文件和编译选项。 |
| 31 | include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc |
| 32 | |
| 33 | #编译 |
| 34 | do_compile() { |
| 35 | make -C adb |
| 36 | } |
| 37 | |
| 38 | #库文件的安装 |
| 39 | do_install() { |
| 40 | install -d ${D}${bindir}/ |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 41 | install -d ${D}${base_bindir}/ |
| 42 | install -d ${D}${sysconfdir}/ |
| 43 | |
| 44 | install -m 0755 ${S}/adbd ${D}${bindir}/ |
| 45 | if ${@bb.utils.contains('DISTRO_FEATURES','adb_login','true','false',d)}; then |
| 46 | install -m 0755 ${WORKDIR}/adb_shell ${D}${base_bindir}/ |
| 47 | install -m 0755 ${WORKDIR}/adb_profile ${D}${sysconfdir}/ |
| 48 | fi |
| 49 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 50 | if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then |
| 51 | install -Dm 0755 ${WORKDIR}/adb.init ${D}${sysconfdir}/init.d/adbd |
| 52 | fi |
| 53 | |
| 54 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 55 | install -d ${D}${systemd_unitdir}/system |
xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame] | 56 | install -m 0644 ${WORKDIR}/adb.service ${D}${systemd_unitdir}/system |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 57 | fi |
| 58 | |
| 59 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then |
| 60 | install -Dm 0755 ${WORKDIR}/adb.sysvinit ${D}${sysconfdir}/init.d/adbd |
| 61 | install -d ${D}${sysconfdir}/rcS.d |
| 62 | ln -s ../init.d/adbd ${D}${sysconfdir}/rcS.d/S80adbd |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 63 | ln -s ../init.d/adbd ${D}${sysconfdir}/rcS.d/K20adbd |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 64 | fi |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 65 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 66 | #install elfs |
| 67 | install -d ${ELFS-PATH}/ |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 68 | install -m 0755 ${S}/adbd ${ELFS-PATH}/ |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 69 | } |
| 70 | #清库 |
| 71 | do_cleanlibs () { |
| 72 | rm -fr ${ELFS-PATH}/adbd |
| 73 | } |
| 74 | |
| 75 | addtask cleanlibs after do_clean before do_cleansstate |
| 76 | |
| 77 | #rootfs包含的文件 |
| 78 | FILES_${PN} = "\ |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 79 | ${base_bindir}/ \ |
| 80 | ${bindir}/ \ |
| 81 | ${sysconfdir}/ \ |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 82 | " |
| 83 | SYSTEMD_SERVICE_${PN} = "adb.service" |
| 84 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" |