Commit graph

563 commits

Author SHA1 Message Date
Greg Hackmann
68e9b6bc94 toolbox: reimplement watchprops using __system_property_foreach()
Internally, replace the watchlist array with a hashmap since the array
assumes properties are enumerated in a consistent order and foreach()
probably won't.  (find_nth() never guaranteed this either but it usually
worked in practice.)

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit 389e358017)

Change-Id: I1db3137b130474f4bb205f01f0bdcf37cf974764
2013-06-18 19:26:28 -07:00
Greg Hackmann
389e358017 toolbox: reimplement watchprops using __system_property_foreach()
Internally, replace the watchlist array with a hashmap since the array
assumes properties are enumerated in a consistent order and foreach()
probably won't.  (find_nth() never guaranteed this either but it usually
worked in practice.)

Change-Id: I83843facdd671edd09652edf472e88ec3d1edd3b
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2013-06-18 16:37:54 -07:00
Colin Cross
99c1a4168b resolved conflicts for merge of 95a41f6b to stage-aosp-master
Change-Id: Icfae29edf989fb43a7f0b8bda188a9807f76a3b9
2013-06-17 18:19:28 -07:00
Colin Cross
8196316411 toolbox: hide property implementation from watchprops
(cherry picked from commit 91779634de)

Change-Id: I7a2d8aa507ac61cedc5f67c563531a7d4ec8e4c2
2013-06-17 16:58:09 -07:00
Colin Cross
91779634de toolbox: hide property implementation from watchprops
Change-Id: Ia6609116d641d3354971ca40a16ffcab38484150
2013-06-17 13:13:40 -07:00
Brian Carlstrom
89c2be335d am 603746f0: am 59fa7e10: Merge "Fixed reversed output in netstat Recv-Q Send-Q columns"
* commit '603746f0e3b645954f33be36f7602cc8205cb71c':
  Fixed reversed output in netstat Recv-Q Send-Q columns
2013-06-04 11:17:19 -07:00
Brian Carlstrom
603746f0e3 am 59fa7e10: Merge "Fixed reversed output in netstat Recv-Q Send-Q columns"
* commit '59fa7e107d43a4ef521413ec0bb7b0c2a5525071':
  Fixed reversed output in netstat Recv-Q Send-Q columns
2013-06-04 10:28:55 -07:00
Brian Carlstrom
3c412f6260 Fixed reversed output in netstat Recv-Q Send-Q columns
Change-Id: I2bc7ac6c886808910212432497f05e34596f5e85
2013-06-03 19:24:44 -07:00
Nick Kralevich
29393d69b3 fix another misuse of strncat
This has the potential to overflow "buffer" if the command line
is more than 4K.

Change-Id: Icdfed0d9d21804f290b75787ef3809e0475b14f0
2013-06-03 13:40:11 -07:00
Nick Kralevich
960ac434a4 fix strncat misuse
The third argument of strncat() tells how much data to append from
src, not the total size of the buffer.

Change uses of strncat() to strlcat(), which has the buffer overflow
protection behavior intended by the original author.

This fixes the following compiler warning:

In function 'strncat',
    inlined from 'print_type' at system/core/toolbox/lsof.c:76:12:
bionic/libc/include/string.h:142:5: warning: call to __builtin___strncat_chk might overflow destination buffer [enabled by default]

Change-Id: Id69edc641de3cb87d1867a409cd57b04b12f90a7
2013-06-03 12:13:36 -07:00
Nick Kralevich
44a5fb5704 Merge "fs_mgr: make block devices read-only" 2013-04-25 20:22:20 +00:00
Nick Kralevich
49edc0acf8 am 4c1840e6: am 5ea58543: Merge "mount: fix incorrect string length calculation"
* commit '4c1840e6547266ba251d8c34905036d73240ff57':
  mount: fix incorrect string length calculation
2013-04-24 17:37:37 -07:00
Nick Kralevich
4c1840e654 am 5ea58543: Merge "mount: fix incorrect string length calculation"
* commit '5ea58543154a97c42c0b7fc58c2639a4fea64f5b':
  mount: fix incorrect string length calculation
2013-04-24 17:36:11 -07:00
Nick Kralevich
29a5298366 mount: fix incorrect string length calculation
Fix bug https://code.google.com/p/android/issues/detail?id=54192
which incorrectly calculated the length of a string.

