Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2014 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | ifneq ($(wildcard external/toybox/Android.mk),) |
| 18 | |
| 19 | ifeq ($(TW_USE_TOOLBOX), true) |
| 20 | |
| 21 | LOCAL_PATH := external/toybox |
| 22 | |
| 23 | # |
| 24 | # To update: |
| 25 | # |
| 26 | |
| 27 | # git remote add toybox https://github.com/landley/toybox.git |
| 28 | # git fetch toybox |
| 29 | # git merge toybox/master |
| 30 | # mm -j32 |
| 31 | # # (Make any necessary Android.mk changes and test the new toybox.) |
| 32 | # git push aosp HEAD:master # Push directly, avoiding gerrit. |
| 33 | # git push aosp HEAD:refs/for/master # Push to gerrit. |
| 34 | # |
| 35 | # # Now commit any necessary Android.mk changes like normal: |
| 36 | # repo start post-sync . |
| 37 | # git commit -a |
| 38 | |
| 39 | |
| 40 | # |
| 41 | # To add a toy: |
| 42 | # |
| 43 | |
| 44 | # make menuconfig |
| 45 | # # (Select the toy you want to add.) |
| 46 | # make clean && make # Regenerate the generated files. |
| 47 | # # Edit LOCAL_SRC_FILES below to add the toy. |
| 48 | # # If you just want to use it as "toybox x" rather than "x", you can stop now. |
| 49 | # # If you want this toy to have a symbolic link in /system/bin, add the toy to ALL_TOOLS. |
| 50 | |
| 51 | include $(CLEAR_VARS) |
| 52 | |
| 53 | LOCAL_SRC_FILES := \ |
| 54 | lib/args.c \ |
| 55 | lib/dirtree.c \ |
| 56 | lib/getmountlist.c \ |
| 57 | lib/help.c \ |
| 58 | lib/interestingtimes.c \ |
| 59 | lib/lib.c \ |
| 60 | lib/llist.c \ |
| 61 | lib/net.c \ |
| 62 | lib/portability.c \ |
| 63 | lib/xwrap.c \ |
| 64 | main.c \ |
| 65 | toys/android/getenforce.c \ |
| 66 | toys/android/getprop.c \ |
| 67 | toys/android/load_policy.c \ |
| 68 | toys/android/restorecon.c \ |
| 69 | toys/android/runcon.c \ |
| 70 | toys/android/setenforce.c \ |
| 71 | toys/android/setprop.c \ |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 72 | toys/lsb/hostname.c \ |
| 73 | toys/lsb/killall.c \ |
| 74 | toys/lsb/md5sum.c \ |
| 75 | toys/lsb/mknod.c \ |
| 76 | toys/lsb/mktemp.c \ |
| 77 | toys/lsb/mount.c \ |
| 78 | toys/lsb/pidof.c \ |
| 79 | toys/lsb/seq.c \ |
| 80 | toys/lsb/sync.c \ |
| 81 | toys/lsb/umount.c \ |
| 82 | toys/other/acpi.c \ |
| 83 | toys/other/base64.c \ |
| 84 | toys/other/blkid.c \ |
| 85 | toys/other/blockdev.c \ |
| 86 | toys/other/bzcat.c \ |
| 87 | toys/other/chcon.c \ |
| 88 | toys/other/chroot.c \ |
| 89 | toys/other/clear.c \ |
| 90 | toys/other/dos2unix.c \ |
| 91 | toys/other/fallocate.c \ |
| 92 | toys/other/free.c \ |
| 93 | toys/other/freeramdisk.c \ |
| 94 | toys/other/fsfreeze.c \ |
| 95 | toys/other/help.c \ |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 96 | toys/other/inotifyd.c \ |
| 97 | toys/other/insmod.c \ |
| 98 | toys/other/losetup.c \ |
| 99 | toys/other/lsattr.c \ |
| 100 | toys/other/lsmod.c \ |
| 101 | toys/other/lsusb.c \ |
| 102 | toys/other/makedevs.c \ |
| 103 | toys/other/mkswap.c \ |
| 104 | toys/other/modinfo.c \ |
| 105 | toys/other/mountpoint.c \ |
| 106 | toys/other/nbd_client.c \ |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 107 | toys/other/partprobe.c \ |
| 108 | toys/other/pivot_root.c \ |
| 109 | toys/other/pmap.c \ |
| 110 | toys/other/printenv.c \ |
| 111 | toys/other/pwdx.c \ |
| 112 | toys/other/readlink.c \ |
| 113 | toys/other/realpath.c \ |
| 114 | toys/other/rev.c \ |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 115 | toys/other/rmmod.c \ |
| 116 | toys/other/setsid.c \ |
| 117 | toys/other/stat.c \ |
| 118 | toys/other/swapoff.c \ |
| 119 | toys/other/swapon.c \ |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 120 | toys/other/sysctl.c \ |
| 121 | toys/other/tac.c \ |
| 122 | toys/other/taskset.c \ |
| 123 | toys/other/timeout.c \ |
| 124 | toys/other/truncate.c \ |
| 125 | toys/other/usleep.c \ |
| 126 | toys/other/vconfig.c \ |
| 127 | toys/other/vmstat.c \ |
| 128 | toys/other/which.c \ |
| 129 | toys/other/yes.c \ |
| 130 | toys/pending/dd.c \ |
| 131 | toys/pending/expr.c \ |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 132 | toys/pending/more.c \ |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 133 | toys/pending/route.c \ |
| 134 | toys/pending/tar.c \ |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 135 | toys/pending/tr.c \ |
| 136 | toys/pending/traceroute.c \ |
| 137 | toys/posix/basename.c \ |
| 138 | toys/posix/cal.c \ |
| 139 | toys/posix/cat.c \ |
| 140 | toys/posix/chgrp.c \ |
| 141 | toys/posix/chmod.c \ |
| 142 | toys/posix/cksum.c \ |
| 143 | toys/posix/cmp.c \ |
| 144 | toys/posix/comm.c \ |
| 145 | toys/posix/cp.c \ |
| 146 | toys/posix/cpio.c \ |
| 147 | toys/posix/cut.c \ |
| 148 | toys/posix/date.c \ |
| 149 | toys/posix/df.c \ |
| 150 | toys/posix/dirname.c \ |
| 151 | toys/posix/du.c \ |
| 152 | toys/posix/echo.c \ |
| 153 | toys/posix/env.c \ |
| 154 | toys/posix/expand.c \ |
| 155 | toys/posix/false.c \ |
| 156 | toys/posix/find.c \ |
| 157 | toys/posix/grep.c \ |
| 158 | toys/posix/head.c \ |
| 159 | toys/posix/id.c \ |
| 160 | toys/posix/kill.c \ |
| 161 | toys/posix/ln.c \ |
| 162 | toys/posix/ls.c \ |
| 163 | toys/posix/mkdir.c \ |
| 164 | toys/posix/mkfifo.c \ |
| 165 | toys/posix/nice.c \ |
| 166 | toys/posix/nl.c \ |
| 167 | toys/posix/nohup.c \ |
| 168 | toys/posix/od.c \ |
| 169 | toys/posix/paste.c \ |
| 170 | toys/posix/patch.c \ |
| 171 | toys/posix/printf.c \ |
| 172 | toys/posix/pwd.c \ |
| 173 | toys/posix/renice.c \ |
| 174 | toys/posix/rm.c \ |
| 175 | toys/posix/rmdir.c \ |
| 176 | toys/posix/sed.c \ |
| 177 | toys/posix/sleep.c \ |
| 178 | toys/posix/sort.c \ |
| 179 | toys/posix/split.c \ |
| 180 | toys/posix/strings.c \ |
| 181 | toys/posix/tail.c \ |
| 182 | toys/posix/tee.c \ |
| 183 | toys/posix/time.c \ |
| 184 | toys/posix/touch.c \ |
| 185 | toys/posix/true.c \ |
| 186 | toys/posix/tty.c \ |
| 187 | toys/posix/uname.c \ |
| 188 | toys/posix/uniq.c \ |
| 189 | toys/posix/wc.c \ |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 190 | toys/posix/xargs.c |
| 191 | |
D. Andrei Măceș | 9ce12ec | 2016-12-22 17:14:21 -0500 | [diff] [blame] | 192 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 23; echo $$?),0) |
| 193 | # there are some conflicts here with AOSP-7.[01] and CM-14.[01] |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 194 | # the following items have been removed for compatibility |
| 195 | # ifconfig, netcat, netstat, rfkill, switch_root |
| 196 | LOCAL_STATIC_LIBRARIES := libcrypto_static |
| 197 | |
| 198 | LOCAL_C_INCLUDES += \ |
| 199 | external/boringssl/include \ |
| 200 | bionic/libc/dns/include |
| 201 | |
| 202 | LOCAL_SRC_FILES += \ |
| 203 | lib/linestack.c \ |
| 204 | lib/password.c \ |
| 205 | toys/other/flock.c \ |
| 206 | toys/other/hwclock.c \ |
| 207 | toys/other/ionice.c \ |
| 208 | toys/other/lspci.c \ |
| 209 | toys/other/readahead.c \ |
| 210 | toys/other/reset.c \ |
| 211 | toys/other/uptime.c \ |
| 212 | toys/other/xxd.c \ |
| 213 | toys/pending/arp.c \ |
| 214 | toys/pending/diff.c \ |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 215 | toys/pending/lsof.c \ |
| 216 | toys/pending/telnet.c \ |
| 217 | toys/pending/test.c \ |
| 218 | toys/pending/watch.c \ |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 219 | toys/posix/ps.c \ |
| 220 | toys/posix/ulimit.c |
Humberto Borba | 84e1615 | 2018-01-05 00:51:40 -0200 | [diff] [blame] | 221 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 27; echo $$?),0) |
| 222 | LOCAL_SRC_FILES += \ |
| 223 | toys/pending/xzcat.c |
| 224 | endif |
| 225 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -eq 26; echo $$?),0) |
Ethan Yonker | 95e8007 | 2017-08-24 21:45:50 -0500 | [diff] [blame] | 226 | # Android 8.0 had some tools in different paths |
| 227 | LOCAL_SRC_FILES += \ |
Humberto Borba | 84e1615 | 2018-01-05 00:51:40 -0200 | [diff] [blame] | 228 | toys/pending/dmesg.c |
| 229 | else |
| 230 | LOCAL_SRC_FILES += \ |
| 231 | toys/lsb/dmesg.c |
| 232 | endif |
| 233 | |
| 234 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0) |
| 235 | # Android 8.0/8.1 had some tools in different paths |
| 236 | LOCAL_SRC_FILES += \ |
Ethan Yonker | 95e8007 | 2017-08-24 21:45:50 -0500 | [diff] [blame] | 237 | toys/net/ftpget.c |
| 238 | else |
| 239 | LOCAL_SRC_FILES += \ |
Ethan Yonker | 95e8007 | 2017-08-24 21:45:50 -0500 | [diff] [blame] | 240 | toys/pending/ftpget.c |
| 241 | endif |
| 242 | |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 243 | # Account for master branch changes pulld into CM14.1 |
| 244 | ifneq ($(CM_BUILD),) |
| 245 | LOCAL_SRC_FILES += \ |
| 246 | toys/android/log.c \ |
| 247 | toys/android/sendevent.c \ |
| 248 | toys/android/start.c \ |
| 249 | toys/net/ifconfig.c \ |
| 250 | toys/net/netcat.c \ |
| 251 | toys/net/netstat.c \ |
| 252 | toys/net/rfkill.c \ |
| 253 | toys/net/tunctl.c \ |
| 254 | toys/other/setfattr.c \ |
| 255 | toys/pending/chrt.c \ |
| 256 | toys/pending/fdisk.c \ |
| 257 | toys/pending/getfattr.c \ |
| 258 | toys/pending/host.c \ |
| 259 | toys/pending/resize.c \ |
| 260 | toys/posix/file.c |
| 261 | else |
| 262 | LOCAL_SRC_FILES += \ |
Ethan Yonker | 95e8007 | 2017-08-24 21:45:50 -0500 | [diff] [blame] | 263 | toys/other/switch_root.c |
| 264 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0) |
| 265 | # Android 8.0 had some tools in different paths |
| 266 | LOCAL_SRC_FILES += \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 267 | toys/android/log.c \ |
| 268 | toys/android/sendevent.c \ |
| 269 | toys/android/start.c \ |
Ethan Yonker | 95e8007 | 2017-08-24 21:45:50 -0500 | [diff] [blame] | 270 | toys/net/ifconfig.c \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 271 | toys/net/microcom.c \ |
Ethan Yonker | 95e8007 | 2017-08-24 21:45:50 -0500 | [diff] [blame] | 272 | toys/net/netcat.c \ |
| 273 | toys/net/netstat.c \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 274 | toys/net/rfkill.c \ |
| 275 | toys/net/tunctl.c \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 276 | toys/pending/getfattr.c \ |
| 277 | toys/pending/modprobe.c \ |
| 278 | toys/pending/setfattr.c \ |
| 279 | toys/posix/file.c \ |
| 280 | toys/posix/uudecode.c \ |
| 281 | toys/posix/uuencode.c |
Humberto Borba | 84e1615 | 2018-01-05 00:51:40 -0200 | [diff] [blame] | 282 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 26; echo $$?),0) |
| 283 | # Android 8.1 had some tools in different paths |
| 284 | LOCAL_SRC_FILES += \ |
| 285 | toys/other/chrt.c \ |
| 286 | toys/pending/gzip.c |
| 287 | else |
| 288 | LOCAL_SRC_FILES += \ |
| 289 | toys/pending/chrt.c |
| 290 | endif |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 291 | LOCAL_SHARED_LIBRARIES += liblog |
Ethan Yonker | 95e8007 | 2017-08-24 21:45:50 -0500 | [diff] [blame] | 292 | else |
| 293 | LOCAL_SRC_FILES += \ |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 294 | toys/other/ifconfig.c \ |
| 295 | toys/other/netcat.c \ |
| 296 | toys/other/rfkill.c \ |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 297 | toys/pending/netstat.c |
| 298 | endif |
Ethan Yonker | 95e8007 | 2017-08-24 21:45:50 -0500 | [diff] [blame] | 299 | endif |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 300 | else |
| 301 | LOCAL_SRC_FILES += \ |
| 302 | toys/other/ifconfig.c \ |
| 303 | toys/other/netcat.c \ |
| 304 | toys/other/rfkill.c \ |
| 305 | toys/other/switch_root.c \ |
| 306 | toys/pending/hwclock.c \ |
| 307 | toys/pending/netstat.c \ |
| 308 | toys/pending/pgrep.c \ |
| 309 | toys/pending/top.c |
| 310 | endif |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 311 | |
| 312 | LOCAL_CFLAGS += \ |
| 313 | -std=c99 \ |
| 314 | -Os \ |
| 315 | -Wno-char-subscripts \ |
| 316 | -Wno-sign-compare \ |
| 317 | -Wno-string-plus-int \ |
| 318 | -Wno-uninitialized \ |
| 319 | -Wno-unused-parameter \ |
| 320 | -funsigned-char \ |
| 321 | -ffunction-sections -fdata-sections \ |
| 322 | -fno-asynchronous-unwind-tables \ |
| 323 | |
Humberto Borba | 84e1615 | 2018-01-05 00:51:40 -0200 | [diff] [blame] | 324 | toybox_version := $(shell sed 's/#define.*TOYBOX_VERSION.*"\(.*\)"/\1/p;d' $(LOCAL_PATH)/main.c) |
| 325 | LOCAL_CFLAGS += -DTOYBOX_VERSION=\"$(toybox_version)\" |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 326 | |
| 327 | LOCAL_CLANG := true |
| 328 | |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 329 | LOCAL_SHARED_LIBRARIES += libcutils libselinux |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 330 | |
Humberto Borba | 84e1615 | 2018-01-05 00:51:40 -0200 | [diff] [blame] | 331 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 26; echo $$?),0) |
| 332 | LOCAL_CFLAGS += \ |
| 333 | -Wno-gnu-variable-sized-type-not-at-end \ |
| 334 | -Wno-missing-field-initializers |
| 335 | |
| 336 | LOCAL_SHARED_LIBRARIES += libz |
| 337 | endif |
| 338 | |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 339 | LOCAL_MODULE := toybox_recovery |
| 340 | LOCAL_MODULE_STEM := toybox |
| 341 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin |
| 342 | LOCAL_MODULE_TAGS := optional |
| 343 | |
| 344 | # dupes: dd df du ls mount renice |
| 345 | # useless?: freeramdisk fsfreeze install makedevs mkfifo nbd-client |
| 346 | # partprobe pivot_root pwdx rev rfkill switch_root tty vconfig |
| 347 | # prefer BSD netcat instead?: nc netcat |
| 348 | # prefer efs2progs instead?: blkid chattr lsattr |
| 349 | |
| 350 | ALL_TOOLS := \ |
| 351 | acpi \ |
| 352 | basename \ |
| 353 | blkid \ |
| 354 | blockdev \ |
| 355 | bzcat \ |
| 356 | cal \ |
| 357 | cat \ |
| 358 | chcon \ |
| 359 | chgrp \ |
| 360 | chmod \ |
| 361 | chown \ |
| 362 | chroot \ |
| 363 | cksum \ |
| 364 | clear \ |
| 365 | comm \ |
| 366 | cmp \ |
| 367 | cp \ |
| 368 | cpio \ |
| 369 | cut \ |
| 370 | date \ |
| 371 | dirname \ |
| 372 | dmesg \ |
| 373 | dos2unix \ |
| 374 | echo \ |
| 375 | env \ |
| 376 | expand \ |
| 377 | expr \ |
| 378 | fallocate \ |
| 379 | false \ |
| 380 | find \ |
| 381 | free \ |
| 382 | getenforce \ |
| 383 | getprop \ |
| 384 | groups \ |
| 385 | head \ |
| 386 | hostname \ |
| 387 | hwclock \ |
| 388 | id \ |
| 389 | ifconfig \ |
| 390 | inotifyd \ |
| 391 | insmod \ |
| 392 | kill \ |
| 393 | load_policy \ |
| 394 | ln \ |
| 395 | logname \ |
| 396 | losetup \ |
| 397 | lsmod \ |
| 398 | lsusb \ |
| 399 | md5sum \ |
| 400 | mkdir \ |
| 401 | mknod \ |
| 402 | mkswap \ |
| 403 | mktemp \ |
| 404 | modinfo \ |
| 405 | more \ |
| 406 | mountpoint \ |
| 407 | mv \ |
| 408 | netstat \ |
| 409 | nice \ |
| 410 | nl \ |
| 411 | nohup \ |
| 412 | od \ |
| 413 | paste \ |
| 414 | patch \ |
| 415 | pgrep \ |
| 416 | pidof \ |
| 417 | pkill \ |
| 418 | pmap \ |
| 419 | printenv \ |
| 420 | printf \ |
| 421 | pwd \ |
| 422 | readlink \ |
| 423 | realpath \ |
| 424 | restorecon \ |
| 425 | rm \ |
| 426 | rmdir \ |
| 427 | rmmod \ |
| 428 | route \ |
| 429 | runcon \ |
| 430 | sed \ |
| 431 | seq \ |
| 432 | setenforce \ |
| 433 | setprop \ |
| 434 | setsid \ |
| 435 | sha1sum \ |
| 436 | sleep \ |
| 437 | sort \ |
| 438 | split \ |
| 439 | stat \ |
| 440 | strings \ |
| 441 | swapoff \ |
| 442 | swapon \ |
| 443 | sync \ |
| 444 | sysctl \ |
| 445 | tac \ |
| 446 | tail \ |
| 447 | tar \ |
| 448 | taskset \ |
| 449 | tee \ |
| 450 | time \ |
| 451 | timeout \ |
| 452 | touch \ |
| 453 | tr \ |
| 454 | true \ |
| 455 | truncate \ |
| 456 | umount \ |
| 457 | uname \ |
| 458 | uniq \ |
| 459 | unix2dos \ |
| 460 | usleep \ |
| 461 | vmstat \ |
| 462 | wc \ |
| 463 | which \ |
| 464 | whoami \ |
| 465 | xargs \ |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 466 | yes |
| 467 | |
D. Andrei Măceș | 9ce12ec | 2016-12-22 17:14:21 -0500 | [diff] [blame] | 468 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 23; echo $$?),0) |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 469 | ALL_TOOLS += \ |
| 470 | arp \ |
| 471 | base64 \ |
| 472 | chattr \ |
| 473 | dd \ |
| 474 | df \ |
| 475 | diff \ |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 476 | egrep \ |
| 477 | fgrep \ |
| 478 | flock \ |
| 479 | freeramdisk \ |
| 480 | fsfreeze \ |
| 481 | fstype \ |
| 482 | ftpget \ |
| 483 | ftpput \ |
| 484 | grep \ |
| 485 | help \ |
| 486 | install \ |
| 487 | ionice \ |
| 488 | iorenice \ |
| 489 | iotop \ |
| 490 | killall \ |
| 491 | ls \ |
| 492 | lsattr \ |
| 493 | lsof \ |
| 494 | lspci \ |
| 495 | makedevs \ |
| 496 | mkfifo \ |
| 497 | mount \ |
| 498 | nbd-client \ |
| 499 | nc \ |
| 500 | netcat \ |
| 501 | nproc \ |
| 502 | partprobe \ |
| 503 | pivot_root \ |
| 504 | ps \ |
| 505 | pwdx \ |
| 506 | readahead \ |
| 507 | renice \ |
| 508 | reset \ |
| 509 | rev \ |
| 510 | rfkill \ |
| 511 | sha224sum \ |
| 512 | sha256sum \ |
| 513 | sha384sum \ |
| 514 | sha512sum \ |
| 515 | telnet \ |
| 516 | test \ |
| 517 | top \ |
| 518 | traceroute \ |
| 519 | traceroute6 \ |
| 520 | tty \ |
| 521 | tunctl \ |
| 522 | ulimit \ |
| 523 | uptime \ |
| 524 | vconfig \ |
| 525 | watch \ |
Humberto Borba | 84e1615 | 2018-01-05 00:51:40 -0200 | [diff] [blame] | 526 | xxd |
| 527 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 27; echo $$?),0) |
| 528 | ALL_TOOLS += \ |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 529 | xzcat |
Humberto Borba | 84e1615 | 2018-01-05 00:51:40 -0200 | [diff] [blame] | 530 | endif |
D. Andrei Măceș | 9ce12ec | 2016-12-22 17:14:21 -0500 | [diff] [blame] | 531 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 24; echo $$?),0) |
| 532 | ALL_TOOLS += \ |
Humberto Borba | 84e1615 | 2018-01-05 00:51:40 -0200 | [diff] [blame] | 533 | du \ |
| 534 | gzip \ |
| 535 | gunzip \ |
| 536 | zcat |
D. Andrei Măceș | 9ce12ec | 2016-12-22 17:14:21 -0500 | [diff] [blame] | 537 | endif |
Hashcode | 5733215 | 2016-12-20 01:30:49 +0100 | [diff] [blame] | 538 | # Account for master branch changes pulld into CM14.1 |
| 539 | ifneq ($(CM_BUILD),) |
| 540 | ALL_TOOLS += \ |
| 541 | chrt \ |
| 542 | fdisk \ |
| 543 | file \ |
| 544 | getfattr \ |
| 545 | host \ |
| 546 | log \ |
| 547 | resize \ |
| 548 | setfattr |
| 549 | endif |
| 550 | endif |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 551 | |
| 552 | # Install the symlinks. |
| 553 | LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_RECOVERY_ROOT_OUT)/sbin/$(t);) |
| 554 | |
| 555 | include $(BUILD_EXECUTABLE) |
| 556 | |
| 557 | # Make /sbin/toolbox launchers for each tool |
| 558 | SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/,$(ALL_TOOLS)) |
| 559 | $(SYMLINKS): TOYBOX_BINARY := $(LOCAL_MODULE_STEM) |
| 560 | $(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk |
| 561 | @echo "Symlink: $@ -> $(TOYBOX_BINARY)" |
| 562 | @mkdir -p $(dir $@) |
| 563 | @rm -rf $@ |
| 564 | $(hide) ln -sf $(TOYBOX_BINARY) $@ |
| 565 | |
| 566 | include $(CLEAR_VARS) |
| 567 | LOCAL_MODULE := toybox_symlinks |
| 568 | LOCAL_MODULE_TAGS := optional |
| 569 | LOCAL_ADDITIONAL_DEPENDENCIES := $(SYMLINKS) |
| 570 | include $(BUILD_PHONY_PACKAGE) |
| 571 | |
| 572 | endif |
| 573 | |
| 574 | endif |