Commit graph

249 commits

Author SHA1 Message Date
Nick Kralevich
e18c0d508a fs_mgr: make block devices read-only
When a filesystem is mounted read-only, make the underlying
block device read-only too. This helps prevent an attacker
who is able to change permissions on the files in /dev
(for example, symlink attack) from modifying the block device.

In particular, this change would have stopped the LG Thrill / Optimus
3D rooting exploit
(http://vulnfactory.org/blog/2012/02/26/rooting-the-lg-thrill-optimus-3d/)
as that exploit modified the raw block device corresponding to /system.

This change also makes UID=0 less powerful. Block devices cannot
be made writable again without CAP_SYS_ADMIN, so an escalation
to UID=0 by itself doesn't give full root access.

adb/mount: Prior to mounting something read-write, remove the
read-only restrictions on the underlying block device. This avoids
messing up developer workflows.

Change-Id: I135098a8fe06f327336f045aab0d48ed9de33807
2013-04-24 08:53:26 -07:00
Colin Cross
ba4ac0cc3a am 03546553: am b73a0ef4: Merge "use lseek64 to resolve offset oveflow"
* commit '03546553205b56fc1ba0318b146971f43f54a155':
  use lseek64 to resolve offset oveflow
2013-04-18 15:25:54 -07:00
Colin Cross
0354655320 am b73a0ef4: Merge "use lseek64 to resolve offset oveflow"
* commit 'b73a0ef4d05ad594ba07b98e1f4aa7fe66a18c2e':
  use lseek64 to resolve offset oveflow
2013-04-18 15:20:54 -07:00
Jongrak Kwon
c05aae4ac4 use lseek64 to resolve offset oveflow
The offset variable in lseek is 32 bit and get easily overflow
when accessing with large offset in dd command.
Use lseek64 to resolve it.

Change-Id: Ib75d9dcb587004a6851365ab5bb8584ce1010b57
2013-04-17 14:05:55 -07:00
Ying Wang
39f6dd65f9 am 129b6d90: am 083b5ccb: Add liblog
* commit '129b6d907b3c32a0f0a2e4fc585502484d47a1e4':
  Add liblog
2013-04-09 23:25:24 -07:00
Ying Wang
129b6d907b am 083b5ccb: Add liblog
* commit '083b5ccba345ed2b4950454f16bd89c5d86b6b27':
  Add liblog
2013-04-09 22:29:03 -07:00
Ying Wang
083b5ccba3 Add liblog
Bug: 8580410
Change-Id: Iab3a9b4307f207c14a04a922cc7350c54e60e9ad
2013-04-09 22:03:45 -07:00
Colin Cross
58b0642abb am d3859e43: am 6e0b9ecb: Merge "toolbox/dmesg: do not hardcode KLOG_BUF_LEN"
* commit 'd3859e433d5a4e0da3f24851c5f5f6c9c8b97849':
  toolbox/dmesg: do not hardcode KLOG_BUF_LEN
2013-04-06 12:56:31 -07:00
Colin Cross
d3859e433d am 6e0b9ecb: Merge "toolbox/dmesg: do not hardcode KLOG_BUF_LEN"
* commit '6e0b9ecb503b5611d815214e0a134ea0b1395089':
  toolbox/dmesg: do not hardcode KLOG_BUF_LEN
2013-04-06 12:51:35 -07:00
Colin Cross
6e0b9ecb50 Merge "toolbox/dmesg: do not hardcode KLOG_BUF_LEN" 2013-04-06 19:02:01 +00:00
Geremy Condra
e5920ffdca am a7096004: am 911ba269: Merge "Add -i option to toolbox cmd ls"
* commit 'a7096004f220dd7578d7b2e26a3513fa5efc0fc1':
  Add -i option to toolbox cmd ls
2013-04-04 23:46:55 -07:00
Geremy Condra
a7096004f2 am 911ba269: Merge "Add -i option to toolbox cmd ls"
* commit '911ba269e369035f9a4a250fa22233b37d724356':
  Add -i option to toolbox cmd ls
2013-04-04 23:42:16 -07:00
William Roberts
403b195548 Add -i option to toolbox cmd ls
Change-Id: I4690fc10dc07bf1883bcf8ec18399235dc97d317
2013-04-03 17:39:19 -07:00
James Sullins
edee93dc5b toolbox/dmesg: do not hardcode KLOG_BUF_LEN
Change-Id: Ia99654a53d6adfeba5a5088b7cff45c6e47b6188
2013-04-01 21:50:03 +05:30
Benoit Goby
c6d7e200ed toolbox: Make reboot a separate command from toolbox
Set the CAP_SYS_BOOT filesystem capability on the new reboot
command and keep CAP_SYS_BOOT in adb bounding set so that the
shell user can run it.

Change-Id: I1dd6143445ee2a952254f0452ab6e544318431dd
2013-03-26 12:24:10 -07:00
Benoit Goby
391f365c6d toolbox: Fix rm -f with multiple files
Only check errno if unlink returns -1.
Continue instead of exiting if one file does not exist.

Change-Id: Iaf01b8523b84e87fcb0d732b89b7be6e24279c0b
2013-03-25 19:59:21 -07:00
Dmitry Shmidt
4db7df71da toolbox: renice: Add -t TYPE parameter and switch to getopt
Change-Id: Idaedabe1505a9c373629ef1fd31aa4b4beb068c2
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-01-22 16:59:36 -08:00
Dima Zavin
487c4ea012 am 7ec62dbd: am 82ea44f8: Merge "Change setsebool syntax to be consistent with other init built-ins."
* commit '7ec62dbd9d2bd7369fa074bf002f642b03e6dd39':
  Change setsebool syntax to be consistent with other init built-ins.
2012-12-19 09:51:38 -08:00
Dima Zavin
82ea44f88f Merge "Change setsebool syntax to be consistent with other init built-ins." 2012-12-18 23:42:09 -08:00
Stephen Smalley
0e23fee505 Change setsebool syntax to be consistent with other init built-ins.
Change setsebool syntax from name=value to name value.
This is to make it consistent with setprop and similar commands.
Update both the init built-in command and the toolbox command
for consistency.

Change-Id: I2c8e016ba26731c4a2ad4a49ae3b89362bf8f8a8
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2012-12-13 15:41:53 -05:00
Elliott Hughes
229d2ace9d am b8db1e09: am 777991d9: Merge "Fixed improper size displaying in \'df\' utility"
* commit 'b8db1e093d412f57263dc597dbac14c377945781':
  Fixed improper size displaying in 'df' utility
2012-12-03 08:15:25 -08:00
Elliott Hughes
777991d939 Merge "Fixed improper size displaying in 'df' utility" 2012-12-03 07:33:38 -08:00
Kenny Root
efb5e3c709 resolved conflicts for merge of 20f5daa8 to master
Change-Id: Ie3e67696d265a56dfa4d089c777506f27783a9a6
2012-10-16 18:00:29 -07:00
Kenny Root
20f5daa865 resolved conflicts for merge of 44f4f8a4 to jb-mr1-dev-plus-aosp
Change-Id: I66988d8e87a8110ca9ab3da19870b80bbaf06eba
2012-10-16 17:51:14 -07:00
Kenny Root
b83c09812f Remove HAVE_SELINUX guards
Change-Id: Idef0a784a1d237257ff4135bb1df62ff8a67ded3
2012-10-16 12:34:06 -07:00
Kenny Root
f638b7e0a0 am e47eb98a: am 674c0445: Merge "toolbox: silence some compiler warnings"
* commit 'e47eb98a337081d0d6c740eb7d8b990faf4090d7':
  toolbox: silence some compiler warnings
2012-10-11 00:30:23 -07:00
Kenny Root
e47eb98a33 am 674c0445: Merge "toolbox: silence some compiler warnings"
* commit '674c0445e25cdf9bcd7d32a84103bd3b7e24a4a0':
  toolbox: silence some compiler warnings
2012-10-11 00:29:10 -07:00
Kenny Root
ef5d0340e4 toolbox: silence some compiler warnings
Comparison of signed and unsigned integers. Use parenthesis around a
group of bitwise OR operations.

Change-Id: Ia404380593ce2c2a291133c07c0fc7a016a3ad3f
2012-10-10 11:28:27 -07:00
Michal Frynas
1f90dcd0c0 Fixed improper size displaying in 'df' utility
'df' command used to display filesystem usage statistics as integer
values, in most cases rounding the actual value down. Because of
that 'df' tended to display faulty size values.
This fix to 'df' utility calculates the fractional part of the size,
then it rounds it when needed to the nearest one-digit integer value
and displays after decimal dot.

Change-Id: I9bc52635d45d3e55ce61b3b1c6b80d1267516e75
2012-10-02 10:39:19 +02:00
Jeff Sharkey
ad8663e970 am 08f748a2: am 42a1e6c9: Merge "Iteration on multi-user external storage." into jb-mr1-dev
* commit '08f748a2f8e6933fdd96290de049c1aa1f3f8479':
  Iteration on multi-user external storage.
2012-08-22 18:21:03 -07:00
Jeff Sharkey
bfcd810b79 Iteration on multi-user external storage.
Define /storage as top-level concept, so that we enforce permissions
uniformly.  Moves external storage paths from headers to per-device
environment variables.  Added missing mount flags, and we no longer
have adb-specific external storage.

Bug: 6925012
Change-Id: Ic7ca953be2f552d3f0ec9e69f89fef751daa1b29
2012-08-22 14:28:37 -07:00
Jean-Baptiste Queru
1ef97deea5 am 81eecb1e: am 2ab69388: am 76080925: am 52d5dfc8: Merge "vmstat: Fix -n flag"
* commit '81eecb1eb8c23e603c78d60a7278a3afd1798962':
  vmstat: Fix -n flag
2012-08-20 14:56:02 -07:00
Jean-Baptiste Queru
2ab69388cb am 76080925: am 52d5dfc8: Merge "vmstat: Fix -n flag"
* commit '76080925410db41cfa5c70ffcffaa2b3b4d59aad':
  vmstat: Fix -n flag
2012-08-20 14:51:52 -07:00
Jean-Baptiste Queru
52d5dfc8d3 Merge "vmstat: Fix -n flag" 2012-08-20 14:25:13 -07:00
Jon Larimer
78f7aefae2 Merge "Make usage() static in du.c to avoid conflicts" 2012-08-14 10:38:45 -07:00
Kenny Root
3790b9be66 am f48a4b4b: am ba822edb: am 02e9f8d5: am 53dab583: Merge "Make setenforce usage function static."
* commit 'f48a4b4be699f63670acbff94b78e1fdf3b4338c':
  Make setenforce usage function static.
2012-08-13 16:08:20 -07:00
Kenny Root
ba822edb30 am 02e9f8d5: am 53dab583: Merge "Make setenforce usage function static."
* commit '02e9f8d5aa390d89f79b2b3bb8630af4062b4d2c':
  Make setenforce usage function static.
2012-08-13 16:03:25 -07:00
Jon Larimer
f286dd75f6 Make usage() static in du.c to avoid conflicts
Change-Id: Ic6b036d050943fb5f0af8553c081ca75362167e8
2012-08-13 16:02:55 -04:00
Matt Finifter
492051ed2a Make setenforce usage function static.
Change-Id: I6de204dc072418805160a35d799b8948ecb39251
2012-08-13 12:56:23 -07:00
Kenny Root
28358cf9e7 am a0347971: am 605103fb: resolved conflicts for merge of 4dcd52ab to jb-mr1-dev
* commit 'a0347971dec3dc34c6ccebad5170ced255fdf35f':
  Add support for reloading policy from /data/system.
2012-08-13 10:26:19 -07:00
Kenny Root
605103fb55 resolved conflicts for merge of 4dcd52ab to jb-mr1-dev
Change-Id: Ibd0c03a7883a2e31adab18543c016776b7b36866
2012-08-13 10:21:35 -07:00
Stephen Smalley
ae6f3d7c05 Add support for reloading policy from /data/system.
To support runtime policy management, add support for reloading
policy from /data/system.  This can be triggered by setting the
selinux.loadpolicy property to 1, whether from init.rc after
mounting /data or from the system_server (e.g. upon invocation of
a new device admin API for provisioning policy). ueventd and
installd are restarted upon policy reloads to pick up the new
policy configurations relevant to their operation.

Change-Id: I97479aecef8cec23b32f60e09cc778cc5520b691
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2012-08-09 09:59:10 -04:00
Elliott Hughes
7acf56f8f7 am 79737802: am 8268a75e: am c5db017c: am 63b2c577: Merge "Conditionally use SIGSTKFLT"
* commit '79737802421d7b32707f1c248b5ecb239965234a':
  Conditionally use SIGSTKFLT
2012-08-08 15:11:22 -07:00
Elliott Hughes
8268a75e86 am c5db017c: am 63b2c577: Merge "Conditionally use SIGSTKFLT"
* commit 'c5db017cc3d30b1b15544ca9889e66890710f93c':
  Conditionally use SIGSTKFLT
2012-08-08 14:06:25 -07:00
Michael Wright
52abb4b1ef Added clear command to toolbox
Change-Id: Ifb1b7693727997b94614f7da73081f0894ee88ad
2012-08-07 21:47:51 -07:00
Chris Dearman
7ac420972a Conditionally use SIGSTKFLT
Change-Id: I555b33b5a93df332c556944a1c00fff417825247
2012-08-01 15:51:09 -07:00
Jeff Sharkey
3e8b1581ff Ported "grep" from NetBSD to toolbox.
Bug: 6798417
Change-Id: I581c496a726a4814edaaa3672849c090bac8552c
2012-07-13 16:37:38 -07:00
Jeff Sharkey
57df14c654 Ported "cp" from NetBSD to toolbox.
Bug: 6798417
Change-Id: I716ab459b9edf4c7405bf042adbee0300b6f51c9
2012-07-13 16:26:30 -07:00
Arun Raghavan
6caab4ce95 vmstat: Fix -n flag
The loop condition for the number of iterations basically caused the
argument to -n to be ignored. This fixes the condition appropriately.
2012-07-10 10:43:57 +05:30
Ken Sumrall
8103e91483 Add the du command to toolbox
The code is from NetBSD, with the -n and -h options removed to make
porting easy.  Also, removed support for the BLOCKSIZE environment
variable for the same reason.

Change-Id: Ib927ff3527e02802785fdd7f75bab1f05222918e
2012-07-09 17:33:08 -07:00
Nick Kralevich
3f2b0a506f Add mode when open(O_CREAT) is used.
When creating a new file using open(..., O_CREAT), it is an error
to fail to specify a creation mode. If a mode is not specified, a
random stack provided value is used as the "mode".

This will become a runtime error in a future version of Android.

Change-Id: I00609f37d2ea68e21b6404d542830386be354202
2012-06-26 14:59:36 -07:00
Jean-Baptiste Queru
60f3d65c83 am 2a2e10fb: am 16d2b6ae: am 91e5551f: Merge "toolbox: rmmod: fix module unloading"
* commit '2a2e10fbb38e4f4d7759f619275fa4ebd596259a':
  toolbox: rmmod: fix module unloading
2012-06-11 15:28:12 -07:00
Jean-Baptiste Queru
2a2e10fbb3 am 16d2b6ae: am 91e5551f: Merge "toolbox: rmmod: fix module unloading"
* commit '16d2b6ae4050b1232fd164cef1dbade532fe29a4':
  toolbox: rmmod: fix module unloading
2012-06-11 15:25:44 -07:00
Jean-Baptiste Queru
91e5551f88 Merge "toolbox: rmmod: fix module unloading" 2012-06-11 15:16:07 -07:00
Jeff Sharkey
393e559ddc Enable conv=fdatasync in dd.
Matches behavior of coreutils dd.  Also removes unsupported
conversions.

Change-Id: I9ed5a7d43b5b083041b261ce70f6c835b41dc7ac
2012-05-29 14:26:04 -07:00
Jean-Baptiste Queru
79c71831ca am a802b837: am 1d5e7885: Merge "toolbox: implement rm -f flag"
* commit 'a802b8374a22da9f52541e1fc286dcbdb1cfa1b4':
  toolbox: implement rm -f flag
2012-05-25 08:12:59 -07:00
Vishal Bhoj
fc26c0ba59 toolbox: rmmod: fix module unloading
Replace "-" with "_" in module name. This would keep
rmmod compatible with module-init-tools version of rmmod

Change-Id: I4470d9a98bc2f299acd94859fca4403aee279d2b
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
2012-05-15 18:01:34 +05:30
Jeff Brown
1ee467c760 Delete dead code.
This file is not compiled and not used.

Bug: 6435382
Change-Id: I3a08690950f1c77f8b0bc57a9e5cdb6eb402ac77
2012-05-11 17:35:16 -07:00
Tanguy Pruvot
0ffc5b37e5 toolbox: implement rm -f flag
this prevent compatibility errors in scripts (file "-f" not found)
The force flag will not return an error if the file doesnt exist.

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>

Change-Id: I3267963284ee247629da5ab299e900c6e4a4ac68
2012-05-06 02:36:00 +02:00
Kenny Root
a64adba539 Add signal names to kill
mksh provides a kill primitive with signal names, but also offer it in
our toolbox binary. This will allow anyone to use "kill -HUP <pid>" or
"kill -l" to look at the name to number signal mapping.

Change-Id: Id683721f4ad3f2b518b4dc54a6073510290cbe04
2012-04-06 09:05:49 -07:00
Ken Sumrall
ec3b164524 Make sure FAT32 filesystems contain a minimum of 65527 clusters
Some versions of windows cannot handle FAT32 filesystems with less
than 65527 clusters, so make sure we don't create such beasts.

Change-Id: Id00fb02c4f8476f7dcc0ef137bd9e4975d740591
2012-03-29 21:05:46 -07:00
Glenn Kasten
86c7cc8189 Add get_sched_policy_name() and use in ps and top
This will make it easier to add additional policies (cgroups) if needed.
Also added comments to the sched_policy APIs.

Change-Id: I33ce1cc4deae10983241f7391294b7a512d2c47c
2012-03-15 15:10:45 -07:00
Jeff Sharkey
0afee8b668 Merge "Change "chown" to coreutils syntax." 2012-03-02 16:10:50 -08:00
Jeff Sharkey
474cea824f Change "chown" to coreutils syntax.
Change-Id: I7d997b3254354908317feee54b6df9b2419718a6
2012-03-02 15:11:53 -08:00
Jean-Baptiste Queru
ca3bf25570 am 25443f80: am 1e28088f: am 5cc398ef: Merge "Toolbox implementation of chown has a bad print"
* commit '25443f80a27c6153c3406b4443fd07442e410a57':
  Toolbox implementation of chown has a bad print
2012-02-28 15:19:17 -08:00
Jean-Baptiste Queru
5cc398ef00 Merge "Toolbox implementation of chown has a bad print" 2012-02-28 14:59:56 -08:00
Jean-Baptiste Queru
1ae8d4eaa3 resolved conflicts for merge of 44898072 to master
Change-Id: Ib77a4d9161261306253a174727801526e7149621
2012-02-24 12:05:31 -08:00
Stephen Smalley
8290d1083e Extend toolbox with SE Android support.
Add -Z option to ls and ps for displaying security contexts.
Modify id to display security context.
Add new SELinux commands: chcon, getenforce, getsebool, load_policy, restorecon, runcon, setenforce, setsebool.

Change-Id: Ia20941be4a6cd706fe392fed6e38a37d880ec5f1
2012-02-03 11:11:15 -05:00
Johan Norberg
69ab6de333 Toolbox implementation of chown has a bad print
When the chown program fails it prints out an error message
and is describing itself as chmod. This has been corrected.

Change-Id: I2c489975f09343bdf66acbf7df6e7183c2daff78
Signed-off-by: christian bejram <christian.bejram@stericsson.com>
2012-01-20 17:28:42 -08:00
Jean-Baptiste Queru
f124435c46 am 82dd6af8: am e7b1f132: Merge "rmmod: fix full path syntax"
* commit '82dd6af84676f1ea6f67ce6fbd2c5cea7a8aa601':
  rmmod: fix full path syntax
2012-01-13 11:30:24 -08:00
Scott Anderson
7e4c303fe0 Fix hd command so it doesn't error out on EOF
hd would error out on files that were not a multiple of its read
buffer size (4096).  For example:
Read error on init.rc, offset 17040 len 4096, No such file or directory

The fix is to stop reading on EOF instead of treating it as an
error.

Signed-off-by: Scott Anderson <saa@google.com>

(cherry picked from commit a9fac4155f)

Change-Id: Ib2af725fc39e96c2f81559f61979d451604d4817
2012-01-12 15:17:07 -08:00
Tanguy Pruvot
ec4db51f88 rmmod: fix full path syntax
rmmod /system/modules/multitouch.ko
rmmod: delete_module '/multitouch' failed (errno 2)

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
2012-01-12 20:44:02 +01:00
Scott Anderson
d0455c952d Add md5 command to toolbox.
This command outputs the MD5 for specified files.  The output is
in the same form as the md5sum command on Linux.

Change-Id: Ie0e6faf678469ac886bba8b46d98c0e54976a1ed
Signed-off-by: Scott Anderson <saa@google.com>
2012-01-11 18:13:26 -08:00
Kenny Root
b953fc2849 Use strlcpy instead of strncpy
Also make sure the read cmdline is terminated with a null byte.

Change-Id: I6b4aa197ce9bc072a912b7163e8616a03b39c3fe
2011-12-01 14:54:13 -08:00
Jeff Brown
e4e21796f7 Make timestamps friendlier.
Change-Id: I378c3028630a7f805c3f730da02bbbfe07ec3654
2011-11-23 15:02:41 -08:00
Jeff Brown
9de370e165 Show the resolution of each axis.
Change-Id: I81c4b7e6480b98e59fb389060ab2c8d34257ae5f
2011-08-16 17:19:30 -07:00
Jeff Brown
4ac87154c1 Dump the HID descriptor when available.
Also, always print the input properties when -p is
specified.

Change-Id: Ibacb6dd26ccab68c85b76928df60fdc2a53c198c
2011-07-24 14:30:44 -07:00
Kenny Root
81231596c5 am 070ec8e0: resolved conflicts for merge of 3ea075be to honeycomb-plus-aosp
* commit '070ec8e02e12aafc8a636737bba3d5ead7cecd8e':
  Add -F for classify to ls
2011-07-15 14:12:18 -07:00
Kenny Root
070ec8e02e resolved conflicts for merge of 3ea075be to honeycomb-plus-aosp
Change-Id: Ic668cb99822d4bc44f2f57782afd1a6c1b348e9b
2011-07-15 11:20:14 -07:00
Jeff Brown
baf6b6bdeb Show why umount failed.
Change-Id: Id2b3fbc46b8dfbe2f05637fb35c298915cd5f524
2011-07-14 13:43:57 -07:00
Ken Sumrall
e877ad7ae3 Merge "Add -o loop= option to mount, and fix error detection in mount and umount" 2011-07-13 18:57:28 -07:00
Kenny Root
40dac65941 Add -F for classify to ls
Adds a field to the non-long version of ls that tells what type of file
it is (i.e., regular, directory, link, fifo, etc).

This is useful for scripts that don't have direct filesystem access.

Change-Id: I54a327390f6ed403acb13c824f62ba9594ba320d
2011-07-13 17:53:50 -07:00
Ken Sumrall
940c81078e Add -o loop= option to mount, and fix error detection in mount and umount
This fixes bug http://b.android.com/18419, which complains about a bogus
error check in the mount command (it also was wrong in the umount command)
and also asks for the mount command to support more than one loopback
device, as mentioned in the FIXME comments in mount.c.  This required some
corresponding changes to umount.c

Change-Id: Ib796c70926395e61557e487bad64984d3295d5f3
2011-07-13 14:37:41 -07:00
Jeff Brown
fb9134e3d0 Merge "getevent: Fix a couple of bugs." 2011-06-30 14:35:46 -07:00
Jeff Brown
f6d0f8af17 getevent: Fix a couple of bugs.
Fixed a bug printing the event value when using labels.

Stop trying to print the available codes for EV_SYN because
we cannot actually query them.  EVIOCGBIT(0, size) is a special
case that returns the set of events that are supported, and
EV_SYN == 0.

Change-Id: Iea086ba24300ca0815e4814a3bc5ff60756612c2
2011-06-29 20:52:08 -07:00
Jeff Brown
f96993eb4e lsof: Print process user name.
Change-Id: I6e96faba894ad8c2eeb06e514d332c8ab2ec52f0
2011-06-29 15:00:39 -07:00
Jeff Brown
f8754337d8 Enhance getevent to print event labels.
Added -l argument to print labels for event types, codes and values.
Added -i argument to print all device info.
Added support for printing input properties.

Change-Id: I3cacb716dbc38f50217b9dfc24ba44d08f352603
2011-06-15 17:44:52 -07:00
Erik Gilling
b76f0ff700 add r to eng and userdebug builds
Change-Id: Ia52a4897e300568dad2c8c1c7af1fe228d058eaf
2011-04-28 14:23:26 -07:00
Ken Sumrall
795165bc15 Add the touch command to toolbox.
I wrote this to test my fix to support utime(2) system calls in the
sdcard fuse filesystem for stingray, and decided to finish sprucing
it up and make it part of toolbox.  In an effort to keep it small,
it doesn't accept dates a la touch, but just a time_t value.

Change-Id: I5dd011cd2e34d0cc605d6f40e46b96a8c949f194
2011-04-05 20:50:03 -07:00
Ken Sumrall
bb889dde13 am 276df093: am 70987108: Merge "Try to unmount writable filesystems when rebooting" into honeycomb-mr1
* commit '276df0936dbf438b32ab099b04f69f01d7f1eed7':
  Try to unmount writable filesystems when rebooting
2011-03-10 19:29:39 -08:00
Ken Sumrall
e3aeeb4de3 Try to unmount writable filesystems when rebooting
Ext4 filesystems like to be unmounted before rebooting.  The Android system
doesn't have a traditional Linux init setup, and shutting down the system
was not much more than calling sync(2) and reboot(2).  This adds a new
function to libcutils called android_reboot().  By default, it calls sync()
and then remounts all writable filesystems as read-only and marks them clean.
There is a flag parameter in which the caller can ask for sync() not to be
called, or to not remount the filesystems as read-only.  Then it will call
reboot(2) as directed by the other parameters.  This change also updates
adb, init and toolbox to call the new android_reboot() function.
Fixes bugs 3350709 and 3495575.

Change-Id: I16d71ffce3134310d7a260f61ec6f4dd204124a7
2011-03-10 18:11:46 -08:00
Brad Fitzpatrick
d8ed091c6e Restart surfaceflinger with stop/start too.
Change-Id: Ide045fc3baced9e1bde95cb26d0b835511c21780
2011-03-07 10:39:17 -08:00
Mike Lockwood
53df0b6393 Merge "lsof: Add support for printing open files for a single process" 2011-02-17 11:39:12 -08:00
Brian Muramatsu
a95abdd8ed Fix getprop Format
getprop used to output a colon after the property name like:
[property.name]: [property.value]

Add back the colon that was missing, because
com.android.ddmlib.GetPropReceiver's regex expects it. Without
the colon, the GetPropReceiver doesn't parse the device's
properties causing CTS to not recognize the device.

Change-Id: I9bef5ab2b310c831c49c8c51cae7f129167c2dc5
2011-02-14 17:17:21 -08:00
Colin Cross
0f951a4fb8 am 618eca4e: am 6fa54fa2: Merge "Accept address ranges in r" into honeycomb
* commit '618eca4ed91af2d2a2c618168327ca4a6a496669':
  Accept address ranges in r
2011-01-19 17:49:18 -08:00
Colin Cross
2ad280f07a Accept address ranges in r
Change-Id: Ifece1b37d018216462844cc89e0f2f6a2b7d287d
2011-01-19 17:23:40 -08:00
David 'Digit' Turner
318f00c043 Merge "toolbox: make getprop print a sorted list of properties" 2011-01-10 03:37:19 -08:00
David 'Digit' Turner
a8d1afb3e9 toolbox: make getprop print a sorted list of properties
This patch also factors out the dynarray_t/strlist_t code
from ls.c and moves it to dynarray.[hc].

Change-Id: Ifae2b364d7c2733aad5551ad3c78ae72f8ac31f4
2011-01-08 12:22:08 +01:00
Colin Cross
9d6d030f83 uptime: Use clock_gettime to get monotonic time
The first field in /proc/uptime is bootbased time, not monotonic
time.  If the kernel tracks bootbased time correctly, it counts
elapsed run time as well as sleep time, which is the same as the
elapsed time in the android alarm driver, and sleep time is
always returned as 0.

Use clock_gettime(CLOCK_MONOTONIC) instead, which will return
elapsed run time not counting sleep time on all platforms.

Change-Id: I28a22e8c93d78f62666ee8c877c7c6718a2b640a
2011-01-05 15:22:09 -08:00
Mike Lockwood
123538954b Change libusbhost from static to shared library
Change-Id: I0c16cc4536c4ab700c33433c8a6323ade7cfc95d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-29 08:33:24 -05:00