1 Star 0 Fork 0

aosp-riscv-bionic-porting/platform_external_toybox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Android.bp 11.35 KB
一键复制 编辑 原始数据 按行查看 历史
Yifan Hong 提交于 2020-10-21 18:44 . Introduce toybox.vendor_ramdisk.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
/*
--- To sync with upstream:
# Update source and regenerate generated files.
git remote add toybox https://github.com/landley/toybox.git
git fetch toybox && git merge toybox/master && ./regenerate.sh
# Make any necessary Android.bp changes and rebuild.
mm -j32
# Run all the tests.
./run-tests-on-android.sh
# Run a single test.
./run-tests-on-android.sh wc
# Upload changes.
git commit -a --amend
git push aosp HEAD:refs/for/master # Push to gerrit for review.
git push aosp HEAD:master # Push directly, avoiding gerrit.
--- To add a toy:
# Edit the three .config-* files to enable the toy you want for the targets
# you want it on, and regenerate the generated files:
./regenerate.sh
# Edit the relevant `srcs` below, depending on where the toy should be
# available.
# If you just want to use the toy via "toybox x" rather than "x", you can
# stop now. If you want this toy to have a symbolic link in /system/bin,
# add the toy to symlinks.
*/
all_srcs = [
"lib/args.c",
"lib/commas.c",
"lib/dirtree.c",
"lib/env.c",
"lib/help.c",
"lib/lib.c",
"lib/linestack.c",
"lib/llist.c",
"lib/net.c",
"lib/portability.c",
"lib/tty.c",
"lib/xwrap.c",
"main.c",
"toys/lsb/gzip.c",
"toys/lsb/hostname.c",
"toys/lsb/md5sum.c",
"toys/lsb/mktemp.c",
"toys/lsb/seq.c",
"toys/net/microcom.c",
"toys/other/dos2unix.c",
"toys/other/readlink.c",
"toys/other/setsid.c",
"toys/other/stat.c",
"toys/other/timeout.c",
"toys/other/truncate.c",
"toys/other/which.c",
"toys/other/xxd.c",
"toys/other/yes.c",
"toys/pending/dd.c",
"toys/pending/diff.c",
"toys/pending/expr.c",
"toys/pending/getopt.c",
"toys/pending/tr.c",
"toys/posix/basename.c",
"toys/posix/cat.c",
"toys/posix/chmod.c",
"toys/posix/cmp.c",
"toys/posix/comm.c",
"toys/posix/cp.c",
"toys/posix/cpio.c",
"toys/posix/cut.c",
"toys/posix/date.c",
"toys/posix/dirname.c",
"toys/posix/du.c",
"toys/posix/echo.c",
"toys/posix/env.c",
"toys/posix/find.c",
"toys/posix/getconf.c",
"toys/posix/grep.c",
"toys/posix/head.c",
"toys/posix/id.c",
"toys/posix/ln.c",
"toys/posix/ls.c",
"toys/posix/mkdir.c",
"toys/posix/od.c",
"toys/posix/paste.c",
"toys/posix/patch.c",
"toys/posix/printf.c",
"toys/posix/pwd.c",
"toys/posix/rm.c",
"toys/posix/rmdir.c",
"toys/posix/sed.c",
"toys/posix/sleep.c",
"toys/posix/sort.c",
"toys/posix/tail.c",
"toys/posix/tar.c",
"toys/posix/tee.c",
"toys/posix/test.c",
"toys/posix/touch.c",
"toys/posix/true.c",
"toys/posix/uname.c",
"toys/posix/uniq.c",
"toys/posix/wc.c",
"toys/posix/xargs.c",
]
linux_srcs = [
"toys/posix/ps.c",
"toys/other/taskset.c",
]
device_srcs = [
"toys/android/getenforce.c",
"toys/android/load_policy.c",
"toys/android/log.c",
"toys/android/restorecon.c",
"toys/android/runcon.c",
"toys/android/sendevent.c",
"toys/android/setenforce.c",
"toys/lsb/dmesg.c",
"toys/lsb/killall.c",
"toys/lsb/mknod.c",
"toys/lsb/mount.c",
"toys/lsb/pidof.c",
"toys/lsb/sync.c",
"toys/lsb/umount.c",
"toys/net/ifconfig.c",
"toys/net/netcat.c",
"toys/net/netstat.c",
"toys/net/ping.c",
"toys/net/rfkill.c",
"toys/net/tunctl.c",
"toys/other/acpi.c",
"toys/other/base64.c",
"toys/other/blkdiscard.c",
"toys/other/blkid.c",
"toys/other/blockdev.c",
"toys/other/chcon.c",
"toys/other/chroot.c",
"toys/other/chrt.c",
"toys/other/clear.c",
"toys/other/devmem.c",
"toys/other/fallocate.c",
"toys/other/flock.c",
"toys/other/fmt.c",
"toys/other/free.c",
"toys/other/freeramdisk.c",
"toys/other/fsfreeze.c",
"toys/other/fsync.c",
"toys/other/help.c",
"toys/other/hwclock.c",
"toys/other/i2ctools.c",
"toys/other/inotifyd.c",
"toys/other/insmod.c",
"toys/other/ionice.c",
"toys/other/losetup.c",
"toys/other/lsattr.c",
"toys/other/lsmod.c",
"toys/other/lspci.c",
"toys/other/lsusb.c",
"toys/other/makedevs.c",
"toys/other/mkswap.c",
"toys/other/modinfo.c",
"toys/other/mountpoint.c",
"toys/other/nbd_client.c",
"toys/other/nsenter.c",
"toys/other/partprobe.c",
"toys/other/pivot_root.c",
"toys/other/pmap.c",
"toys/other/printenv.c",
"toys/other/pwdx.c",
"toys/other/rev.c",
"toys/other/rmmod.c",
"toys/other/rtcwake.c",
"toys/other/setfattr.c",
"toys/other/swapoff.c",
"toys/other/swapon.c",
"toys/other/sysctl.c",
"toys/other/tac.c",
"toys/other/uptime.c",
"toys/other/usleep.c",
"toys/other/uuidgen.c",
"toys/other/vconfig.c",
"toys/other/vmstat.c",
"toys/other/watch.c",
"toys/pending/getfattr.c",
"toys/pending/lsof.c",
"toys/pending/modprobe.c",
"toys/pending/more.c",
"toys/pending/readelf.c",
"toys/pending/stty.c",
"toys/pending/traceroute.c",
"toys/pending/vi.c",
"toys/posix/cal.c",
"toys/posix/chgrp.c",
"toys/posix/cksum.c",
"toys/posix/df.c",
"toys/posix/expand.c",
"toys/posix/false.c",
"toys/posix/file.c",
"toys/posix/iconv.c",
"toys/posix/kill.c",
"toys/posix/mkfifo.c",
"toys/posix/nice.c",
"toys/posix/nl.c",
"toys/posix/nohup.c",
"toys/posix/renice.c",
"toys/posix/split.c",
"toys/posix/strings.c",
"toys/posix/time.c",
"toys/posix/tty.c",
"toys/posix/ulimit.c",
"toys/posix/unlink.c",
"toys/posix/uudecode.c",
"toys/posix/uuencode.c",
]
toybox_symlinks = [
"acpi",
"base64",
"basename",
"blockdev",
"cal",
"cat",
"chattr",
"chcon",
"chgrp",
"chmod",
"chown",
"chroot",
"chrt",
"cksum",
"clear",
"comm",
"cmp",
"cp",
"cpio",
"cut",
"date",
"dd",
"devmem",
"df",
"diff",
"dirname",
"dmesg",
"dos2unix",
"du",
"echo",
"egrep",
"env",
"expand",
"expr",
"fallocate",
"false",
"fgrep",
"file",
"find",
"flock",
"fmt",
"free",
"fsync",
"getconf",
"getenforce",
"grep",
"groups",
"gunzip",
"gzip",
"head",
"hostname",
"hwclock",
"i2cdetect",
"i2cdump",
"i2cget",
"i2cset",
"iconv",
"id",
"ifconfig",
"inotifyd",
"insmod",
"install",
"ionice",
"iorenice",
"kill",
"killall",
"load_policy",
"ln",
"log",
"logname",
"losetup",
"ls",
"lsattr",
"lsmod",
"lsof",
"lspci",
"lsusb",
"md5sum",
"mkdir",
"mkfifo",
"mknod",
"mkswap",
"mktemp",
"microcom",
"modinfo",
"more",
"mount",
"mountpoint",
"mv",
"nc",
"netcat",
"netstat",
"nice",
"nl",
"nohup",
"nproc",
"nsenter",
"od",
"paste",
"patch",
"pgrep",
"pidof",
"pkill",
"pmap",
"printenv",
"printf",
"ps",
"pwd",
"readelf",
"readlink",
"realpath",
"renice",
"restorecon",
"rm",
"rmdir",
"rmmod",
"rtcwake",
"runcon",
"sed",
"sendevent",
"seq",
"setenforce",
"setsid",
"sha1sum",
"sha224sum",
"sha256sum",
"sha384sum",
"sha512sum",
"sleep",
"sort",
"split",
"stat",
"strings",
"stty",
"swapoff",
"swapon",
"sync",
"sysctl",
"tac",
"tail",
"tar",
"taskset",
"tee",
"test",
"time",
"timeout",
"top",
"touch",
"tr",
"true",
"truncate",
"tty",
"ulimit",
"umount",
"uname",
"uniq",
"unix2dos",
"unlink",
"unshare",
"uptime",
"usleep",
"uudecode",
"uuencode",
"uuidgen",
"vmstat",
"watch",
"wc",
"which",
"whoami",
"xargs",
"xxd",
"yes",
"zcat",
]
cc_defaults {
name: "toybox-defaults",
srcs: all_srcs,
cflags: [
"-Os",
"-Wall",
"-Werror",
"-Wno-char-subscripts",
"-Wno-deprecated-declarations",
"-Wno-missing-field-initializers",
"-Wno-pointer-arith",
"-Wno-sign-compare",
"-Wno-string-plus-int",
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-funsigned-char",
"-ffunction-sections",
"-fdata-sections",
"-fno-asynchronous-unwind-tables",
"-DTOYBOX_VENDOR=\"-android\"",
],
target: {
linux_glibc: {
local_include_dirs: ["android/linux"],
},
darwin: {
local_include_dirs: ["android/mac"],
cflags: [
// You can't have toybox cp(1) on macOS before 10.13.
"-mmacosx-version-min=10.13",
"-UMACOSX_DEPLOYMENT_TARGET",
"-DMACOSX_DEPLOYMENT_TARGET=10.13",
// macOS' getgroups(3) signature differs.
"-Wno-pointer-sign",
// diff.c defines MIN and MAX which (only on macOS) we're
// also getting from <sys/param.h>.
"-Wno-macro-redefined",
],
},
linux: {
srcs: linux_srcs,
},
android: {
local_include_dirs: ["android/device"],
srcs: device_srcs,
},
},
}
//###########################################
// toybox for /system, /vendor, and /recovery
//###########################################
cc_defaults {
name: "toybox-shared-defaults",
defaults: ["toybox-defaults"],
// This doesn't actually prevent us from dragging in libc++ at runtime
// on the device because libnetd_client.so is C++, but it improves host
// startup time.
stl: "none",
shared_libs: [
"libcrypto",
"libz",
],
target: {
android: {
shared_libs: [
"liblog",
"libprocessgroup",
"libselinux",
],
symlinks: toybox_symlinks,
},
},
}
cc_binary {
name: "toybox",
defaults: ["toybox-shared-defaults"],
host_supported: true,
recovery_available: true,
vendor_ramdisk_available: true,
}
cc_binary {
name: "toybox_vendor",
defaults: ["toybox-shared-defaults"],
vendor: true,
}
//###########################################
// Static toybox binaries for legacy devices
//###########################################
cc_binary {
name: "toybox-static",
defaults: ["toybox-defaults"],
static_executable: true,
compile_multilib: "both",
multilib: {
lib32: { suffix: "32", },
lib64: { suffix: "64", },
},
stl: "libc++_static",
static_libs: [
"libc",
"libm",
"libz",
"libbase",
"libcgrouprc",
"libcgrouprc_format",
"libcrypto_static",
"liblog",
"libprocessgroup",
"libselinux",
],
dist: {
targets: [
"sdk",
],
},
}
//###########################################
// Running the toybox tests
//###########################################
sh_test {
name: "toybox-tests",
src: "run-tests-on-android.sh",
filename: "run-tests-on-android.sh",
test_suites: ["general-tests"],
host_supported: true,
device_supported: false,
require_root:true,
data: [
"tests/**/*",
"scripts/runtest.sh",
],
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/aosp-riscv-bionic-porting/platform_external_toybox.git
[email protected]:aosp-riscv-bionic-porting/platform_external_toybox.git
aosp-riscv-bionic-porting
platform_external_toybox
platform_external_toybox
master

搜索帮助