1import("//build/ohos.gni") 2 3## Build libudev.so {{{ 4config("libudev_config") { 5 visibility = [ ":*" ] 6 7 include_dirs = [ 8 "src/shared", 9 "src/libudev", 10 "hm_src", 11 ] 12 13 cflags = [ 14 "-DSIZEOF_PID_T=4", 15 "-DSIZEOF_UID_T=4", 16 "-DSIZEOF_GID_T=4", 17 "-DSIZEOF_TIME_T=8", 18 "-DSIZEOF_RLIM_T=8", 19 "-DSIZEOF_DEV_T=8", 20 "-Wno-macro-redefined", 21 "-Wno-unused-parameter", 22 "-Wno-unused-variable", 23 "-Wno-extern-initializer", 24 "-Wno-unused-function", 25 "-Wno-implicit-function-declaration", 26 "-Wno-int-conversion", 27 "-Wno-int-to-pointer-cast", 28 ] 29} 30 31config("libudev_public_config") { 32 include_dirs = [ "export_include" ] 33 34 cflags = [] 35} 36 37ohos_shared_library("libudev") { 38 sources = [ 39 "hm_src/log.c", 40 "src/libudev/libudev-device-private.c", 41 "src/libudev/libudev-device.c", 42 "src/libudev/libudev-enumerate.c", 43 "src/libudev/libudev-hwdb.c", 44 "src/libudev/libudev-list.c", 45 "src/libudev/libudev-monitor.c", 46 "src/libudev/libudev-queue.c", 47 "src/libudev/libudev-util.c", 48 "src/libudev/libudev.c", 49 "src/shared/MurmurHash2.c", 50 "src/shared/conf-files.c", 51 "src/shared/dev-setup.c", 52 "src/shared/device-nodes.c", 53 "src/shared/fileio.c", 54 "src/shared/hashmap.c", 55 "src/shared/label.c", 56 "src/shared/mempool.c", 57 "src/shared/mkdir-label.c", 58 "src/shared/mkdir.c", 59 "src/shared/path-util.c", 60 "src/shared/process-util.c", 61 "src/shared/random-util.c", 62 "src/shared/selinux-util.c", 63 "src/shared/siphash24.c", 64 "src/shared/smack-util.c", 65 "src/shared/strbuf.c", 66 "src/shared/strv.c", 67 "src/shared/strxcpyx.c", 68 "src/shared/sysctl-util.c", 69 "src/shared/terminal-util.c", 70 "src/shared/time-util.c", 71 "src/shared/utf8.c", 72 "src/shared/util.c", 73 "src/shared/virt.c", 74 75 # "src/shared/log.c", 76 ] 77 78 configs = [ ":libudev_config" ] 79 80 public_configs = [ ":libudev_public_config" ] 81 82 deps = [] 83 84 public_deps = [] 85 86 subsystem_name = "thirdparty" 87 part_name = "eudev" 88} 89 90## Build libudev.so }}} 91 92## Build udevd {{{ 93config("udevd_config") { 94 visibility = [ ":*" ] 95 96 include_dirs = [ 97 "./src/shared", 98 "./src/libudev", 99 "./src/udev", 100 "./hm_src", 101 ] 102 103 cflags = [ 104 "-DSIZEOF_PID_T=4", 105 "-DSIZEOF_UID_T=4", 106 "-DSIZEOF_GID_T=4", 107 "-DSIZEOF_TIME_T=8", 108 "-DSIZEOF_RLIM_T=8", 109 "-DSIZEOF_DEV_T=8", 110 "-Wno-unused-parameter", 111 "-Wno-missing-field-initializers", 112 "-Wno-implicit-function-declaration", 113 "-Wno-macro-redefined", 114 ] 115} 116 117config("udevd_public_config") { 118 include_dirs = [] 119 120 cflags = [] 121} 122 123ohos_executable("udevd") { 124 install_enable = true 125 126 sources = [ 127 "src/udev/udev-builtin-btrfs.c", 128 "src/udev/udev-builtin-hwdb.c", 129 "src/udev/udev-builtin-input_id.c", 130 "src/udev/udev-builtin-keyboard.c", 131 "src/udev/udev-builtin-net_id.c", 132 "src/udev/udev-builtin-path_id.c", 133 "src/udev/udev-builtin-usb_id.c", 134 "src/udev/udev-builtin.c", 135 "src/udev/udev-ctrl.c", 136 "src/udev/udev-event.c", 137 "src/udev/udev-node.c", 138 "src/udev/udev-rules.c", 139 "src/udev/udev-watch.c", 140 "src/udev/udevd.c", 141 ] 142 143 configs = [ ":udevd_config" ] 144 145 public_configs = [ ":udevd_public_config" ] 146 147 deps = [ ":libudev" ] 148 149 public_deps = [] 150 subsystem_name = "thirdparty" 151 part_name = "eudev" 152} 153 154## Build udevd }}} 155 156ohos_executable("udevadm") { 157 install_enable = true 158 159 sources = [ 160 "src/udev/udev-builtin-btrfs.c", 161 "src/udev/udev-builtin-hwdb.c", 162 "src/udev/udev-builtin-input_id.c", 163 "src/udev/udev-builtin-keyboard.c", 164 "src/udev/udev-builtin-net_id.c", 165 "src/udev/udev-builtin-path_id.c", 166 "src/udev/udev-builtin-usb_id.c", 167 "src/udev/udev-builtin.c", 168 "src/udev/udev-ctrl.c", 169 "src/udev/udev-event.c", 170 "src/udev/udev-node.c", 171 "src/udev/udev-rules.c", 172 "src/udev/udev-watch.c", 173 "src/udev/udevadm-control.c", 174 "src/udev/udevadm-hwdb.c", 175 "src/udev/udevadm-info.c", 176 "src/udev/udevadm-monitor.c", 177 "src/udev/udevadm-settle.c", 178 "src/udev/udevadm-test-builtin.c", 179 "src/udev/udevadm-test.c", 180 "src/udev/udevadm-trigger.c", 181 "src/udev/udevadm-util.c", 182 "src/udev/udevadm-util.h", 183 "src/udev/udevadm.c", 184 ] 185 186 configs = [ ":udevd_config" ] 187 188 public_configs = [ ":udevd_public_config" ] 189 190 deps = [ ":libudev" ] 191 192 public_deps = [] 193 subsystem_name = "thirdparty" 194 part_name = "eudev" 195} 196 197## Build udevd }}} 198 199ohos_prebuilt_etc("udev_conf") { 200 source = "src/udev/udev.conf" 201 relative_install_dir = "udev" 202 subsystem_name = "thirdparty" 203 part_name = "eudev" 204} 205 206ohos_prebuilt_etc("udev_touchscreen_rule") { 207 source = "rules.d/touchscreen.rules" 208 relative_install_dir = "udev/rules.d" 209 subsystem_name = "thirdparty" 210 part_name = "eudev" 211} 212 213ohos_prebuilt_etc("udev_vk_rule") { 214 source = "rules.d/vk.rules" 215 relative_install_dir = "udev/rules.d" 216 subsystem_name = "thirdparty" 217 part_name = "eudev" 218} 219 220## Install udevd.rc to /system/etc/init/udevd.rc {{{ 221ohos_prebuilt_etc("udevd.rc") { 222 source = "udevd.rc" 223 relative_install_dir = "init" 224 subsystem_name = "thirdparty" 225 part_name = "eudev" 226} 227## Install udevd.rc to /system/etc/init/udevd.rc }}} 228