Fix compiler warning:

system/core/toolbox/mount.c:59:2: warning: initializer-string for array of chars is too long [enabled by default]
system/core/toolbox/mount.c:59:2: warning: (near initialization for 'options[16].str') [enabled by default]

Change-Id: If8663f8311c6348a730fcf731d402b57fee10cb5
2013-04-24 16:31:02 -07:00
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
Mike Lockwood
794cc3fdd3 lsof: Add support for printing open files for a single process
Change-Id: If2afa0937064dffca6df2a8642ca75009dc6e70e
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-22 16:39:12 -05:00
Erik Gilling
bec29d4b48 toolbox: add verbose option for lsusb
Change-Id: If9c51d96af7d69395917af55bb337352576f9422
2010-12-09 17:14:27 -08:00
Erik Gilling
fd1e855323 toolbox: add lsusb command
Change-Id: I166d2859633ba4e15f170938262dcf6505b78dd3
2010-12-09 15:27:52 -08:00
Olivier Bailly
b93e5812fa Add missing headers for compilation on x86 targets
Change-Id: I5f4dc797b353a0f01fa00d38375ec303bf863254
2010-11-17 11:47:23 -08:00
Brad Fitzpatrick
e7fe5bf3ac Add ls -n to toolbox.
Change-Id: I641f9504554d14fb1289ac470e6e61c5bc12e9c7
2010-10-25 13:30:41 -07:00
Brian Carlstrom
e3ba1801f0 am f1fd5eb8: am 2f7b72f9: netstat should include /proc/net/tcp6 and /proc/net/udp6 data
Merge commit 'f1fd5eb8cca9f1096c4d0de5abbbd2b264fd1b9e'

* commit 'f1fd5eb8cca9f1096c4d0de5abbbd2b264fd1b9e':
  netstat should include /proc/net/tcp6 and /proc/net/udp6 data
2010-09-29 12:58:11 -07:00
Brian Carlstrom
f1fd5eb8cc am 2f7b72f9: netstat should include /proc/net/tcp6 and /proc/net/udp6 data
Merge commit '2f7b72f9e8d06c80957cdf384d23d3bf5bd5ce5c' into gingerbread-plus-aosp

* commit '2f7b72f9e8d06c80957cdf384d23d3bf5bd5ce5c':
  netstat should include /proc/net/tcp6 and /proc/net/udp6 data
2010-09-28 23:37:09 -07:00
Brian Carlstrom
2f7b72f9e8 netstat should include /proc/net/tcp6 and /proc/net/udp6 data
Update netstat.c to process /proc/net/tcp6 and /proc/net/udp6.
Example input and output and output follows.

cat /proc/net/tcp:
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode
   0: 0100007F:13AD 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 669 1 c74dbb40 300 0 0 2 -1
   1: 0100007F:A432 0100007F:2253 01 00000000:00000000 00:00000000 00000000     0        0 15257 1 c74da040 22 4 16 2 -1

cat /proc/net/udp:
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode ref pointer drops

cat /proc/net/tcp6:
  sl  local_address                         remote_address                        st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode
   0: 00000000000000000000000000000000:8A88 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 15461 1 c730aaa0 300 0 0 2 -1
   1: 00000000000000000000000000000000:2253 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 15255 1 c7393060 300 0 0 2 -1
   2: 00000000000000000000000000000000:C91B 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 15261 1 c6591080 300 0 0 2 -1
   3: 0000000000000000FFFF00000100007F:C91B 0000000000000000FFFF00000100007F:9238 01 00000000:00000000 00:00000000 00000000     0        0 15263 1 c7394aa0 22 4 29 4 -1
   4: 0000000000000000FFFF00000100007F:C0E9 0000000000000000FFFF00000100007F:D3A4 01 00000000:00000000 00:00000000 00000000     0        0 15274 1 c7393aa0 22 4 26 4 -1
   5: 0000000000000000FFFF00000100007F:C41A 0000000000000000FFFF00000100007F:B031 01 00000000:00000000 00:00000000 00000000     0        0 15269 1 c7126ac0 22 4 29 4 -1
   6: 0000000000000000FFFF00000100007F:2253 0000000000000000FFFF00000100007F:A432 01 00000000:00000000 00:00000000 00000000     0        0 15256 1 c65e9040 21 0 0 5 -1
   7: 0000000000000000FFFF00000100007F:9238 0000000000000000FFFF00000100007F:C91B 01 00000000:00000000 00:00000000 00000000     0        0 15262 1 c7394580 22 4 16 4 -1
   8: 0000000000000000FFFF00000100007F:B031 0000000000000000FFFF00000100007F:C41A 01 00000000:00000000 00:00000000 00000000     0        0 15268 1 c71585a0 22 4 16 4 -1
   9: 0000000000000000FFFF00000100007F:8A88 0000000000000000FFFF00000100007F:8A31 01 00000000:00000000 00:00000000 00000000     0        0 15503 1 c71265a0 22 4 30 2 -1
  10: 0000000000000000FFFF00000100007F:D3A4 0000000000000000FFFF00000100007F:C0E9 01 00000000:00000000 00:00000000 00000000     0        0 15273 1 c7126080 22 4 12 4 -1
  11: 0000000000000000FFFF00000100007F:8A31 0000000000000000FFFF00000100007F:8A88 01 00000000:00000000 00:00000000 00000000     0        0 15502 1 c730a060 22 0 0 3 -1

