blob: a3daacc200c5340a118d341e3adf4d9c9f9e11cc [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001DESCRIPTION = "adb"
2#adb依赖libnvram库
3DEPENDS = "libnvram"
4SECTION = "app"
5LICENSE = "zte"
6PV = "1.0.0"
7PR = "r0"
8
9CLASS_COM = " \
10 ${@bb.utils.contains('DISTRO_FEATURES', 'procd', 'openwrt openwrt-services', '', d)} \
11 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
12"
13inherit ${CLASS_COM}
14
15#配置code路径信息。
xf.libdd93d52023-05-12 07:10:14 -070016FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:"
lh9ed821d2023-04-07 01:36:19 -070017SRC_URI = " \
18 file://adb \
lh758261d2023-07-13 05:52:04 -070019 ${@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)} \
lh9ed821d2023-04-07 01:36:19 -070025 "
26
27LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808"
lh758261d2023-07-13 05:52:04 -070028S = "${WORKDIR}/adb"
29B = "${WORKDIR}"
lh9ed821d2023-04-07 01:36:19 -070030#引用公用头文件和编译选项。
31include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc
32
33#编译
34do_compile() {
35 make -C adb
36}
37
38#库文件的安装
39do_install() {
40 install -d ${D}${bindir}/
lh758261d2023-07-13 05:52:04 -070041 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
lh9ed821d2023-04-07 01:36:19 -070050 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.libdd93d52023-05-12 07:10:14 -070056 install -m 0644 ${WORKDIR}/adb.service ${D}${systemd_unitdir}/system
lh9ed821d2023-04-07 01:36:19 -070057 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
lh758261d2023-07-13 05:52:04 -070063 ln -s ../init.d/adbd ${D}${sysconfdir}/rcS.d/K20adbd
lh9ed821d2023-04-07 01:36:19 -070064 fi
lh758261d2023-07-13 05:52:04 -070065
lh9ed821d2023-04-07 01:36:19 -070066 #install elfs
67 install -d ${ELFS-PATH}/
lh758261d2023-07-13 05:52:04 -070068 install -m 0755 ${S}/adbd ${ELFS-PATH}/
lh9ed821d2023-04-07 01:36:19 -070069}
70#清库
71do_cleanlibs () {
72 rm -fr ${ELFS-PATH}/adbd
73}
74
75addtask cleanlibs after do_clean before do_cleansstate
76
77#rootfs包含的文件
78FILES_${PN} = "\
lh758261d2023-07-13 05:52:04 -070079 ${base_bindir}/ \
80 ${bindir}/ \
81 ${sysconfdir}/ \
lh9ed821d2023-04-07 01:36:19 -070082 "
83SYSTEMD_SERVICE_${PN} = "adb.service"
84SYSTEMD_AUTO_ENABLE_${PN} = "enable"