Age | Commit message (Collapse) | Author |
|
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
|
|
|
|
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".
|
|
|
|
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.)
|
|
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
|
|
Bug: http://b/62114389
Test: setprop
Change-Id: I165bcc01bb2422d991f746c5e6490cbdfb74472f
|
|
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).
|
|
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);
^~~~~~~~~~~~~
|
|
(Broken out of a larger patch, fixed the other part a different way.)
|
|
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
|
|
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.)
|
|
Removes the dependency on libcutils for everything except ps.
|
|
|
|
Bug: http://b/32371104
|
|
add xopenro() that takes one argument and understands "-" means stdin,
and switch over lots of users.
|
|
The lack of support for named constants is not a regression relative
to the toolbox implementation.
|
|
|
|
|
|
|
|
|
|
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!
|
|
|
|
|
|
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>
|
|
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.
|
|
|
|
Use qstrcmp instead of alphasort (which expects struct dirent arguments).
Don't use perror_exit because property_list doesn't set errno.
|
|
(I commented out the android-only #include in getprop to do what compile
testing I could, and then forgot to uncomment it.)
|
|
alphasort), add compile-time probe for config symbol TOYBOX_ON_ANDROID.
|
|
|
|
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
|
|
Also switch to xopen for O_CLOEXEC paranoia and to avoid a conditional.
Change-Id: Iee5c4c124bcac800313f586768ffcaade542bd22
|
|
Change-Id: Icbee1df8b316039c68ef326f9d4d80f32c603b21
|
|
Change-Id: I83c478ea9ddd456c61e3f0f99506a1028a7027a1
|
|
|
|
|
|
|
|
|