cat /proc/net/udp6:
  sl  local_address                         remote_address                        st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode ref pointer drops
   86: 00000000000000000000000000000000:A256 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000  1000        0 14302 2 c6d13820 0
  102: 00000000000000000000000000000000:A466 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000  1000        0 14301 2 c6d13ac0 0
  125: 00000000000000000000000000000000:8B7D 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000  1000        0 14295 2 c6d13d60 0

netstat:
Proto Recv-Q Send-Q Local Address          Foreign Address        State
tcp        0      0 127.0.0.1:5037         0.0.0.0:*              LISTEN
tcp        0      0 127.0.0.1:42034        127.0.0.1:8787         ESTABLISHED
tcp6       0      0 :::35464               :::*                   LISTEN
tcp6       0      0 :::8787                :::*                   LISTEN
tcp6       0      0 :::51483               :::*                   LISTEN
tcp6       0      0 ::ffff:127.0.0.1:51483 ::ffff:127.0.0.1:37432 ESTABLISHED
tcp6       0      0 ::ffff:127.0.0.1:49385 ::ffff:127.0.0.1:54180 ESTABLISHED
tcp6       0      0 ::ffff:127.0.0.1:50202 ::ffff:127.0.0.1:45105 ESTABLISHED
tcp6       0      0 ::ffff:127.0.0.1:8787  ::ffff:127.0.0.1:42034 ESTABLISHED
tcp6       0      0 ::ffff:127.0.0.1:37432 ::ffff:127.0.0.1:51483 ESTABLISHED
tcp6       0      0 ::ffff:127.0.0.1:45105 ::ffff:127.0.0.1:50202 ESTABLISHED
tcp6       0      0 ::ffff:127.0.0.1:35464 ::ffff:127.0.0.1:35377 ESTABLISHED
tcp6       0      0 ::ffff:127.0.0.1:54180 ::ffff:127.0.0.1:49385 ESTABLISHED
tcp6       0      0 ::ffff:127.0.0.1:35377 ::ffff:127.0.0.1:35464 ESTABLISHED
udp6       0      0 :::41558               :::*                   CLOSE
udp6       0      0 :::42086               :::*                   CLOSE
udp6       0      0 :::35709               :::*                   CLOSE

Bug: 2511871

Change-Id: I25e0470ba65e8a88e57506ae26232a7c43a9c16b
2010-09-28 22:22:02 -07:00
Brian Swetland
14200b4c3b am 5833769d: am 09dd3e57: make df more readable
Merge commit '5833769d9aa41dfb28a74c665fda0fca9c321fc1'

* commit '5833769d9aa41dfb28a74c665fda0fca9c321fc1':
  make df more readable
2010-09-11 18:42:53 -07:00
Brian Swetland
5833769d9a am 09dd3e57: make df more readable
Merge commit '09dd3e57b920c8f65cb486313a4c0f35b8cb9f46' into gingerbread-plus-aosp

* commit '09dd3e57b920c8f65cb486313a4c0f35b8cb9f46':
  make df more readable
