mirror of
https://github.com/openharmony/third_party_toybox.git
synced 2026-06-30 21:37:54 -04:00
cf3e11bd38
Signed-off-by: chenjinxiang3 <chenjinxiang3@huawei.com>
1188 lines
26 KiB
Plaintext
1188 lines
26 KiB
Plaintext
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
|
|
# Must do steps below manually after getting the sources code
|
|
# from official website:
|
|
# 1. make defconfig or make menuconfig
|
|
# ==> To generate .config file.
|
|
# 2. NOBUILD=1 scripts/make.sh
|
|
# ==> To generate neccesary files like heades in generated
|
|
# direcotory.
|
|
|
|
# To add a toy:
|
|
# 1. Edit .config to enable the toy you want to add.
|
|
# 2. Edit toybox'sources below if neccesary.
|
|
# e. Add th toy to the symlinks.
|
|
if (defined(ohos_lite)) {
|
|
executable("toybox") {
|
|
# from middleware file build.sh
|
|
sources = [
|
|
"lib/args.c",
|
|
"lib/commas.c",
|
|
"lib/deflate.c",
|
|
"lib/dirtree.c",
|
|
"lib/elf.c",
|
|
"lib/env.c",
|
|
"lib/hash.c",
|
|
"lib/lib.c",
|
|
"lib/llist.c",
|
|
"lib/net.c",
|
|
"lib/password.c",
|
|
"lib/portability.c",
|
|
"lib/tty.c",
|
|
"lib/utf8.c",
|
|
"lib/xwrap.c",
|
|
"main.c",
|
|
"toys/android/sendevent.c",
|
|
"toys/lsb/dmesg.c",
|
|
"toys/lsb/gzip.c",
|
|
"toys/lsb/hostname.c",
|
|
"toys/lsb/killall.c",
|
|
"toys/lsb/md5sum.c",
|
|
"toys/lsb/mknod.c",
|
|
"toys/lsb/mktemp.c",
|
|
"toys/lsb/mount.c",
|
|
"toys/lsb/passwd.c",
|
|
"toys/lsb/pidof.c",
|
|
"toys/lsb/seq.c",
|
|
"toys/lsb/su.c",
|
|
"toys/lsb/sync.c",
|
|
"toys/lsb/umount.c",
|
|
"toys/net/ftpget.c",
|
|
"toys/net/ifconfig.c",
|
|
"toys/net/microcom.c",
|
|
"toys/net/netcat.c",
|
|
"toys/net/netstat.c",
|
|
"toys/net/ping.c",
|
|
"toys/net/rfkill.c",
|
|
"toys/net/sntp.c",
|
|
"toys/net/tunctl.c",
|
|
"toys/other/acpi.c",
|
|
"toys/other/ascii.c",
|
|
"toys/other/base64.c",
|
|
"toys/other/blkid.c",
|
|
"toys/other/blockdev.c",
|
|
"toys/other/bzcat.c",
|
|
"toys/other/chroot.c",
|
|
"toys/other/chrt.c",
|
|
"toys/other/clear.c",
|
|
"toys/other/count.c",
|
|
"toys/other/devmem.c",
|
|
"toys/other/dos2unix.c",
|
|
"toys/other/eject.c",
|
|
"toys/other/factor.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/hexedit.c",
|
|
"toys/other/hwclock.c",
|
|
"toys/other/i2ctools.c",
|
|
"toys/other/inotifyd.c",
|
|
"toys/other/insmod.c",
|
|
"toys/other/ionice.c",
|
|
"toys/other/login.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/mcookie.c",
|
|
"toys/other/mix.c",
|
|
"toys/other/mkpasswd.c",
|
|
"toys/other/mkswap.c",
|
|
"toys/other/modinfo.c",
|
|
"toys/other/mountpoint.c",
|
|
"toys/other/nbd_client.c",
|
|
"toys/other/nsenter.c",
|
|
"toys/other/oneit.c",
|
|
"toys/other/openvt.c",
|
|
"toys/other/partprobe.c",
|
|
"toys/other/pivot_root.c",
|
|
"toys/other/pmap.c",
|
|
"toys/other/printenv.c",
|
|
"toys/other/pwdx.c",
|
|
"toys/other/readahead.c",
|
|
"toys/other/readlink.c",
|
|
"toys/other/reboot.c",
|
|
"toys/other/reset.c",
|
|
"toys/other/rev.c",
|
|
"toys/other/rmmod.c",
|
|
"toys/other/setfattr.c",
|
|
"toys/other/setsid.c",
|
|
"toys/other/shred.c",
|
|
"toys/other/stat.c",
|
|
"toys/other/swapoff.c",
|
|
"toys/other/swapon.c",
|
|
"toys/other/switch_root.c",
|
|
"toys/other/sysctl.c",
|
|
"toys/other/tac.c",
|
|
"toys/other/taskset.c",
|
|
"toys/other/timeout.c",
|
|
"toys/other/truncate.c",
|
|
"toys/other/uptime.c",
|
|
"toys/other/usleep.c",
|
|
"toys/other/uuidgen.c",
|
|
"toys/other/vconfig.c",
|
|
"toys/other/vmstat.c",
|
|
"toys/other/w.c",
|
|
"toys/other/watch.c",
|
|
"toys/other/which.c",
|
|
"toys/other/xxd.c",
|
|
"toys/other/yes.c",
|
|
"toys/pending/bootchartd.c",
|
|
"toys/pending/diff.c",
|
|
"toys/pending/getty.c",
|
|
"toys/pending/lsof.c",
|
|
"toys/pending/mdev.c",
|
|
"toys/pending/more.c",
|
|
"toys/pending/route.c",
|
|
"toys/pending/telnetd.c",
|
|
"toys/posix/basename.c",
|
|
"toys/posix/cal.c",
|
|
"toys/posix/cat.c",
|
|
"toys/posix/chgrp.c",
|
|
"toys/posix/chmod.c",
|
|
"toys/posix/cksum.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/dd.c",
|
|
"toys/posix/df.c",
|
|
"toys/posix/dirname.c",
|
|
"toys/posix/du.c",
|
|
"toys/posix/echo.c",
|
|
"toys/posix/env.c",
|
|
"toys/posix/expand.c",
|
|
"toys/posix/false.c",
|
|
"toys/posix/file.c",
|
|
"toys/posix/find.c",
|
|
"toys/posix/getconf.c",
|
|
"toys/posix/grep.c",
|
|
"toys/posix/head.c",
|
|
"toys/posix/iconv.c",
|
|
"toys/posix/id.c",
|
|
"toys/posix/kill.c",
|
|
"toys/posix/link.c",
|
|
"toys/posix/ln.c",
|
|
"toys/posix/logger.c",
|
|
"toys/posix/ls.c",
|
|
"toys/posix/mkdir.c",
|
|
"toys/posix/mkfifo.c",
|
|
"toys/posix/nice.c",
|
|
"toys/posix/nl.c",
|
|
"toys/posix/nohup.c",
|
|
"toys/posix/od.c",
|
|
"toys/posix/paste.c",
|
|
"toys/posix/patch.c",
|
|
"toys/posix/printf.c",
|
|
"toys/posix/ps.c",
|
|
"toys/posix/pwd.c",
|
|
"toys/posix/renice.c",
|
|
"toys/posix/rm.c",
|
|
"toys/posix/rmdir.c",
|
|
"toys/posix/sed.c",
|
|
"toys/posix/sleep.c",
|
|
"toys/posix/sort.c",
|
|
"toys/posix/split.c",
|
|
"toys/posix/strings.c",
|
|
"toys/posix/tail.c",
|
|
"toys/posix/tar.c",
|
|
"toys/posix/tee.c",
|
|
"toys/posix/test.c",
|
|
"toys/posix/time.c",
|
|
"toys/posix/touch.c",
|
|
"toys/posix/true.c",
|
|
"toys/posix/tty.c",
|
|
"toys/posix/ulimit.c",
|
|
"toys/posix/uname.c",
|
|
"toys/posix/uniq.c",
|
|
"toys/posix/unlink.c",
|
|
"toys/posix/uudecode.c",
|
|
"toys/posix/uuencode.c",
|
|
"toys/posix/wc.c",
|
|
"toys/posix/who.c",
|
|
"toys/posix/xargs.c",
|
|
]
|
|
|
|
include_dirs = [ "./" ]
|
|
|
|
external_deps = ["zlib:libz"]
|
|
|
|
defines = [
|
|
"_DEFAULT_SOURCE",
|
|
"OHOS_LITE",
|
|
"TOYBOX_OH_ADAPT",
|
|
]
|
|
|
|
configs -= [ "//build/lite/config:language_c" ]
|
|
cflags_c = [
|
|
"-std=gnu11",
|
|
"-Wall",
|
|
"-Wundef",
|
|
"-Wno-char-subscripts",
|
|
"-Wno-implicit-function-declaration",
|
|
"-Wno-unused-variable",
|
|
"-Wno-unused-value",
|
|
"-Wno-incompatible-pointer-types",
|
|
"-Wno-int-conversion",
|
|
"-Wno-sign-compare",
|
|
"-Wno-format",
|
|
"-Wno-unused-result",
|
|
"-Os",
|
|
"-ffunction-sections",
|
|
"-fdata-sections",
|
|
"-fno-asynchronous-unwind-tables",
|
|
"-fPIE",
|
|
"-funsigned-char",
|
|
]
|
|
|
|
ldflags = [
|
|
"-pie",
|
|
"-Wl,-z,relro",
|
|
"-Wl,-z,now",
|
|
"-Wl,-z,noexecstack",
|
|
"-lm",
|
|
"-lcrypt",
|
|
]
|
|
}
|
|
|
|
cmd_long_path = [
|
|
"bin/chmod",
|
|
"bin/chown",
|
|
"bin/chroot",
|
|
"bin/chrt",
|
|
"bin/chvt",
|
|
"bin/cksum",
|
|
"bin/clear",
|
|
"bin/cmp",
|
|
"bin/comm",
|
|
"bin/count",
|
|
"bin/cp",
|
|
"bin/cpio",
|
|
"bin/crc32",
|
|
"bin/cut",
|
|
"bin/date",
|
|
"bin/devmem",
|
|
"bin/df",
|
|
"bin/diff",
|
|
"bin/dirname",
|
|
"bin/dmesg",
|
|
"bin/dnsdomainname",
|
|
"bin/dos2unix",
|
|
"bin/du",
|
|
"bin/echo",
|
|
"bin/egrep",
|
|
"bin/eject",
|
|
"bin/env",
|
|
"bin/expand",
|
|
"bin/factor",
|
|
"bin/fallocate",
|
|
"bin/false",
|
|
"bin/fgrep",
|
|
"bin/file",
|
|
"bin/find",
|
|
"bin/flock",
|
|
"bin/fmt",
|
|
"bin/free",
|
|
"bin/freeramdisk",
|
|
"bin/fsfreeze",
|
|
"bin/fstype",
|
|
"bin/fsync",
|
|
"bin/ftpget",
|
|
"bin/ftpput",
|
|
"bin/getconf",
|
|
"sbin/getty",
|
|
"bin/grep",
|
|
"bin/groups",
|
|
"bin/gunzip",
|
|
"bin/halt",
|
|
"bin/head",
|
|
"bin/help",
|
|
"bin/hexedit",
|
|
"bin/hostname",
|
|
"bin/hwclock",
|
|
"bin/i2cdetect",
|
|
"bin/i2cdump",
|
|
"bin/i2cget",
|
|
"bin/i2cset",
|
|
"bin/iconv",
|
|
"bin/id",
|
|
"bin/ifconfig",
|
|
"bin/inotifyd",
|
|
"bin/insmod",
|
|
"bin/install",
|
|
"bin/ionice",
|
|
"bin/iorenice",
|
|
"bin/iotop",
|
|
"bin/kill",
|
|
"bin/killall",
|
|
"bin/killall5",
|
|
"bin/link",
|
|
"bin/ln",
|
|
"bin/logger",
|
|
"bin/login",
|
|
"bin/logname",
|
|
"bin/losetup",
|
|
"bin/ls",
|
|
"bin/lsattr",
|
|
"bin/lsmod",
|
|
"bin/lsof",
|
|
"bin/lspci",
|
|
"bin/lsusb",
|
|
"bin/makedevs",
|
|
"bin/mcookie",
|
|
"bin/md5sum",
|
|
"bin/microcom",
|
|
"bin/mix",
|
|
"bin/mkdir",
|
|
"bin/mkfifo",
|
|
"bin/mknod",
|
|
"bin/mkpasswd",
|
|
"bin/mkswap",
|
|
"bin/mktemp",
|
|
"bin/modinfo",
|
|
"bin/more",
|
|
"bin/mount",
|
|
"bin/mountpoint",
|
|
"bin/mv",
|
|
"bin/nbd-client",
|
|
"bin/nc",
|
|
"bin/netcat",
|
|
"bin/netstat",
|
|
"bin/nice",
|
|
"bin/nl",
|
|
"bin/nohup",
|
|
"bin/nproc",
|
|
"bin/nsenter",
|
|
"bin/od",
|
|
"bin/oneit",
|
|
"bin/partprobe",
|
|
"bin/passwd",
|
|
"bin/paste",
|
|
"bin/patch",
|
|
"bin/pgrep",
|
|
"bin/pidof",
|
|
"bin/ping",
|
|
"bin/ping6",
|
|
"bin/pivot_root",
|
|
"bin/pkill",
|
|
"bin/pmap",
|
|
"bin/poweroff",
|
|
"bin/printenv",
|
|
"bin/printf",
|
|
"bin/prlimit",
|
|
"bin/ps",
|
|
"bin/pwd",
|
|
"bin/pwdx",
|
|
"bin/readahead",
|
|
"bin/readlink",
|
|
"bin/realpath",
|
|
"bin/reboot",
|
|
"bin/renice",
|
|
"bin/reset",
|
|
"bin/rev",
|
|
"bin/rfkill",
|
|
"bin/rm",
|
|
"bin/rmdir",
|
|
"bin/rmmod",
|
|
"bin/sed",
|
|
"bin/seq",
|
|
"bin/setfattr",
|
|
"bin/setsid",
|
|
"bin/shalsum",
|
|
"bin/shred",
|
|
"bin/sleep",
|
|
"bin/sntp",
|
|
"bin/sort",
|
|
"bin/split",
|
|
"bin/stat",
|
|
"bin/strings",
|
|
"bin/su",
|
|
"bin/swapoff",
|
|
"bin/swapon",
|
|
"bin/switch_root",
|
|
"bin/sync",
|
|
"bin/sysctrl",
|
|
"bin/tac",
|
|
"bin/tail",
|
|
"bin/tar",
|
|
"bin/taskset",
|
|
"bin/tee",
|
|
"bin/test",
|
|
"bin/time",
|
|
"bin/timeout",
|
|
"bin/top",
|
|
"bin/touch",
|
|
"bin/true",
|
|
"bin/truncate",
|
|
"bin/tty",
|
|
"bin/tunctl",
|
|
"bin/ulimit",
|
|
"bin/umount",
|
|
"bin/uname",
|
|
"bin/uniq",
|
|
"bin/unix2dos",
|
|
"bin/unlink",
|
|
"bin/unshare",
|
|
"bin/uptime",
|
|
"bin/usleep",
|
|
"bin/uudecode",
|
|
"bin/uuencode",
|
|
"bin/uuidgen",
|
|
"bin/vconfig",
|
|
"bin/vmstat",
|
|
"bin/w",
|
|
"bin/watch",
|
|
"bin/wc",
|
|
"bin/which",
|
|
"bin/who",
|
|
"bin/whoami",
|
|
"bin/xargs",
|
|
"bin/xxd",
|
|
"bin/yes",
|
|
"bin/zcat",
|
|
"bin/mdev",
|
|
"bin/telnetd",
|
|
"bin/route",
|
|
]
|
|
|
|
foreach(path, cmd_long_path) {
|
|
exec_script("install.py",
|
|
[
|
|
"--long_path",
|
|
path,
|
|
"--out_dir",
|
|
rebase_path("$root_out_dir"),
|
|
])
|
|
}
|
|
} else {
|
|
import("//build/ohos.gni")
|
|
import("toybox.gni")
|
|
|
|
ohos_executable("su") {
|
|
sources = [ "openharmony/su.c" ]
|
|
|
|
include_dirs = [ "./openharmony" ]
|
|
|
|
cflags_c = [
|
|
"-std=gnu11",
|
|
"-Wall",
|
|
"-Wundef",
|
|
"-Wno-char-subscripts",
|
|
"-Wno-implicit-function-declaration",
|
|
"-Wno-unused-variable",
|
|
"-Wno-unused-value",
|
|
"-Wno-incompatible-pointer-types",
|
|
"-Wno-int-conversion",
|
|
"-Wno-sign-compare",
|
|
"-Wno-format",
|
|
"-Wno-unused-result",
|
|
"-Os",
|
|
"-ffunction-sections",
|
|
"-fdata-sections",
|
|
"-fno-asynchronous-unwind-tables",
|
|
"-fPIE",
|
|
"-funsigned-char",
|
|
"-Wno-string-plus-int",
|
|
"-Wno-tautological-constant-compare",
|
|
"-Wno-string-conversion",
|
|
"-Wno-unused-but-set-variable",
|
|
]
|
|
|
|
ldflags = [
|
|
"-pie",
|
|
"-Wl,-z,relro",
|
|
"-Wl,-z,now",
|
|
"-Wl,-z,noexecstack",
|
|
"-lm",
|
|
"-lcrypt",
|
|
]
|
|
|
|
part_name = "toybox"
|
|
subsystem_name = "thirdparty"
|
|
install_images = [ "eng_system" ]
|
|
install_enable = true
|
|
}
|
|
|
|
ohos_executable("toybox") {
|
|
sources = [
|
|
"lib/args.c",
|
|
"lib/commas.c",
|
|
"lib/deflate.c",
|
|
"lib/dirtree.c",
|
|
"lib/elf.c",
|
|
"lib/env.c",
|
|
"lib/hash.c",
|
|
"lib/lib.c",
|
|
"lib/llist.c",
|
|
"lib/net.c",
|
|
"lib/password.c",
|
|
"lib/portability.c",
|
|
"lib/tty.c",
|
|
"lib/utf8.c",
|
|
"lib/xwrap.c",
|
|
"main.c",
|
|
"toys/android/sendevent.c",
|
|
"toys/lsb/dmesg.c",
|
|
"toys/lsb/gzip.c",
|
|
"toys/lsb/hostname.c",
|
|
"toys/lsb/killall.c",
|
|
"toys/lsb/md5sum.c",
|
|
"toys/lsb/mknod.c",
|
|
"toys/lsb/mktemp.c",
|
|
"toys/lsb/mount.c",
|
|
"toys/lsb/passwd.c",
|
|
"toys/lsb/pidof.c",
|
|
"toys/lsb/seq.c",
|
|
"toys/lsb/sync.c",
|
|
"toys/lsb/umount.c",
|
|
"toys/net/ftpget.c",
|
|
"toys/net/ifconfig.c",
|
|
"toys/net/microcom.c",
|
|
"toys/net/netcat.c",
|
|
"toys/net/netstat.c",
|
|
"toys/net/ping.c",
|
|
"toys/net/rfkill.c",
|
|
"toys/net/sntp.c",
|
|
"toys/net/tunctl.c",
|
|
"toys/other/acpi.c",
|
|
"toys/other/ascii.c",
|
|
"toys/other/base64.c",
|
|
"toys/other/blkid.c",
|
|
"toys/other/blockdev.c",
|
|
"toys/other/bzcat.c",
|
|
"toys/other/chroot.c",
|
|
"toys/other/chrt.c",
|
|
"toys/other/clear.c",
|
|
"toys/other/count.c",
|
|
"toys/other/devmem.c",
|
|
"toys/other/dos2unix.c",
|
|
"toys/other/eject.c",
|
|
"toys/other/factor.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/hexedit.c",
|
|
"toys/other/hwclock.c",
|
|
"toys/other/i2ctools.c",
|
|
"toys/other/inotifyd.c",
|
|
"toys/other/insmod.c",
|
|
"toys/other/ionice.c",
|
|
"toys/other/login.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/mcookie.c",
|
|
"toys/other/mix.c",
|
|
"toys/other/mkpasswd.c",
|
|
"toys/other/mkswap.c",
|
|
"toys/other/modinfo.c",
|
|
"toys/other/mountpoint.c",
|
|
"toys/other/nbd_client.c",
|
|
"toys/other/nsenter.c",
|
|
"toys/other/oneit.c",
|
|
"toys/other/openvt.c",
|
|
"toys/other/partprobe.c",
|
|
"toys/other/pivot_root.c",
|
|
"toys/other/pmap.c",
|
|
"toys/other/printenv.c",
|
|
"toys/other/pwdx.c",
|
|
"toys/other/readahead.c",
|
|
"toys/other/readlink.c",
|
|
"toys/other/reboot.c",
|
|
"toys/other/reset.c",
|
|
"toys/other/rev.c",
|
|
"toys/other/rmmod.c",
|
|
"toys/other/setfattr.c",
|
|
"toys/other/setsid.c",
|
|
"toys/other/shred.c",
|
|
"toys/other/stat.c",
|
|
"toys/other/swapoff.c",
|
|
"toys/other/swapon.c",
|
|
"toys/other/switch_root.c",
|
|
"toys/other/sysctl.c",
|
|
"toys/other/tac.c",
|
|
"toys/other/taskset.c",
|
|
"toys/other/timeout.c",
|
|
"toys/other/truncate.c",
|
|
"toys/other/uptime.c",
|
|
"toys/other/usleep.c",
|
|
"toys/other/uuidgen.c",
|
|
"toys/other/vconfig.c",
|
|
"toys/other/vmstat.c",
|
|
"toys/other/w.c",
|
|
"toys/other/watch.c",
|
|
"toys/other/which.c",
|
|
"toys/other/xxd.c",
|
|
"toys/other/yes.c",
|
|
"toys/pending/bootchartd.c",
|
|
"toys/pending/getty.c",
|
|
"toys/pending/lsof.c",
|
|
"toys/pending/mdev.c",
|
|
"toys/pending/more.c",
|
|
"toys/pending/route.c",
|
|
"toys/pending/telnetd.c",
|
|
"toys/posix/basename.c",
|
|
"toys/posix/cal.c",
|
|
"toys/posix/cat.c",
|
|
"toys/posix/chgrp.c",
|
|
"toys/posix/chmod.c",
|
|
"toys/posix/cksum.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/dd.c",
|
|
"toys/posix/df.c",
|
|
"toys/posix/dirname.c",
|
|
"toys/posix/du.c",
|
|
"toys/posix/echo.c",
|
|
"toys/posix/env.c",
|
|
"toys/posix/expand.c",
|
|
"toys/posix/false.c",
|
|
"toys/posix/file.c",
|
|
"toys/posix/find.c",
|
|
"toys/posix/getconf.c",
|
|
"toys/posix/grep.c",
|
|
"toys/posix/head.c",
|
|
"toys/posix/iconv.c",
|
|
"toys/posix/id.c",
|
|
"toys/posix/kill.c",
|
|
"toys/posix/link.c",
|
|
"toys/posix/ln.c",
|
|
"toys/posix/logger.c",
|
|
"toys/posix/ls.c",
|
|
"toys/posix/mkdir.c",
|
|
"toys/posix/mkfifo.c",
|
|
"toys/posix/nice.c",
|
|
"toys/posix/nl.c",
|
|
"toys/posix/nohup.c",
|
|
"toys/posix/od.c",
|
|
"toys/posix/paste.c",
|
|
"toys/posix/patch.c",
|
|
"toys/posix/printf.c",
|
|
"toys/posix/ps.c",
|
|
"toys/posix/pwd.c",
|
|
"toys/posix/renice.c",
|
|
"toys/posix/rm.c",
|
|
"toys/posix/rmdir.c",
|
|
"toys/posix/sed.c",
|
|
"toys/posix/sleep.c",
|
|
"toys/posix/sort.c",
|
|
"toys/posix/split.c",
|
|
"toys/posix/strings.c",
|
|
"toys/posix/tail.c",
|
|
"toys/posix/tar.c",
|
|
"toys/posix/tee.c",
|
|
"toys/posix/test.c",
|
|
"toys/posix/time.c",
|
|
"toys/posix/touch.c",
|
|
"toys/posix/true.c",
|
|
"toys/posix/tty.c",
|
|
"toys/posix/ulimit.c",
|
|
"toys/posix/uname.c",
|
|
"toys/posix/uniq.c",
|
|
"toys/posix/unlink.c",
|
|
"toys/posix/uudecode.c",
|
|
"toys/posix/uuencode.c",
|
|
"toys/posix/wc.c",
|
|
"toys/posix/who.c",
|
|
"toys/posix/xargs.c",
|
|
]
|
|
|
|
include_dirs = [ "./" ]
|
|
|
|
cflags_c = [
|
|
"-std=gnu11",
|
|
"-Wall",
|
|
"-Wundef",
|
|
"-Wno-char-subscripts",
|
|
"-Wno-implicit-function-declaration",
|
|
"-Wno-unused-variable",
|
|
"-Wno-unused-value",
|
|
"-Wno-incompatible-pointer-types",
|
|
"-Wno-int-conversion",
|
|
"-Wno-sign-compare",
|
|
"-Wno-format",
|
|
"-Wno-unused-result",
|
|
"-Os",
|
|
"-ffunction-sections",
|
|
"-fdata-sections",
|
|
"-fno-asynchronous-unwind-tables",
|
|
"-fPIE",
|
|
"-funsigned-char",
|
|
"-Wno-string-plus-int",
|
|
"-Wno-tautological-constant-compare",
|
|
"-Wno-string-conversion",
|
|
"-Wno-unused-but-set-variable",
|
|
]
|
|
|
|
if (!support_jsapi) {
|
|
cflags_c += [
|
|
"-Wno-unused-function",
|
|
"-Wno-misleading-indentation",
|
|
]
|
|
}
|
|
|
|
ldflags = [
|
|
"-pie",
|
|
"-Wl,-z,relro",
|
|
"-Wl,-z,now",
|
|
"-Wl,-z,noexecstack",
|
|
"-lm",
|
|
"-lcrypt",
|
|
]
|
|
|
|
if (build_selinux) {
|
|
cflags_c += [
|
|
"-D_GUN_SOURCE",
|
|
"-DUSE_PCRE2",
|
|
"-w",
|
|
"-DWITH_SELINUX",
|
|
"-DCUSTOM_GET_CONTEXT",
|
|
]
|
|
}
|
|
|
|
symlink_target_name = [
|
|
"acpi",
|
|
"arch",
|
|
"ascii",
|
|
"base64",
|
|
"basename",
|
|
"blockdev",
|
|
"bunzip2",
|
|
"bzcat",
|
|
"cal",
|
|
"cat",
|
|
"chattr",
|
|
"chcon",
|
|
"chgrp",
|
|
"chmod",
|
|
"chown",
|
|
"chroot",
|
|
"chrt",
|
|
"chvt",
|
|
"cksum",
|
|
"clear",
|
|
"cmp",
|
|
"comm",
|
|
"count",
|
|
"cp",
|
|
"cpio",
|
|
"crc32",
|
|
"cut",
|
|
"date",
|
|
"dd",
|
|
"devmem",
|
|
"df",
|
|
"dirname",
|
|
"dmesg",
|
|
"dnsdomainname",
|
|
"dos2unix",
|
|
"du",
|
|
"echo",
|
|
"egrep",
|
|
"eject",
|
|
"env",
|
|
"expand",
|
|
"factor",
|
|
"fallocate",
|
|
"false",
|
|
"fgrep",
|
|
"file",
|
|
"find",
|
|
"flock",
|
|
"fmt",
|
|
"free",
|
|
"freeramdisk",
|
|
"fsfreeze",
|
|
"fstype",
|
|
"fsync",
|
|
"ftpget",
|
|
"ftpput",
|
|
"getconf",
|
|
"grep",
|
|
"groups",
|
|
"gunzip",
|
|
"gzip",
|
|
"halt",
|
|
"head",
|
|
"help",
|
|
"hexedit",
|
|
"hostname",
|
|
"hwclock",
|
|
"i2cdetect",
|
|
"i2cdump",
|
|
"i2cget",
|
|
"i2cset",
|
|
"iconv",
|
|
"id",
|
|
"ifconfig",
|
|
"inotifyd",
|
|
"insmod",
|
|
"install",
|
|
"ionice",
|
|
"iorenice",
|
|
"iotop",
|
|
"kill",
|
|
"killall",
|
|
"killall5",
|
|
"link",
|
|
"ln",
|
|
"logger",
|
|
"login",
|
|
"logname",
|
|
"losetup",
|
|
"ls",
|
|
"lsattr",
|
|
"lsmod",
|
|
"lsof",
|
|
"lspci",
|
|
"lsusb",
|
|
"makedevs",
|
|
"mcookie",
|
|
"md5sum",
|
|
"microcom",
|
|
"mix",
|
|
"mkdir",
|
|
"mkfifo",
|
|
"mknod",
|
|
"mkpasswd",
|
|
"mkswap",
|
|
"mktemp",
|
|
"modinfo",
|
|
"more",
|
|
"mount",
|
|
"mountpoint",
|
|
"mv",
|
|
"nbd-client",
|
|
"netstat",
|
|
"nice",
|
|
"nl",
|
|
"nohup",
|
|
"nproc",
|
|
"nsenter",
|
|
"od",
|
|
"oneit",
|
|
"partprobe",
|
|
"passwd",
|
|
"paste",
|
|
"patch",
|
|
"pgrep",
|
|
"pidof",
|
|
"ping",
|
|
"ping6",
|
|
"pivot_root",
|
|
"pkill",
|
|
"pmap",
|
|
"poweroff",
|
|
"printenv",
|
|
"printf",
|
|
"prlimit",
|
|
"ps",
|
|
"pwd",
|
|
"pwdx",
|
|
"readahead",
|
|
"readlink",
|
|
"realpath",
|
|
"renice",
|
|
"reset",
|
|
"restorecon",
|
|
"rev",
|
|
"rfkill",
|
|
"rm",
|
|
"rmdir",
|
|
"rmmod",
|
|
"sed",
|
|
"sendevent",
|
|
"seq",
|
|
"setfattr",
|
|
"setsid",
|
|
"sha1sum",
|
|
"sha256sum",
|
|
"shred",
|
|
"sleep",
|
|
"sntp",
|
|
"sort",
|
|
"split",
|
|
"stat",
|
|
"strings",
|
|
"swapoff",
|
|
"swapon",
|
|
"switch_root",
|
|
"sync",
|
|
"sysctl",
|
|
"tac",
|
|
"tail",
|
|
"tar",
|
|
"taskset",
|
|
"tee",
|
|
"test",
|
|
"time",
|
|
"timeout",
|
|
"top",
|
|
"touch",
|
|
"true",
|
|
"truncate",
|
|
"tty",
|
|
"tunctl",
|
|
"ulimit",
|
|
"umount",
|
|
"uname",
|
|
"uniq",
|
|
"unix2dos",
|
|
"unlink",
|
|
"unshare",
|
|
"uptime",
|
|
"usleep",
|
|
"uudecode",
|
|
"uuencode",
|
|
"uuidgen",
|
|
"vconfig",
|
|
"vmstat",
|
|
"w",
|
|
"watch",
|
|
"wc",
|
|
"which",
|
|
"who",
|
|
"whoami",
|
|
"xargs",
|
|
"xxd",
|
|
"yes",
|
|
"zcat",
|
|
]
|
|
|
|
deps = []
|
|
defines = [
|
|
"_DEFAULT_SOURCE",
|
|
"TOYBOX_OH_ADAPT",
|
|
]
|
|
|
|
external_deps = ["zlib:libz"]
|
|
|
|
if (build_selinux) {
|
|
sources += [ "toys/other/chcon.c" ]
|
|
external_deps += [
|
|
"openssl:libcrypto_shared",
|
|
"openssl:libssl_shared",
|
|
"selinux:libselinux",
|
|
]
|
|
symlink_target_name += [ "chcon" ]
|
|
symlink_target_name -= [ "restorecon" ]
|
|
|
|
if (toybox_extended_cmd) {
|
|
defines += [ "TOYBOX_EXTENDED_CMD" ]
|
|
sources += [
|
|
"toys/net/wget.c",
|
|
"toys/pending/awk.c",
|
|
"toys/pending/diff.c",
|
|
"toys/pending/expr.c",
|
|
"toys/pending/getfattr.c",
|
|
"toys/pending/ipcs.c",
|
|
"toys/pending/telnet.c",
|
|
"toys/pending/tr.c",
|
|
"toys/pending/traceroute.c",
|
|
]
|
|
symlink_target_name += [
|
|
"traceroute",
|
|
"traceroute6",
|
|
"telnet",
|
|
"wget",
|
|
"awk",
|
|
"diff",
|
|
"expr",
|
|
"ipcs",
|
|
"route",
|
|
"sha384sum",
|
|
"sha512sum",
|
|
"tr",
|
|
"getfattr",
|
|
"netcat",
|
|
]
|
|
}
|
|
|
|
if (toybox_feature_support_usr_symlink) {
|
|
symlink_target_name += [
|
|
"../usr/bin/awk",
|
|
"../usr/bin/base64",
|
|
"../usr/bin/basename",
|
|
"../usr/bin/cal",
|
|
"../usr/bin/cat",
|
|
"../usr/bin/chmod",
|
|
"../usr/bin/cksum",
|
|
"../usr/bin/clear",
|
|
"../usr/bin/cmp",
|
|
"../usr/bin/comm",
|
|
"../usr/bin/count",
|
|
"../usr/bin/cp",
|
|
"../usr/bin/cpio",
|
|
"../usr/bin/crc32",
|
|
"../usr/bin/cut",
|
|
"../usr/bin/date",
|
|
"../usr/bin/dd",
|
|
"../usr/bin/df",
|
|
"../usr/bin/diff",
|
|
"../usr/bin/dirname",
|
|
"../usr/bin/dos2unix",
|
|
"../usr/bin/du",
|
|
"../usr/bin/echo",
|
|
"../usr/bin/egrep",
|
|
"../usr/bin/env",
|
|
"../usr/bin/expand",
|
|
"../usr/bin/expr",
|
|
"../usr/bin/factor",
|
|
"../usr/bin/false",
|
|
"../usr/bin/fgrep",
|
|
"../usr/bin/file",
|
|
"../usr/bin/find",
|
|
"../usr/bin/flock",
|
|
"../usr/bin/fmt",
|
|
"../usr/bin/free",
|
|
"../usr/bin/ftpget",
|
|
"../usr/bin/ftpput",
|
|
"../usr/bin/getconf",
|
|
"../usr/bin/getfattr",
|
|
"../usr/bin/grep",
|
|
"../usr/bin/gunzip",
|
|
"../usr/bin/gzip",
|
|
"../usr/bin/head",
|
|
"../usr/bin/help",
|
|
"../usr/bin/hexedit",
|
|
"../usr/bin/hostname",
|
|
"../usr/bin/iconv",
|
|
"../usr/bin/ifconfig",
|
|
"../usr/bin/iotop",
|
|
"../usr/bin/ipcs",
|
|
"../usr/bin/kill",
|
|
"../usr/bin/killall",
|
|
"../usr/bin/ln",
|
|
"../usr/bin/ls",
|
|
"../usr/bin/lsattr",
|
|
"../usr/bin/lsmod",
|
|
"../usr/bin/mcookie",
|
|
"../usr/bin/md5sum",
|
|
"../usr/bin/mkdir",
|
|
"../usr/bin/mkpasswd",
|
|
"../usr/bin/mktemp",
|
|
"../usr/bin/more",
|
|
"../usr/bin/mount",
|
|
"../usr/bin/mountpoint",
|
|
"../usr/bin/mv",
|
|
"../usr/bin/netcat",
|
|
"../usr/bin/netstat",
|
|
"../usr/bin/nl",
|
|
"../usr/bin/nohup",
|
|
"../usr/bin/nproc",
|
|
"../usr/bin/od",
|
|
"../usr/bin/paste",
|
|
"../usr/bin/patch",
|
|
"../usr/bin/pgrep",
|
|
"../usr/bin/pidof",
|
|
"../usr/bin/ping",
|
|
"../usr/bin/ping6",
|
|
"../usr/bin/pkill",
|
|
"../usr/bin/printenv",
|
|
"../usr/bin/printf",
|
|
"../usr/bin/ps",
|
|
"../usr/bin/pwd",
|
|
"../usr/bin/pwdx",
|
|
"../usr/bin/readahead",
|
|
"../usr/bin/readlink",
|
|
"../usr/bin/realpath",
|
|
"../usr/bin/reset",
|
|
"../usr/bin/rev",
|
|
"../usr/bin/rm",
|
|
"../usr/bin/rmdir",
|
|
"../usr/bin/route",
|
|
"../usr/bin/sed",
|
|
"../usr/bin/seq",
|
|
"../usr/bin/setfattr",
|
|
"../usr/bin/sha1sum",
|
|
"../usr/bin/sha256sum",
|
|
"../usr/bin/sha384sum",
|
|
"../usr/bin/sha512sum",
|
|
"../usr/bin/shred",
|
|
"../usr/bin/sleep",
|
|
"../usr/bin/sort",
|
|
"../usr/bin/split",
|
|
"../usr/bin/stat",
|
|
"../usr/bin/strings",
|
|
"../usr/bin/sync",
|
|
"../usr/bin/sysctl",
|
|
"../usr/bin/tac",
|
|
"../usr/bin/tail",
|
|
"../usr/bin/tar",
|
|
"../usr/bin/taskset",
|
|
"../usr/bin/tee",
|
|
"../usr/bin/telnet",
|
|
"../usr/bin/test",
|
|
"../usr/bin/time",
|
|
"../usr/bin/timeout",
|
|
"../usr/bin/top",
|
|
"../usr/bin/touch",
|
|
"../usr/bin/tr",
|
|
"../usr/bin/traceroute",
|
|
"../usr/bin/traceroute6",
|
|
"../usr/bin/true",
|
|
"../usr/bin/truncate",
|
|
"../usr/bin/tty",
|
|
"../usr/bin/uname",
|
|
"../usr/bin/uniq",
|
|
"../usr/bin/unix2dos",
|
|
"../usr/bin/unlink",
|
|
"../usr/bin/uptime",
|
|
"../usr/bin/usleep",
|
|
"../usr/bin/uudecode",
|
|
"../usr/bin/uuencode",
|
|
"../usr/bin/uuidgen",
|
|
"../usr/bin/vmstat",
|
|
"../usr/bin/watch",
|
|
"../usr/bin/wc",
|
|
"../usr/bin/wget",
|
|
"../usr/bin/which",
|
|
"../usr/bin/xargs",
|
|
"../usr/bin/xxd",
|
|
"../usr/bin/yes",
|
|
"../usr/bin/zcat",
|
|
]
|
|
}
|
|
|
|
if (toybox_enable_brctl) {
|
|
defines += [ "TOYBOX_ENABLE_BRCTL" ]
|
|
sources += [ "toys/pending/brctl.c" ]
|
|
symlink_target_name += [ "brctl" ]
|
|
}
|
|
|
|
if (build_variant == "user") {
|
|
defines += [ "TOYBOX_BUILD_USER" ]
|
|
}
|
|
}
|
|
|
|
part_name = "toybox"
|
|
subsystem_name = "thirdparty"
|
|
install_images = [
|
|
"system",
|
|
"ramdisk",
|
|
"updater",
|
|
]
|
|
install_enable = true
|
|
}
|
|
}
|