• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
2# Must do steps below manually after getting the sources code
3# from official website:
4# 1. make defconfig or make menuconfig
5#   ==> To generate .config file.
6# 2. NOBUILD=1 scripts/make.sh
7#   ==> To generate neccesary files like heades in generated
8# direcotory.
9
10# To add a toy:
11# 1. Edit .config to enable the toy you want to add.
12# 2. Edit toybox'sources below if neccesary.
13# e. Add th toy to the symlinks.
14if (defined(ohos_lite)) {
15  executable("toybox") {
16    # from middleware file build.sh
17    sources = [
18      "lib/args.c",
19      "lib/commas.c",
20      "lib/deflate.c",
21      "lib/dirtree.c",
22      "lib/env.c",
23      "lib/help.c",
24      "lib/lib.c",
25      "lib/linestack.c",
26      "lib/llist.c",
27      "lib/net.c",
28      "lib/password.c",
29      "lib/portability.c",
30      "lib/tty.c",
31      "lib/xwrap.c",
32      "main.c",
33      "toys/android/sendevent.c",
34      "toys/lsb/dmesg.c",
35      "toys/lsb/gzip.c",
36      "toys/lsb/hostname.c",
37      "toys/lsb/killall.c",
38      "toys/lsb/md5sum.c",
39      "toys/lsb/mknod.c",
40      "toys/lsb/mktemp.c",
41      "toys/lsb/mount.c",
42      "toys/lsb/passwd.c",
43      "toys/lsb/pidof.c",
44      "toys/lsb/seq.c",
45      "toys/lsb/su.c",
46      "toys/lsb/sync.c",
47      "toys/lsb/umount.c",
48      "toys/net/ftpget.c",
49      "toys/net/ifconfig.c",
50      "toys/net/microcom.c",
51      "toys/net/netcat.c",
52      "toys/net/netstat.c",
53      "toys/net/ping.c",
54      "toys/net/rfkill.c",
55      "toys/net/sntp.c",
56      "toys/net/tunctl.c",
57      "toys/other/acpi.c",
58      "toys/other/ascii.c",
59      "toys/other/base64.c",
60      "toys/other/blkid.c",
61      "toys/other/blockdev.c",
62      "toys/other/bzcat.c",
63      "toys/other/chroot.c",
64      "toys/other/chrt.c",
65      "toys/other/chvt.c",
66      "toys/other/clear.c",
67      "toys/other/count.c",
68      "toys/other/devmem.c",
69      "toys/other/dos2unix.c",
70      "toys/other/eject.c",
71      "toys/other/factor.c",
72      "toys/other/fallocate.c",
73      "toys/other/flock.c",
74      "toys/other/fmt.c",
75      "toys/other/free.c",
76      "toys/other/freeramdisk.c",
77      "toys/other/fsfreeze.c",
78      "toys/other/fsync.c",
79      "toys/other/help.c",
80      "toys/other/hexedit.c",
81      "toys/other/hwclock.c",
82      "toys/other/i2ctools.c",
83      "toys/other/inotifyd.c",
84      "toys/other/insmod.c",
85      "toys/other/ionice.c",
86      "toys/other/login.c",
87      "toys/other/losetup.c",
88      "toys/other/lsattr.c",
89      "toys/other/lsmod.c",
90      "toys/other/lspci.c",
91      "toys/other/lsusb.c",
92      "toys/other/makedevs.c",
93      "toys/other/mcookie.c",
94      "toys/other/mix.c",
95      "toys/other/mkpasswd.c",
96      "toys/other/mkswap.c",
97      "toys/other/modinfo.c",
98      "toys/other/mountpoint.c",
99      "toys/other/nbd_client.c",
100      "toys/other/nsenter.c",
101      "toys/other/oneit.c",
102      "toys/other/partprobe.c",
103      "toys/other/pivot_root.c",
104      "toys/other/pmap.c",
105      "toys/other/printenv.c",
106      "toys/other/pwdx.c",
107      "toys/other/readahead.c",
108      "toys/other/readlink.c",
109      "toys/other/realpath.c",
110      "toys/other/reboot.c",
111      "toys/other/reset.c",
112      "toys/other/rev.c",
113      "toys/other/rmmod.c",
114      "toys/other/setfattr.c",
115      "toys/other/setsid.c",
116      "toys/other/shred.c",
117      "toys/other/stat.c",
118      "toys/other/swapoff.c",
119      "toys/other/swapon.c",
120      "toys/other/switch_root.c",
121      "toys/other/sysctl.c",
122      "toys/other/tac.c",
123      "toys/other/taskset.c",
124      "toys/other/timeout.c",
125      "toys/other/truncate.c",
126      "toys/other/uptime.c",
127      "toys/other/usleep.c",
128      "toys/other/uuidgen.c",
129      "toys/other/vconfig.c",
130      "toys/other/vmstat.c",
131      "toys/other/w.c",
132      "toys/other/watch.c",
133      "toys/other/which.c",
134      "toys/other/xxd.c",
135      "toys/other/yes.c",
136      "toys/pending/bootchartd.c",
137      "toys/pending/dd.c",
138      "toys/pending/diff.c",
139      "toys/pending/getty.c",
140      "toys/pending/lsof.c",
141      "toys/pending/mdev.c",
142      "toys/pending/more.c",
143      "toys/pending/route.c",
144      "toys/pending/telnetd.c",
145      "toys/posix/basename.c",
146      "toys/posix/cal.c",
147      "toys/posix/cat.c",
148      "toys/posix/chgrp.c",
149      "toys/posix/chmod.c",
150      "toys/posix/cksum.c",
151      "toys/posix/cmp.c",
152      "toys/posix/comm.c",
153      "toys/posix/cp.c",
154      "toys/posix/cpio.c",
155      "toys/posix/cut.c",
156      "toys/posix/date.c",
157      "toys/posix/df.c",
158      "toys/posix/dirname.c",
159      "toys/posix/du.c",
160      "toys/posix/echo.c",
161      "toys/posix/env.c",
162      "toys/posix/expand.c",
163      "toys/posix/false.c",
164      "toys/posix/file.c",
165      "toys/posix/find.c",
166      "toys/posix/getconf.c",
167      "toys/posix/grep.c",
168      "toys/posix/head.c",
169      "toys/posix/iconv.c",
170      "toys/posix/id.c",
171      "toys/posix/kill.c",
172      "toys/posix/link.c",
173      "toys/posix/ln.c",
174      "toys/posix/logger.c",
175      "toys/posix/ls.c",
176      "toys/posix/mkdir.c",
177      "toys/posix/mkfifo.c",
178      "toys/posix/nice.c",
179      "toys/posix/nl.c",
180      "toys/posix/nohup.c",
181      "toys/posix/od.c",
182      "toys/posix/paste.c",
183      "toys/posix/patch.c",
184      "toys/posix/printf.c",
185      "toys/posix/ps.c",
186      "toys/posix/pwd.c",
187      "toys/posix/renice.c",
188      "toys/posix/rm.c",
189      "toys/posix/rmdir.c",
190      "toys/posix/sed.c",
191      "toys/posix/sleep.c",
192      "toys/posix/sort.c",
193      "toys/posix/split.c",
194      "toys/posix/strings.c",
195      "toys/posix/tail.c",
196      "toys/posix/tar.c",
197      "toys/posix/tee.c",
198      "toys/posix/test.c",
199      "toys/posix/time.c",
200      "toys/posix/touch.c",
201      "toys/posix/true.c",
202      "toys/posix/tty.c",
203      "toys/posix/ulimit.c",
204      "toys/posix/uname.c",
205      "toys/posix/uniq.c",
206      "toys/posix/unlink.c",
207      "toys/posix/uudecode.c",
208      "toys/posix/uuencode.c",
209      "toys/posix/wc.c",
210      "toys/posix/who.c",
211      "toys/posix/xargs.c",
212    ]
213
214    include_dirs = [ "./" ]
215
216    defines = [
217      "_DEFAULT_SOURCE",
218      "OHOS_LITE",
219      "TOYBOX_OH_ADAPT",
220    ]
221
222    configs -= [ "//build/lite/config:language_c" ]
223    cflags_c = [
224      "-std=gnu11",
225      "-Wall",
226      "-Wundef",
227      "-Wno-char-subscripts",
228      "-Wno-implicit-function-declaration",
229      "-Wno-unused-variable",
230      "-Wno-unused-value",
231      "-Wno-incompatible-pointer-types",
232      "-Wno-int-conversion",
233      "-Wno-sign-compare",
234      "-Wno-format",
235      "-Wno-unused-result",
236      "-Os",
237      "-ffunction-sections",
238      "-fdata-sections",
239      "-fno-asynchronous-unwind-tables",
240      "-fPIE",
241      "-funsigned-char",
242    ]
243
244    ldflags = [
245      "-pie",
246      "-Wl,-z,relro",
247      "-Wl,-z,now",
248      "-Wl,-z,noexecstack",
249      "-lm",
250      "-lcrypt",
251    ]
252  }
253
254  cmd_long_path = [
255    "bin/chmod",
256    "bin/chown",
257    "bin/chroot",
258    "bin/chrt",
259    "bin/chvt",
260    "bin/cksum",
261    "bin/clear",
262    "bin/cmp",
263    "bin/comm",
264    "bin/count",
265    "bin/cp",
266    "bin/cpio",
267    "bin/crc32",
268    "bin/cut",
269    "bin/date",
270    "bin/devmem",
271    "bin/df",
272    "bin/diff",
273    "bin/dirname",
274    "bin/dmesg",
275    "bin/dnsdomainname",
276    "bin/dos2unix",
277    "bin/du",
278    "bin/echo",
279    "bin/egrep",
280    "bin/eject",
281    "bin/env",
282    "bin/expand",
283    "bin/factor",
284    "bin/fallocate",
285    "bin/false",
286    "bin/fgrep",
287    "bin/file",
288    "bin/find",
289    "bin/flock",
290    "bin/fmt",
291    "bin/free",
292    "bin/freeramdisk",
293    "bin/fsfreeze",
294    "bin/fstype",
295    "bin/fsync",
296    "bin/ftpget",
297    "bin/ftpput",
298    "bin/getconf",
299    "sbin/getty",
300    "bin/grep",
301    "bin/groups",
302    "bin/gunzip",
303    "bin/halt",
304    "bin/head",
305    "bin/help",
306    "bin/hexedit",
307    "bin/hostname",
308    "bin/hwclock",
309    "bin/i2cdetect",
310    "bin/i2cdump",
311    "bin/i2cget",
312    "bin/i2cset",
313    "bin/iconv",
314    "bin/id",
315    "bin/ifconfig",
316    "bin/inotifyd",
317    "bin/insmod",
318    "bin/install",
319    "bin/ionice",
320    "bin/iorenice",
321    "bin/iotop",
322    "bin/kill",
323    "bin/killall",
324    "bin/killall5",
325    "bin/link",
326    "bin/ln",
327    "bin/logger",
328    "bin/login",
329    "bin/logname",
330    "bin/losetup",
331    "bin/ls",
332    "bin/lsattr",
333    "bin/lsmod",
334    "bin/lsof",
335    "bin/lspci",
336    "bin/lsusb",
337    "bin/makedevs",
338    "bin/mcookie",
339    "bin/md5sum",
340    "bin/microcom",
341    "bin/mix",
342    "bin/mkdir",
343    "bin/mkfifo",
344    "bin/mknod",
345    "bin/mkpasswd",
346    "bin/mkswap",
347    "bin/mktemp",
348    "bin/modinfo",
349    "bin/more",
350    "bin/mount",
351    "bin/mountpoint",
352    "bin/mv",
353    "bin/nbd-client",
354    "bin/nc",
355    "bin/netcat",
356    "bin/netstat",
357    "bin/nice",
358    "bin/nl",
359    "bin/nohup",
360    "bin/nproc",
361    "bin/nsenter",
362    "bin/od",
363    "bin/oneit",
364    "bin/partprobe",
365    "bin/passwd",
366    "bin/paste",
367    "bin/patch",
368    "bin/pgrep",
369    "bin/pidof",
370    "bin/ping",
371    "bin/ping6",
372    "bin/pivot_root",
373    "bin/pkill",
374    "bin/pmap",
375    "bin/poweroff",
376    "bin/printenv",
377    "bin/printf",
378    "bin/prlimit",
379    "bin/ps",
380    "bin/pwd",
381    "bin/pwdx",
382    "bin/readahead",
383    "bin/readlink",
384    "bin/realpath",
385    "bin/reboot",
386    "bin/renice",
387    "bin/reset",
388    "bin/rev",
389    "bin/rfkill",
390    "bin/rm",
391    "bin/rmdir",
392    "bin/rmmod",
393    "bin/sed",
394    "bin/seq",
395    "bin/setfattr",
396    "bin/setsid",
397    "bin/shalsum",
398    "bin/shred",
399    "bin/sleep",
400    "bin/sntp",
401    "bin/sort",
402    "bin/split",
403    "bin/stat",
404    "bin/strings",
405    "bin/su",
406    "bin/swapoff",
407    "bin/swapon",
408    "bin/switch_root",
409    "bin/sync",
410    "bin/sysctrl",
411    "bin/tac",
412    "bin/tail",
413    "bin/tar",
414    "bin/taskset",
415    "bin/tee",
416    "bin/test",
417    "bin/time",
418    "bin/timeout",
419    "bin/top",
420    "bin/touch",
421    "bin/true",
422    "bin/truncate",
423    "bin/tty",
424    "bin/tunctl",
425    "bin/ulimit",
426    "bin/umount",
427    "bin/uname",
428    "bin/uniq",
429    "bin/unix2dos",
430    "bin/unlink",
431    "bin/unshare",
432    "bin/uptime",
433    "bin/usleep",
434    "bin/uudecode",
435    "bin/uuencode",
436    "bin/uuidgen",
437    "bin/vconfig",
438    "bin/vmstat",
439    "bin/w",
440    "bin/watch",
441    "bin/wc",
442    "bin/which",
443    "bin/who",
444    "bin/whoami",
445    "bin/xargs",
446    "bin/xxd",
447    "bin/yes",
448    "bin/zcat",
449    "bin/mdev",
450    "bin/telnetd",
451    "bin/route",
452  ]
453
454  foreach(path, cmd_long_path) {
455    exec_script("install.py",
456                [
457                  "--long_path",
458                  path,
459                  "--out_dir",
460                  rebase_path("$root_out_dir"),
461                ])
462  }
463} else {
464  import("//build/ohos.gni")
465  import("toybox.gni")
466
467  ohos_executable("su") {
468    sources = [ "openharmony/su.c" ]
469
470    include_dirs = [ "./openharmony" ]
471
472    cflags_c = [
473      "-std=gnu11",
474      "-Wall",
475      "-Wundef",
476      "-Wno-char-subscripts",
477      "-Wno-implicit-function-declaration",
478      "-Wno-unused-variable",
479      "-Wno-unused-value",
480      "-Wno-incompatible-pointer-types",
481      "-Wno-int-conversion",
482      "-Wno-sign-compare",
483      "-Wno-format",
484      "-Wno-unused-result",
485      "-Os",
486      "-ffunction-sections",
487      "-fdata-sections",
488      "-fno-asynchronous-unwind-tables",
489      "-fPIE",
490      "-funsigned-char",
491      "-Wno-string-plus-int",
492      "-Wno-tautological-constant-compare",
493      "-Wno-string-conversion",
494      "-Wno-unused-but-set-variable",
495    ]
496
497    ldflags = [
498      "-pie",
499      "-Wl,-z,relro",
500      "-Wl,-z,now",
501      "-Wl,-z,noexecstack",
502      "-lm",
503      "-lcrypt",
504    ]
505
506    part_name = "toybox"
507    subsystem_name = "thirdparty"
508    install_images = [ "eng_system" ]
509    install_enable = true
510  }
511
512  ohos_executable("toybox") {
513    sources = [
514      "lib/args.c",
515      "lib/commas.c",
516      "lib/deflate.c",
517      "lib/dirtree.c",
518      "lib/env.c",
519      "lib/help.c",
520      "lib/lib.c",
521      "lib/linestack.c",
522      "lib/llist.c",
523      "lib/net.c",
524      "lib/password.c",
525      "lib/portability.c",
526      "lib/tty.c",
527      "lib/xwrap.c",
528      "main.c",
529      "toys/android/sendevent.c",
530      "toys/lsb/dmesg.c",
531      "toys/lsb/gzip.c",
532      "toys/lsb/hostname.c",
533      "toys/lsb/killall.c",
534      "toys/lsb/md5sum.c",
535      "toys/lsb/mknod.c",
536      "toys/lsb/mktemp.c",
537      "toys/lsb/mount.c",
538      "toys/lsb/passwd.c",
539      "toys/lsb/pidof.c",
540      "toys/lsb/seq.c",
541      "toys/lsb/sync.c",
542      "toys/lsb/umount.c",
543      "toys/net/ftpget.c",
544      "toys/net/ifconfig.c",
545      "toys/net/microcom.c",
546      "toys/net/netcat.c",
547      "toys/net/netstat.c",
548      "toys/net/ping.c",
549      "toys/net/rfkill.c",
550      "toys/net/sntp.c",
551      "toys/net/tunctl.c",
552      "toys/other/acpi.c",
553      "toys/other/ascii.c",
554      "toys/other/base64.c",
555      "toys/other/blkid.c",
556      "toys/other/blockdev.c",
557      "toys/other/bzcat.c",
558      "toys/other/chroot.c",
559      "toys/other/chrt.c",
560      "toys/other/chvt.c",
561      "toys/other/clear.c",
562      "toys/other/count.c",
563      "toys/other/devmem.c",
564      "toys/other/dos2unix.c",
565      "toys/other/eject.c",
566      "toys/other/factor.c",
567      "toys/other/fallocate.c",
568      "toys/other/flock.c",
569      "toys/other/fmt.c",
570      "toys/other/free.c",
571      "toys/other/freeramdisk.c",
572      "toys/other/fsfreeze.c",
573      "toys/other/fsync.c",
574      "toys/other/help.c",
575      "toys/other/hexedit.c",
576      "toys/other/hwclock.c",
577      "toys/other/i2ctools.c",
578      "toys/other/inotifyd.c",
579      "toys/other/insmod.c",
580      "toys/other/ionice.c",
581      "toys/other/login.c",
582      "toys/other/losetup.c",
583      "toys/other/lsattr.c",
584      "toys/other/lsmod.c",
585      "toys/other/lspci.c",
586      "toys/other/lsusb.c",
587      "toys/other/makedevs.c",
588      "toys/other/mcookie.c",
589      "toys/other/mix.c",
590      "toys/other/mkpasswd.c",
591      "toys/other/mkswap.c",
592      "toys/other/modinfo.c",
593      "toys/other/mountpoint.c",
594      "toys/other/nbd_client.c",
595      "toys/other/nsenter.c",
596      "toys/other/oneit.c",
597      "toys/other/partprobe.c",
598      "toys/other/pivot_root.c",
599      "toys/other/pmap.c",
600      "toys/other/printenv.c",
601      "toys/other/pwdx.c",
602      "toys/other/readahead.c",
603      "toys/other/readlink.c",
604      "toys/other/realpath.c",
605      "toys/other/reboot.c",
606      "toys/other/reset.c",
607      "toys/other/rev.c",
608      "toys/other/rmmod.c",
609      "toys/other/setfattr.c",
610      "toys/other/setsid.c",
611      "toys/other/shred.c",
612      "toys/other/stat.c",
613      "toys/other/swapoff.c",
614      "toys/other/swapon.c",
615      "toys/other/switch_root.c",
616      "toys/other/sysctl.c",
617      "toys/other/tac.c",
618      "toys/other/taskset.c",
619      "toys/other/timeout.c",
620      "toys/other/truncate.c",
621      "toys/other/uptime.c",
622      "toys/other/usleep.c",
623      "toys/other/uuidgen.c",
624      "toys/other/vconfig.c",
625      "toys/other/vmstat.c",
626      "toys/other/w.c",
627      "toys/other/watch.c",
628      "toys/other/which.c",
629      "toys/other/xxd.c",
630      "toys/other/yes.c",
631      "toys/pending/bootchartd.c",
632      "toys/pending/dd.c",
633      "toys/pending/getty.c",
634      "toys/pending/lsof.c",
635      "toys/pending/mdev.c",
636      "toys/pending/more.c",
637      "toys/pending/route.c",
638      "toys/pending/telnetd.c",
639      "toys/posix/basename.c",
640      "toys/posix/cal.c",
641      "toys/posix/cat.c",
642      "toys/posix/chgrp.c",
643      "toys/posix/chmod.c",
644      "toys/posix/cksum.c",
645      "toys/posix/cmp.c",
646      "toys/posix/comm.c",
647      "toys/posix/cp.c",
648      "toys/posix/cpio.c",
649      "toys/posix/cut.c",
650      "toys/posix/date.c",
651      "toys/posix/df.c",
652      "toys/posix/dirname.c",
653      "toys/posix/du.c",
654      "toys/posix/echo.c",
655      "toys/posix/env.c",
656      "toys/posix/expand.c",
657      "toys/posix/false.c",
658      "toys/posix/file.c",
659      "toys/posix/find.c",
660      "toys/posix/getconf.c",
661      "toys/posix/grep.c",
662      "toys/posix/head.c",
663      "toys/posix/iconv.c",
664      "toys/posix/id.c",
665      "toys/posix/kill.c",
666      "toys/posix/link.c",
667      "toys/posix/ln.c",
668      "toys/posix/logger.c",
669      "toys/posix/ls.c",
670      "toys/posix/mkdir.c",
671      "toys/posix/mkfifo.c",
672      "toys/posix/nice.c",
673      "toys/posix/nl.c",
674      "toys/posix/nohup.c",
675      "toys/posix/od.c",
676      "toys/posix/paste.c",
677      "toys/posix/patch.c",
678      "toys/posix/printf.c",
679      "toys/posix/ps.c",
680      "toys/posix/pwd.c",
681      "toys/posix/renice.c",
682      "toys/posix/rm.c",
683      "toys/posix/rmdir.c",
684      "toys/posix/sed.c",
685      "toys/posix/sleep.c",
686      "toys/posix/sort.c",
687      "toys/posix/split.c",
688      "toys/posix/strings.c",
689      "toys/posix/tail.c",
690      "toys/posix/tar.c",
691      "toys/posix/tee.c",
692      "toys/posix/test.c",
693      "toys/posix/time.c",
694      "toys/posix/touch.c",
695      "toys/posix/true.c",
696      "toys/posix/tty.c",
697      "toys/posix/ulimit.c",
698      "toys/posix/uname.c",
699      "toys/posix/uniq.c",
700      "toys/posix/unlink.c",
701      "toys/posix/uudecode.c",
702      "toys/posix/uuencode.c",
703      "toys/posix/wc.c",
704      "toys/posix/who.c",
705      "toys/posix/xargs.c",
706    ]
707
708    include_dirs = [ "./" ]
709
710    cflags_c = [
711      "-std=gnu11",
712      "-Wall",
713      "-Wundef",
714      "-Wno-char-subscripts",
715      "-Wno-implicit-function-declaration",
716      "-Wno-unused-variable",
717      "-Wno-unused-value",
718      "-Wno-incompatible-pointer-types",
719      "-Wno-int-conversion",
720      "-Wno-sign-compare",
721      "-Wno-format",
722      "-Wno-unused-result",
723      "-Os",
724      "-ffunction-sections",
725      "-fdata-sections",
726      "-fno-asynchronous-unwind-tables",
727      "-fPIE",
728      "-funsigned-char",
729      "-Wno-string-plus-int",
730      "-Wno-tautological-constant-compare",
731      "-Wno-string-conversion",
732      "-Wno-unused-but-set-variable",
733    ]
734
735    ldflags = [
736      "-pie",
737      "-Wl,-z,relro",
738      "-Wl,-z,now",
739      "-Wl,-z,noexecstack",
740      "-lm",
741      "-lcrypt",
742    ]
743
744    if (build_selinux) {
745      cflags_c += [
746        "-D_GUN_SOURCE",
747        "-DUSE_PCRE2",
748        "-w",
749        "-DWITH_SELINUX",
750        "-DCUSTOM_GET_CONTEXT",
751      ]
752    }
753
754    symlink_target_name = [
755      "acpi",
756      "arch",
757      "ascii",
758      "base64",
759      "basename",
760      "blockdev",
761      "bunzip2",
762      "bzcat",
763      "cal",
764      "cat",
765      "chattr",
766      "chcon",
767      "chgrp",
768      "chmod",
769      "chown",
770      "chroot",
771      "chrt",
772      "chvt",
773      "cksum",
774      "clear",
775      "cmp",
776      "comm",
777      "count",
778      "cp",
779      "cpio",
780      "crc32",
781      "cut",
782      "date",
783      "dd",
784      "devmem",
785      "df",
786      "dirname",
787      "dmesg",
788      "dnsdomainname",
789      "dos2unix",
790      "du",
791      "echo",
792      "egrep",
793      "eject",
794      "env",
795      "expand",
796      "factor",
797      "fallocate",
798      "false",
799      "fgrep",
800      "file",
801      "find",
802      "flock",
803      "fmt",
804      "free",
805      "freeramdisk",
806      "fsfreeze",
807      "fstype",
808      "fsync",
809      "ftpget",
810      "ftpput",
811      "getconf",
812      "grep",
813      "groups",
814      "gunzip",
815      "gzip",
816      "halt",
817      "head",
818      "help",
819      "hexedit",
820      "hostname",
821      "hwclock",
822      "i2cdetect",
823      "i2cdump",
824      "i2cget",
825      "i2cset",
826      "iconv",
827      "id",
828      "ifconfig",
829      "inotifyd",
830      "insmod",
831      "install",
832      "ionice",
833      "iorenice",
834      "iotop",
835      "kill",
836      "killall",
837      "killall5",
838      "link",
839      "ln",
840      "logger",
841      "login",
842      "logname",
843      "losetup",
844      "ls",
845      "lsattr",
846      "lsmod",
847      "lsof",
848      "lspci",
849      "lsusb",
850      "makedevs",
851      "mcookie",
852      "md5sum",
853      "microcom",
854      "mix",
855      "mkdir",
856      "mkfifo",
857      "mknod",
858      "mkpasswd",
859      "mkswap",
860      "mktemp",
861      "modinfo",
862      "more",
863      "mount",
864      "mountpoint",
865      "mv",
866      "nbd-client",
867      "netstat",
868      "nice",
869      "nl",
870      "nohup",
871      "nproc",
872      "nsenter",
873      "od",
874      "oneit",
875      "partprobe",
876      "passwd",
877      "paste",
878      "patch",
879      "pgrep",
880      "pidof",
881      "ping",
882      "ping6",
883      "pivot_root",
884      "pkill",
885      "pmap",
886      "poweroff",
887      "printenv",
888      "printf",
889      "prlimit",
890      "ps",
891      "pwd",
892      "pwdx",
893      "readahead",
894      "readlink",
895      "realpath",
896      "renice",
897      "reset",
898      "restorecon",
899      "rev",
900      "rfkill",
901      "rm",
902      "rmdir",
903      "rmmod",
904      "sed",
905      "sendevent",
906      "seq",
907      "setfattr",
908      "setsid",
909      "sha1sum",
910      "sha256sum",
911      "shred",
912      "sleep",
913      "sntp",
914      "sort",
915      "split",
916      "stat",
917      "strings",
918      "swapoff",
919      "swapon",
920      "switch_root",
921      "sync",
922      "sysctl",
923      "tac",
924      "tail",
925      "tar",
926      "taskset",
927      "tee",
928      "test",
929      "time",
930      "timeout",
931      "top",
932      "touch",
933      "true",
934      "truncate",
935      "tty",
936      "tunctl",
937      "ulimit",
938      "umount",
939      "uname",
940      "uniq",
941      "unix2dos",
942      "unlink",
943      "unshare",
944      "uptime",
945      "usleep",
946      "uudecode",
947      "uuencode",
948      "uuidgen",
949      "vconfig",
950      "vmstat",
951      "w",
952      "watch",
953      "wc",
954      "which",
955      "who",
956      "whoami",
957      "xargs",
958      "xxd",
959      "yes",
960      "zcat",
961    ]
962
963    deps = []
964    defines = [
965      "_DEFAULT_SOURCE",
966      "TOYBOX_OH_ADAPT",
967    ]
968
969    if (build_selinux) {
970      sources += [ "toys/other/chcon.c" ]
971      external_deps = [
972        "openssl:libcrypto_shared",
973        "openssl:libssl_shared",
974        "selinux:libselinux",
975      ]
976      symlink_target_name += [ "chcon" ]
977      symlink_target_name -= [ "restorecon" ]
978
979      if (toybox_extended_cmd) {
980        defines += [ "TOYBOX_EXTENDED_CMD" ]
981        sources += [
982          "toys/net/wget.c",
983          "toys/pending/awk.c",
984          "toys/pending/diff.c",
985          "toys/pending/expr.c",
986          "toys/pending/getfattr.c",
987          "toys/pending/telnet.c",
988          "toys/pending/tr.c",
989          "toys/pending/traceroute.c",
990        ]
991        symlink_target_name += [
992          "traceroute",
993          "traceroute6",
994          "telnet",
995          "wget",
996          "awk",
997          "diff",
998          "expr",
999          "route",
1000          "sha384sum",
1001          "sha512sum",
1002          "tr",
1003          "getfattr",
1004        ]
1005      }
1006
1007      if (toybox_enable_brctl) {
1008        defines += [ "TOYBOX_ENABLE_BRCTL" ]
1009        sources += [ "toys/pending/brctl.c" ]
1010        symlink_target_name += [ "brctl" ]
1011      }
1012
1013      if (build_variant == "user") {
1014        defines += [ "TOYBOX_BUILD_USER" ]
1015      }
1016    }
1017
1018    part_name = "toybox"
1019    subsystem_name = "thirdparty"
1020    install_images = [
1021      "system",
1022      "ramdisk",
1023      "updater",
1024    ]
1025    install_enable = true
1026  }
1027}
1028