2010-09-11 18:34:21 -07:00
Brian Swetland
09dd3e57b9 make df more readable
Filesystem             Size   Used   Free   Blksize
/dev                   164M    32K   164M   4096
/system                442M   117M   325M   4096
/cache                 492M     8M   483M   4096
/data                  984M    59M   925M   4096
/mnt/sdcard             12G    27M    12G   32768

Change-Id: I9a84b7b84ae528ee5cf0b1e92a8bee032b87703b
2010-09-11 18:19:35 -07:00
Dmitry Shmidt
4358544a3f toolbox: top: Add processor field
Change-Id: I9f8e45a963a0773f27ddcd1d249aecac1ab9152e
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-08-30 16:39:14 -07:00
Dmitry Shmidt
8b37c91b93 ps: Add -c flag to show CPU number last executed on
Change-Id: I9a8faef0824c390ef980ce6c33e9c79102884879
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-08-18 17:26:26 -07:00
Jean-Baptiste Queru
30be93c6e2 am 60c8f863: resolved conflicts for merge of 0fcbdb41 to gingerbread-plus-aosp
Merge commit '60c8f863ca84f3e5bb8e78d8001c53511f094d53'

* commit '60c8f863ca84f3e5bb8e78d8001c53511f094d53':
  Userland support for VM interconnection
2010-07-29 15:55:34 -07:00
Jean-Baptiste Queru
60c8f863ca resolved conflicts for merge of 0fcbdb41 to gingerbread-plus-aosp
Change-Id: I1396cd97b28f316849016d55596ad52fffd3235c
2010-07-29 15:53:16 -07:00
Jean-Baptiste Queru
0fcbdb4147 Merge "Userland support for VM interconnection" 2010-07-29 15:04:57 -07:00
Kenny Root
7a58bcfb1e am 331eb52d: am 5a0adf95: Merge "Add basic lsof command" into gingerbread
Merge commit '331eb52d611de6bd2e70a2b0bde1f3c3733ce657'

* commit '331eb52d611de6bd2e70a2b0bde1f3c3733ce657':
  Add basic lsof command
2010-07-27 13:02:58 -07:00
Kenny Root
331eb52d61 am 5a0adf95: Merge "Add basic lsof command" into gingerbread
Merge commit '5a0adf95b1170d3d9ec91b0106662cd17514f0e4' into gingerbread-plus-aosp

* commit '5a0adf95b1170d3d9ec91b0106662cd17514f0e4':
  Add basic lsof command
2010-07-27 13:00:58 -07:00
Kenny Root
5a0adf95b1 Merge "Add basic lsof command" into gingerbread 2010-07-27 12:58:23 -07:00
Kenny Root
2d392f24b8 am 65757da0: am 53308d4c: Correct copyright header for uptime and NOTICE
Merge commit '65757da0c99cb4b49e1dc9e21facc7b4e67192cd'

* commit '65757da0c99cb4b49e1dc9e21facc7b4e67192cd':
  Correct copyright header for uptime and NOTICE
2010-07-27 11:41:50 -07:00
Kenny Root
65757da0c9 am 53308d4c: Correct copyright header for uptime and NOTICE
Merge commit '53308d4cd5c4414402e979a6771f7ef3b35f5c2f' into gingerbread-plus-aosp

* commit '53308d4cd5c4414402e979a6771f7ef3b35f5c2f':
  Correct copyright header for uptime and NOTICE
2010-07-27 11:39:19 -07:00
Kenny Root
53308d4cd5 Correct copyright header for uptime and NOTICE
Change-Id: I89f91c21db87955b20b1ef9b4590f7009f106b26
2010-07-27 11:26:06 -07:00
Kenny Root
8b9b105bc7 Add basic lsof command
Basic "list open files" command.

Supports reading all processes for their "exe", "cwd", "root", and "fd"
entries.

Change-Id: I2e2f0911dd65a1993aa1ce9f51222bf264a9d68d
2010-07-27 11:22:20 -07:00
The Android Open Source Project
534bc027a2 am 869cc685: merge from open-source master
Merge commit '869cc685b171c5c0c1efbad5df693cfaebe0af43'

* commit '869cc685b171c5c0c1efbad5df693cfaebe0af43':
  fix insmod reading more than one module parameter
