android_system_core/toolbox/Android.bp
Tom Cherry 65a1ee83a8 toolbox: add setprop, start, and stop
Move these from toybox as they're Android specific and more easily
maintained here.

A few changes during the conversion:
* Report error in setprop if value is not a UTF8 string; this would
  previously fail only after attempting to set the property
* Inform users to check dmesg for further failure messages for all
  three programs
* Only start/stop zygote_secondary if the device is not single arch

Bug: 117321744
Bug: 133901248
Test: setprop works, start and stop work on single and multi-arch.

Change-Id: Id2194cf2b65221bde38aff91f0e86b33edb37f42
2019-06-06 11:20:29 -07:00

98 lines
2 KiB
Text

cc_defaults {
name: "toolbox_defaults",
cflags: [
"-Werror",
"-Wno-unused-parameter",
"-Wno-unused-const-variable",
"-D_FILE_OFFSET_BITS=64",
"-DWITHOUT_NLS",
"-DWITHOUT_BZ2",
"-DWITHOUT_GZIP",
],
}
genrule {
name: "toolbox_input_labels",
tool_files: ["generate-input.h-labels.py"],
cmd: "$(location) $(in) >$(out)",
srcs: [":kernel_input_headers"],
out: ["input.h-labels.h"],
}
cc_defaults {
name: "toolbox_binary_defaults",
defaults: ["toolbox_defaults"],
cpp_std: "experimental",
srcs: [
"toolbox.c",
"getevent.c",
"getprop.cpp",
"setprop.cpp",
"start.cpp",
],
generated_headers: [
"toolbox_input_labels",
],
shared_libs: [
"libbase",
],
static_libs: ["libpropertyinfoparser"],
symlinks: [
"getevent",
"getprop",
"setprop",
"start",
"stop",
],
}
cc_binary {
name: "toolbox",
defaults: ["toolbox_binary_defaults"],
recovery_available: true,
}
cc_binary {
name: "toolbox_vendor",
stem: "toolbox",
vendor: true,
defaults: ["toolbox_binary_defaults"],
}
// We build BSD grep separately (but see http://b/111849261).
cc_defaults {
name: "grep_common",
defaults: ["toolbox_defaults"],
srcs: [
"upstream-netbsd/usr.bin/grep/fastgrep.c",
"upstream-netbsd/usr.bin/grep/file.c",
"upstream-netbsd/usr.bin/grep/grep.c",
"upstream-netbsd/usr.bin/grep/queue.c",
"upstream-netbsd/usr.bin/grep/util.c",
],
symlinks: [
"egrep",
"fgrep",
],
sanitize: {
integer_overflow: false,
},
}
cc_binary {
name: "grep",
defaults: ["grep_common"],
recovery_available: true,
}
// Build vendor grep.
// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
// when vendor_available is fully supported.
cc_binary {
name: "grep_vendor",
stem: "grep",
vendor: true,
defaults: ["grep_common"],
}