aboutsummaryrefslogtreecommitdiff
path: root/toys/android
AgeCommit message (Collapse)Author
2019-06-07Remove getprop, setprop, start, and stop from toyboxTom Cherry
These are Android specific, so not really helping the outside community, and are getting more and more Android dependencies to work correctly, so let's drop these from toybox and build them within Android. Change-Id: Ic6022f1f506e10868c61f55d64fa4e7c1b14eba2
2019-03-14load_policy: mention SELinux in the help.Elliott Hughes
2018-12-04Clean up some --help formatting.Elliott Hughes
Be consistent about upper versus lower case. (Upper seems to have the majority, so I went with that, though I'm happy to provide the opposite patch as long as we're consistent!) Be consistent about using \t. (Though saving a few bytes seems like it might be better done in the code that generates help.h rather than directly in the source, since tabs make careful ASCII art layout hard enough that we regularly have things misaligned.) Remove trailing periods (most of which seem to have been added by me). Always use the US "human readable" rather than my British "human-readable", and be more consistent about declaring whether we're showing multiples of 1000 or 1024. Just say "verbose" rather than adding a useless "mode" or "output".
2018-11-17Convert more GLOBALS argument vars to the new single letter code style.Rob Landley
2018-10-04Make it possible to build the AOSP .config against glibc.Elliott Hughes
It's possible that we should just pull setprop back out of toybox to live with getprop in system/core/, but this lets us build the same toybox configuration for device and host in AOSP. (Longer term we'd like to use host bionic, but if we enable this we can start experimenting on the tobyox side before the bionic side is finished.)
2017-10-17Allow ro. properties to have arbitrary lengthsTom Cherry
Android now allows ro. properties to have arbitrary lengths. Two changes need to happen to support this: 1) The length check in setprop.c before attempting to set a property needs to be removed for ro. properties 2) __system_property_read_callback() must be used in place of __system_property_get() in getprop.c as only the former is capable of reading properties with size > 92 characters. Bug: 23102347 Bug: 34954705 Change-Id: Ib8565a3e6d987dd5e6a5fe790e804ecf8ad1e020
2017-06-01Allow ':' in property names.Elliott Hughes
Bug: http://b/62114389 Test: setprop Change-Id: I165bcc01bb2422d991f746c5e6490cbdfb74472f
2017-05-24Add and use xmmap.Elliott Hughes
Everyone forgets that mmap returns MAP_FAILED rather than NULL on failure. Every use of mmap in toybox was either doing the wrong check, or no check at all (including the two I personally added).
2017-03-27Fix the type of the callback in getprop.Elliott Hughes
Fixes: toys/android/getprop.c:56:39: warning: incompatible pointer types passing 'void (void *, const char *, const char *)' to parameter of type 'void (*)(void *, const char *, const char *, uint32_t)' (aka 'void (*)(void *, const char *, const char *, unsigned int)') [-Wincompatible-pointer-types] __system_property_read_callback(pi, read_callback, NULL); ^~~~~~~~~~~~~
2017-02-05Patch from Elliott to silence a "const" warning in android/getprop.c.Rob Landley
(Broken out of a larger patch, fixed the other part a different way.)
2017-01-25Remove name length limit for system propertiesDimitry Ivanov
Android O removes name length limit for system properties. Use __system_property_read_callback instead of deprecated __system_property_read in getprop and remove check for property name length in setprop. Test: adb shell setprop debug.test.very.very.long.property.name valueforpropertywithlongname Test: adb shell getprop | grep debug.test.very.very.long.property.name Bug: http://b/33926793 Change-Id: I57ca99ea33283d069cd1b7b9f110ec9fb27f3d19
2016-12-28Admit that getprop requires selinux.Elliott Hughes
The "lsm" portability stuff could abstract this away, but Android doesn't need it, and getprop is meaningless on non-Android. (And if you're just building with the NDK, on recent enough versions of Android you won't be able to read most of the system properties anyway because access to them is increasingly restricted by selinux.)
2016-12-28Switch to bionic <sys/system_properties.h>.Elliott Hughes
Removes the dependency on libcutils for everything except ps.
2016-12-26log: use error_msg instead of perror_msg when errno is meaningless.Elliott Hughes
2016-10-24Android O allows '@' in property names.Elliott Hughes
Bug: http://b/32371104
2016-08-04Make xopen() skip stdin/stdout/stderr, add xopen_stdio() if you want stdout,Rob Landley
add xopenro() that takes one argument and understands "-" means stdin, and switch over lots of users.
2016-07-14Add Android's "sendevent".Elliott Hughes
The lack of support for named constants is not a regression relative to the toolbox implementation.
2016-06-28Fix iteration for start/stop without arguments.Elliott Hughes
2016-06-27Fix start.c build and add error reporting.Elliott Hughes
2016-06-25Code style pass.Rob Landley
2016-06-25new Android toys: start/stopElliott Hughes
2016-06-23Remove android/log's "default" priority.Elliott Hughes
It turns out that "default" goes nowhere. Whereas "silent" actually shows up in the log. So document "silent" (which we already supported) but remove support for "default". Also make the spacing between levels in the help more regular; it looks weird being in columns when there's only one row!
2016-06-21Attempt at cleanup of log.c, but I don't have a build environment for it so...Rob Landley
2016-06-21new Android toy: logElliott Hughes
2016-05-05Fix static linkage of toybox binary.Alistair Strachan
If toybox was compiled statically e.g. for use in a recovery ramdisk, it would not build after b66a29a. This is because libselinux already exports a selinux_log_callback() function which getprop.c is trying to override. This change simply makes the second symbol static, since it is only used in a function table so we do not actually need to export it from toybox. Change-Id: I603258877ae2286660df35738bbf4f4285df5b54 Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
2016-02-17Add support for getprop -ZTom Cherry
Add support for a -Z option to getprop that will either print the SELabel of a given property if one is provided or print all properties that have been set along with their SELabel. Also, correct a memory leak when freeing TT.nv.
2016-01-19runcon needs to exec, not recurse.Rob Landley
2015-05-03Fix getprop sorting and error reporting.Elliott Hughes
Use qstrcmp instead of alphasort (which expects struct dirent arguments). Don't use perror_exit because property_list doesn't set errno.
2015-04-20Switch setprop to use TOYBOX_ON_ANDROID and fix getprop include.Rob Landley
(I commented out the android-only #include in getprop to do what compile testing I could, and then forgot to uncomment it.)
2015-04-19Cleanup getprop, add qstrcmp() to lib for qsort (because posix-2008 brokeRob Landley
alphasort), add compile-time probe for config symbol TOYBOX_ON_ANDROID.
2015-04-18Android getprop and setprop from Elliott Hughes.Rob Landley
2015-04-10Implement Android restorecon.Elliott Hughes
On Android, much of the restorecon logic is in libselinux, so this isn't portable. We do want to be able to build on the host for testing *other* toys, though, so #if keeps this building. Change-Id: Ida5a6713a926140c549d5770d62798f4aedca748
2015-04-10Fix load_policy error reporting.Elliott Hughes
Also switch to xopen for O_CLOEXEC paranoia and to avoid a conditional. Change-Id: Iee5c4c124bcac800313f586768ffcaade542bd22
2015-04-10getenforce takes no arguments.Elliott Hughes
Change-Id: Icbee1df8b316039c68ef326f9d4d80f32c603b21
2015-04-10setenforce takes exactly one argument.Elliott Hughes
Change-Id: I83c478ea9ddd456c61e3f0f99506a1028a7027a1
2015-03-27Promote setenforce to android.Rob Landley
2015-03-27Promote getenforce.Rob Landley
2015-03-27Promote load_policy to android.Rob Landley
2015-03-23Promote runcon to android (and add an android menu).Rob Landley