2010-07-16 13:30:54 -07:00
The Android Open Source Project
869cc685b1 merge from open-source master
Change-Id: I9365615f5f94484fb5ab28bb076b25fb4721e2bc
2010-07-16 13:23:40 -07:00
Jean-Baptiste Queru
e3f6a6e1d3 Merge "fix insmod reading more than one module parameter" 2010-07-16 07:26:05 -07:00
Dries Harnie
2a743730c7 Userland support for VM interconnection
Change-Id: I699608f3072b39c8da1a7cc313bd0b736e90f225
2010-07-15 13:19:37 +02:00
The Android Open Source Project
f4f7697f69 am 0bcda269: merge from open-source master
Merge commit '0bcda269708bbc4f4bd729765e3d4d84e0fd5e60'

* commit '0bcda269708bbc4f4bd729765e3d4d84e0fd5e60':
  Add -R to chmod
  Add -p support to mkdir
2010-07-14 16:16:20 -07:00
The Android Open Source Project
0bcda26970 merge from open-source master
Change-Id: If9a300a80228f30166ed42853ae13236aaa2eee5
2010-07-14 16:12:40 -07:00
Jean-Baptiste Queru
6cebee2647 Merge "Add -R to chmod" 2010-07-14 15:17:47 -07:00
Jean-Baptiste Queru
34225919ab Merge "Add -p support to mkdir" 2010-07-14 15:15:53 -07:00
Anthony Newnam
365a09e817 Add -R to chmod
Change-Id: I30f976598bd937f656a3ad3395349f09e695cfce
2010-07-14 13:30:11 -05:00
Anthony Newnam
b55de67985 Add -p support to mkdir
Change-Id: Ia0298ccc6b476d6bd6756471c05ef2a345312734
2010-07-14 13:29:42 -05:00
Kenny Root
45f7fde3c9 am 0b1ff6be: am eb42170e: Display file sizes larger than 2GB correctly
Merge commit '0b1ff6be08844c541e36fd735b41990453582ec1'

* commit '0b1ff6be08844c541e36fd735b41990453582ec1':
  Display file sizes larger than 2GB correctly
2010-06-25 14:21:11 -07:00
Kenny Root
0b1ff6be08 am eb42170e: Display file sizes larger than 2GB correctly
Merge commit 'eb42170e6c8b70f11dca9965785aa04a80290c72' into gingerbread-plus-aosp

* commit 'eb42170e6c8b70f11dca9965785aa04a80290c72':
  Display file sizes larger than 2GB correctly
2010-06-25 09:50:08 -07:00
Kenny Root
eb42170e6c Display file sizes larger than 2GB correctly
File size was cast to a signed integer which displayed files over 2GB as
negative sizes on devices. Use a long long for printing instead which
matches the stat struct.

Change-Id: I0ec07f33716bb4c2e5d120633ed435f637238f46
2010-06-25 09:08:05 -07:00
Jean-Baptiste Queru
7570ab61d4 am f72961d0: merge from froyo-plus-aosp 2010-06-09 16:28:31 -07:00
Jean-Baptiste Queru
f72961d068 merge from froyo-plus-aosp
Change-Id: I82ec6dbd7c8c3b37b9505eaef351042f2ee53fb5
2010-06-09 16:26:32 -07:00
The Android Open Source Project
7c84efe083 merge from open-source master
Change-Id: I2f725ca20bf08748a4b3e81a4e98fbe08fcf1a47
2010-06-09 07:16:49 -07:00
David 'Digit' Turner
aa2106b008 toolbox-ls: sort file and directory lists
Sorts file and directory names properly in 'ls'
+ accept group flags (e.g. '-ld' instead of '-l -d')
+ accept flags in any position on the command line (e.g. 'ls foo -l' works)

Change-Id: Idc24a69ae31fe0c13726d39892357ac89a8830db
2010-06-04 10:44:56 -07:00
The Android Open Source Project
a92be64809 am 53a79a84: am 49337b27: merge from open-source master 2010-05-19 11:35:48 -07:00
The Android Open Source Project
53a79a841b am 49337b27: merge from open-source master
Merge commit '49337b27d9a90d7c3f703f618e7c6bfaffc2a96d' into kraken

* commit '49337b27d9a90d7c3f703f618e7c6bfaffc2a96d':
  Fix "route add default dev <iface>" behaviour
2010-05-19 11:33:56 -07:00
The Android Open Source Project
49337b27d9 merge from open-source master
Change-Id: I77e33ce567b9682f51785cc574e37dc2cd15028f
2010-05-19 11:28:01 -07:00
Colin Cross
4e7dd3d270 mount: Add support for remounting without specifying device
Change-Id: I48c84fab3ab2a9704ec5b7bf7002b8960fa53c27
2010-05-07 12:09:19 -07:00
Daniel Baeyens
e898faddb3 Fix "route add default dev <iface>" behaviour
Previous behaviour was to set route's network mask as 255.255.255.255
Setting a destination network with netmask /32 blocks the connections
just to the specified host. 0.0.0.0/32 defines the exact IPv4 address
0.0.0.0 and not the whole IPv4 hosts range.
This patch allows traffic to any network, setting a 0.0.0.0/0 route.

Change-Id: I1665f2fac52526337bb2c48e3b09564d9da448e7
2010-04-21 01:51:18 +02:00
Viral Mehta
918fb893e8 fix insmod reading more than one module parameter
it seems wrong to put '/0' after reading one argument
if we are passing more than one module parameters, they are not being propogated
to the kernel properly.

Second module parameters onwards are simply being ignored by kernel
since insmod incorrectly put '/0' after reading first module parameter

Change-Id: I54283eb30a66a83d5c619ffb1fb174ccf5fdcaf7
2010-04-20 09:53:12 +05:30
Jean-Baptiste Queru
1ded19f455 fix build
Change-Id: I93714131dc9d18797009154e6e25dc6e122058c7
2010-04-12 14:15:23 -07:00
The Android Open Source Project
a8415325a8 am 1888de8e: merge from open-source master
Merge commit '1888de8e13f82f7af21bce267254fac124237afe' into kraken

* commit '1888de8e13f82f7af21bce267254fac124237afe':
  toolbox: add "uptime" command
2010-04-12 13:28:12 -07:00
The Android Open Source Project
1888de8e13 merge from open-source master
Change-Id: Ife9c7a92ed7abd59b6b3612ba908bcae77055767
2010-04-12 13:23:51 -07:00
Mike Lockwood
5ffbf26ebf toolbox: add "uptime" command
Prints elapsed real time since boot, as well as idle time and sleep time.

Change-Id: I97f482d6087e9f802d74e91147bf767e6b2d4f42
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-09 16:42:42 -04:00
Mike Lockwood
a699d6256f toolbox: add "uptime" command
Prints elapsed real time since boot, as well as idle time and sleep time.

Change-Id: I97f482d6087e9f802d74e91147bf767e6b2d4f42
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-09 15:30:06 -04:00
Arve Hjønnevåg
b51cb880c0 Merge "toolbox: nandread: Add options to extract raw images, partial images, and fix bad block check." 2010-03-08 14:51:01 -08:00
Arve Hjønnevåg
b6b8793b8b toolbox: nandread: Add options to extract raw images, partial images, and fix bad block check. 2010-03-03 16:48:38 -08:00
San Mehat
661aff600c newfs_msdos: Allow -s option to work by itself
Signed-off-by: San Mehat <san@google.com>
2010-03-03 12:40:21 -08:00
San Mehat
10d469bff9 system: Add support for getting/setting i/o priorities and include a userspace tool
Signed-off-by: San Mehat <san@google.com>
2010-02-25 14:02:55 -08:00
Andrew Stadler
715c889713 Allow numeric uid & gid in chown
This makes it more like the POSIX version which accepts number or name.
2010-02-12 13:46:58 -08:00
Colin Cross
1b1fd61295 Remove definitions that are now in bionic libc 2010-01-14 12:47:12 -08:00
San Mehat
eab453c612 toolbox: newfs_msdos: Exit on write failure, and handle bogus geometry from the kernel
Signed-off-by: San Mehat <san@google.com>
2010-01-10 11:10:21 -08:00
San Mehat
ff3bcd0307 toolbox: newfs_msdos: If geometry is not available, use some sane-ish defaults
Signed-off-by: San Mehat <san@google.com>
2010-01-05 13:49:11 -08:00
San Mehat
0163f77a83 am 6dba735a: am 0d6f587f: am 39274417: toolbox: Add scheduling policy display to top/ps
Merge commit '6dba735a61d4b65594fa0ad7fd15ec09c3c42ce9'

* commit '6dba735a61d4b65594fa0ad7fd15ec09c3c42ce9':
  toolbox: Add scheduling policy display to top/ps
2009-10-28 23:50:56 -07:00
San Mehat
392744175c toolbox: Add scheduling policy display to top/ps
Signed-off-by: San Mehat <san@google.com>
2009-10-27 12:27:47 -07:00
Android (Google) Code Review
b44224d56d Merge change Ic0e6195f
* changes:
  toolbox: Add nandread command
2009-10-08 20:11:36 -04:00
Arve Hjønnevåg
7c953d04bc toolbox: Add nandread command
Extracts a nand image from an mtd partition with page data followed by
64 bytes of extra data.
2009-10-01 17:40:33 -07:00
Andy McFadden
9feee025a0 Fix up ls -s.
Added the "total" line, which makes it easy to answer questions like,
"how the hell much space am I wasting on /data/dalvik-cache?".

Also fixed the -s filename output, which was showing mostly-full paths
when a simple filename was called for.
2009-09-27 15:13:56 -07:00
Andy McFadden
327e696808 Added -s flag to ls.
This may not be useful, and may actually be misleading since yaffs2
doesn't track the blocks used for each file (it just divides the length
down by 512).  I'm submitting it because yaffs2 isn't the only
filesystem we'll ever use.

I also changed some sprintf to snprintf, mostly out of paranoid habit.
2009-08-18 11:10:03 -07:00
San Mehat
c3109591d4 resolved conflicts for merge of 72eead43 to master 2009-07-06 12:19:19 -07:00
San Mehat
72eead43c7 toolbox: mkdosfs: Imported new 'newfs_msdos' updated disk formatter
Signed-off-by: San Mehat <san@google.com>
2009-07-06 11:10:03 -07:00
Dima Zavin
2f0c41ec3c am 383688b5: toolbox: Fix uninitalized stack variable in mount.
Merge commit '383688b52fb19b9c4d98bb1a660febc880d0e268'

* commit '383688b52fb19b9c4d98bb1a660febc880d0e268':
  toolbox: Fix uninitalized stack variable in mount.
2009-07-01 11:18:15 -07:00
Android (Google) Code Review
53e6808c96 am 5e924468: Merge change 5662 into donut
Merge commit '5e924468cd80bfadd686515a5b4193594a2811eb'

* commit '5e924468cd80bfadd686515a5b4193594a2811eb':
  toolbox: Revise route utility.
2009-07-01 00:07:13 -07:00
Dima Zavin
383688b52f toolbox: Fix uninitalized stack variable in mount.
Signed-off-by: Dima Zavin <dima@android.com>
2009-06-29 15:53:22 -07:00
Chia-chi Yeh
4a1465feff toolbox: Revise route utility.
Add copyright header.
Returns errno when something goes wrong. Otherwise returns 0.
When the route entry exists, treat it as a success.
2009-06-30 04:56:35 +08:00
San Mehat
a47c2fdd4a am c83cd879: init: Fix heap corruption for services with arguments
Merge commit 'c83cd879d45e667fbb4763f18c908928ee9d67d8'

* commit 'c83cd879d45e667fbb4763f18c908928ee9d67d8':
  init: Fix heap corruption for services with arguments
  toolbox: ifconfig: Implement mtu setting, plus setting interface addr should
  toolbox: route: Reflow some of the mess, fix route add parameter names to
2009-05-14 15:12:43 -07:00
San Mehat
54a1eb7677 toolbox: ifconfig: Implement mtu setting, plus setting interface addr should
implicitly 'up' the iface just like normal ifconfig does.

Also convert tabs -> spaces
2009-05-14 07:28:52 -07:00
San Mehat
83ec181dc7 toolbox: route: Reflow some of the mess, fix route add parameter names to
match standard route

Signed-off-by: San Mehat <san@google.com>
2009-05-14 07:28:45 -07:00
San Mehat
e00d31aeb1 am 0389a12: toolbox: Make that \'pointopoint\' instead of \'pointtopoint\'
Merge commit '0389a1297d65321a882ea0dcc69f4de4e3bcb169'

* commit '0389a1297d65321a882ea0dcc69f4de4e3bcb169':
  toolbox: Make that 'pointopoint' instead of 'pointtopoint'
2009-05-13 12:52:53 -07:00
San Mehat
4676aacd5e am fa49e28: toolbox: Add \'pointopoint\' support to ifconfig
Merge commit 'fa49e2860bebe6bb2a26194c58992e5d5aed0b0d'

* commit 'fa49e2860bebe6bb2a26194c58992e5d5aed0b0d':
  toolbox: Add 'pointopoint' support to ifconfig
2009-05-13 12:52:53 -07:00
San Mehat
0389a1297d toolbox: Make that 'pointopoint' instead of 'pointtopoint'
Signed-off-by: San Mehat <san@google.com>
2009-05-13 12:01:52 -07:00
San Mehat
fa49e2860b toolbox: Add 'pointopoint' support to ifconfig
Signed-off-by: San Mehat <san@google.com>
2009-05-13 10:05:06 -07:00
Jean-Baptiste Queru
f6c95712c4 Merge donut into master 2009-04-22 17:12:44 -07:00
Chung-yih Wang
41e3a2c5e8 Merge branch 'readonly-p4-master' 2009-04-18 16:17:34 -07:00
Chung-yih Wang
f309f77adc AI 146558: am: CL 146260 Add the net-based routing entries.
e.g. route add net 172.16.0.0 mask 255.240.0.0 gw 172.19.248.10
  Original author: cywang

Automated import of CL 146558
2009-04-18 16:16:21 -07:00
Chung-yih Wang
8b0fb371c1 Merge branch 'readonly-p4-donut' into donut 2009-04-14 18:46:50 -07:00
Chung-yih Wang
98c297f244 AI 146260: Add the net-based routing entries.
e.g. route add net 172.16.0.0 mask 255.240.0.0 gw 172.19.248.10

Automated import of CL 146260
2009-04-14 18:45:32 -07:00
Andy McFadden
33d50dc785 Merge branch 'readonly-p4-master' 2009-04-08 19:26:45 -07:00
Andy McFadden
b33d3415b6 AI 145220: Added "-d" flag to ls.
Now you can "ls -l -d <directory>" to see directory perms.

Automated import of CL 145220
2009-04-08 19:25:35 -07:00
Dianne Hackborn
477b430700 Improvements to get events: -p, better output.
Add new -p option to easily get the output showing which events are reported by the devices.

Improve the reported events output a bit by including a name for each event type.

Extend help text to include a description of each options, so I don't have to look in the source code next time. :)
2009-04-08 15:43:31 -07:00
The Android Open Source Project
455a6dffd4 Merge branch 'open_source' into google_internal 2009-03-29 08:55:26 -07:00
Doug Kwan
e49f9c9238 Automated import from //branches/master/...@142981,142981 2009-03-26 14:14:15 -07:00
Jean-Baptiste Queru
83b65486be Merge commit 'remotes/korg/cupcake' into merge
Conflicts:
	init/devices.c
	libpixelflinger/Android.mk
2009-03-18 09:29:29 -07:00
The Android Open Source Project
dd7bc3319d auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
The Android Open Source Project
e54eebbf1a auto import from //depot/cupcake/@135843 2009-03-03 18:29:04 -08:00
The Android Open Source Project
a1e1c1b106 auto import from //depot/cupcake/@132589 2009-03-03 14:04:41 -08:00
The Android Open Source Project
c2d26a164f auto import from //depot/cupcake/@137055 2009-03-02 22:54:47 -08:00
The Android Open Source Project
261ed7551e auto import from //branches/cupcake/...@132276 2009-02-19 10:57:36 -08:00
The Android Open Source Project
13f797da7f auto import from //branches/cupcake/...@130745 2009-02-10 15:44:07 -08:00
Jean-Baptiste Queru
77d0c65b95 Merge commit 'remotes/korg/cupcake'
Conflicts:
	init/devices.c
	logwrapper/logwrapper.c
	mountd/AutoMount.c
2008-12-19 08:15:15 -08:00
The Android Open Source Project
35237d1358 Code drop from //branches/cupcake/...@124589 2008-12-17 18:08:08 -08:00
Jay Freeman (saurik)
bc7b0cbe15 Open file and loop device with O_RDONLY when -o loop,ro.
Otherwise: ioctl LOOP_SET_FD failed: Bad file number.
2008-11-16 13:28:23 +00:00
The Android Open Source Project
4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00