Commit graph

601 commits

Author SHA1 Message Date
Kelvin Zhang
ffdb017e7d Load modules from _16K dir when running on 16K kernel
Test: th
Bug: 293313353
Change-Id: Ie58e57174545e4def5ebc33ac29f1adb12bf06a6
2024-04-25 09:48:13 -07:00
sanga1.lee
2c6b83f4d2 setprop: check if not setprop value but setprop name starts with "ro."
When setting property with setprop, a property name which starts with
"ro." could be set no matter how long the value name is.

Change-Id: Ia035ef009952db08ae8a6d4a2b8b9567d86124fc
2024-04-22 08:07:52 +00:00
Harry Cutts
08686936b5 getevent: print error message when failing to get event
For some reason we weren't saying what the error was here, which could
be useful. Also change the failure message slightly to distinguish
between failing to get inotify and evdev events.

Bug: 245989146
Test: m toolbox
Change-Id: I456aa53d008043ea2549024002f9b88ea8d2d2cf
2024-04-04 15:14:26 +00:00
Harry Cutts
b8f9475fd7 getevent: add Framework Input team as owners
Bug: 245989146
Test: Treehugger
Change-Id: I286c6947e59013afe816b949b51f081bbfe5924e
2024-04-04 15:14:26 +00:00
Junki Min
c8dc7ffd5e toolbox/libmodprobe: add toolbox to vendor_ramdisk
toolbox and libmodprobe are required for module loading before
first stage init begin.

BUG: 329807942
Signed-off-by: Junki Min <joonki.min@samsung.com>
Change-Id: Icf04888e602b012758ebf353ed8e4aff2585fd07
2024-03-18 17:35:26 +09:00
Will McVicker
7d400f9d8c toolbox/modprobe: Use libmodprobe to load modules from FILE
When a file is provided (via --all=FILE), let's use libmodprobe to load
the modules. This let's us use the logic in libmodprobe to parse the
provided modules load file -- FILE. The functional differences include:

 - Removes the FILE parsing logic in modprobe.
 - Returns early if FILE doesn't exist.
 - Adds Dirname(FILE) to mod_dirs which means libmodprobe will parse the
   modules.* files inside Dirname(FILE). Previously, modprobe would only
   parse the modules.* files in the mod_dirs passed in by `-d DIR`. If
   no directories were provided, we would fallback to the default
   /lib/modules path. This patch removes the mod_dirs.empty() fallback
   path when --all=FILE is used. It's unlikely anyone uses `--all=FILE`
   without `-d DIR` unless FILE is inside the fallback path --
   /lib/modules.

Test: verified lsmod on pixel 6
Bug: 324018983
Change-Id: I8d241832f2a1f18d14207e3e3777e015c1ddb25f
2024-03-15 14:58:31 -07:00
Will McVicker
b9dead1a75 toolbox/modprobe: Fix failure due to blocklist
When a module is blocklisted, LoadWithAliases() will return an error
indicating the module failed to load. When the blocklist is requested
(via the -b parameter), let's not return an error if a blocklisted
module fails to load.

Test: verified lsmod on pixel 6
Bug: 324018983
Change-Id: I68f7d46bf9fd99e4b4e51ef92ea71686907f1125
2024-03-07 15:01:59 -08:00
Elliott Hughes
a8e259db66 Remove stray newline from err() call.
err() does this itself, and includes strerror() too.

Test: treehugger
Change-Id: I0e844f9cc3992e80a302b2f3ca1084b165582a9b
2023-09-07 19:30:31 +00:00
Will McVicker
d278f1d018 toolbox/modprobe: Fix fallback path when mod_dirs is empty
Due to GKI, the kernel UTS release string will not always (if ever)
match the vendor's UTS release string that is used to create the
initramfs file structure -- /lib/modules/<vendor uname>. This causes
module load failures when `-d DIR` is omitted. To fix this, we can
include all of the versions under /lib/modules that match the kernel's
major and minor version instead of directly using the value of uname().
In addition, we can also support modules being loaded directly from
/lib/modules.

Test: verify GKI kernel + initramfs with different UTS strings
Test: verify GKI kernel + initramfs with modules directly in /lib/modules
Fixes: 8320778425 ("toolbox/modprobe: Fallback to /lib/modules/<uname> ")
Bug: 282917063
Bug: 254835242
Change-Id: I5368f5cff139ba3165323a6a91066be38bfa0736
2023-05-26 11:01:00 -07:00
Vincent Donnefort
8320778425 toolbox/modprobe: Fallback to /lib/modules/<uname>
Make the module directory optional by reading the kernel release
version. This path is where the kernel installs modules by default.
Similar behaviour can be found in several modprobe implementations.

Bug: 254835242
Change-Id: I61707636705e5b4d9bd8ccf6351e7057eae6bcf5
2023-01-27 12:58:50 +00:00
Elliott Hughes
278bfa06e9 toolbox/generate-input.h-labels.py: python3.
Test: treehugger
Change-Id: Ia63fd0db0b678de05ab2a83411f7a04d81e401e9
2021-08-17 14:34:55 -07:00
Will McVicker
ff825b29b1 Update owners for modprobe.c
Test: treehugger
Change-Id: I5989f49c284b4f06a24b6350a531902832e2eef5
2021-04-01 12:42:21 -07:00
Will McVicker
87b2ef0edf libmodprobe: refactor blocklist functionality
Remove the function EnableBlocklist() and add a constructor argument to
enable/disable the use of modules.blocklist. In all cases, the
enabling/disabling of the blocklist happens immediately after creating
the Modprobe object. So this simplies libmodprobe.

Additionally, the use of the blocklist by libmodprobe should be enabled
by default unless explicitly disabled during creation of the Modprobe
object. Currently, only modprobe(8) defaults to not using the blocklist
and includes the argument -b BLOCKLIST for enabling it. That
functionality remains.

This refactor allows us to use the blocklist during first stage init.
However, additional logic is needed to not return an error for the
blocked non-aliased modules during first stage init; otherwise, the
error would result in an init crash leading to a device reboot. So fixup
LoadListedModules() to allow blocking modules without returning an
error.

Bug: 182582036
Test: boot test on pixel 5 with a module in modules.blocklist
Change-Id: I394b5aa98fa98821011982cfe693749010c381f7
2021-03-31 09:34:47 -07:00
Bob Badour
d69ad69a93 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id740a7d2884556081fdb68876584b25eb95e1bef
2021-02-19 12:59:05 -08:00
Elliott Hughes
c3a206ccda Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"
This reverts commit 187b7d1950.

Reason for revert: system/core is multiple projects, not one.

Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16 20:01:20 +00:00
Bob Badour
187b7d1950 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  Android.bp
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2021-02-16 04:10:03 -08:00
Elliott Hughes
9bfd986422 Remove all the cpp_std: "experimental"s.
None of them are necessary, and it's more intention-revealing to say
`c++2a` or whatever anyway.

Test: treehugger
Change-Id: Ie1df26499d160d6fc757d17fcb0121997bda14f9
2021-02-04 09:05:01 -08:00
yawanng
762653bdac iorap: Remove toggling iorapd on/off when using 'start' command.
Bug: 173166524
Test: adb shell stop
Test: adb shell start
Change-Id: I09722380f249405aeeb8a68287828d602313baa2
2020-11-16 18:45:47 +00:00
Treehugger Robot
f765947c47 Merge "toolbox: make all janitors the owners." am: 5f33339b2f am: 459b5d6350
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1351802

Change-Id: Iaae36f98c07c3b1aed137d5b0763d92e4c03f9fd
2020-07-13 18:10:13 +00:00
Treehugger Robot
5f33339b2f Merge "toolbox: make all janitors the owners." 2020-07-13 17:31:11 +00:00
Treehugger Robot
b0680f4a96 Merge "modprobe: add -s/--syslog flag" am: 14260d2314 am: ef4a78efbb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1348924

Change-Id: If2f8a0975c46c321bc2ea84de5b3e29fa8462cea
2020-06-26 22:58:37 +00:00
Elliott Hughes
e81b00218a toolbox: make all janitors the owners.
There shouldn't be much activity in here, but getprop/setprop and
modprobe probably aren't going anywhere...

Test: treehugger
Change-Id: If5726dcb62a47549e10767c7a984614bcff8ea1f
2020-06-26 15:46:48 -07:00
Mark Salyzyn
63368beaba modprobe: add -s/--syslog flag
There is a desire to ensure that modprobe as a service can log to
kmesg to help triage issues, so add support for the -s or --syslog
flag to do so.

SideEffects:
- help goes to stdout instead of stderr.
- verbose flag once, sets DEBUG, twice, sets VERBOSE minimum.
- quiet flag sets WARNING minimum.

Bug: 159424228
Bug: 151950334
Test: use modprobe as a service to load modules, check logs
Change-Id: I884995f364b0fc604861797eb90d7225a372f864
2020-06-26 10:31:07 -07:00
Mark Salyzyn
28b6ea20ec Merge "modprobe: add --all=modules.load flag" am: 3d246cced8 am: f1ae0e66e3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1346626

Change-Id: Ife797bebbdaf80f6d3aa71bd9d3d5f9033428573
2020-06-26 12:11:12 +00:00
Treehugger Robot
e7a17a6915 Merge "modprobe: switch to getopt_long for argument parsing" am: d894b463f1 am: f946ba79cf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1348923

Change-Id: Ic4a81b57517064b7c2c6da73c402266dde3c2b2a
2020-06-25 18:07:26 +00:00
Mark Salyzyn
6c9a1e4d49 modprobe: add --all=modules.load flag
Add a means to specify the modules to load from a file, rather than
on the argument list by adding an optional argument to the --all flag.
This allows modprobe to be designated as a standalone service to load
a long series of modules in the background and be specified
separately.  The specified (module.load) file contains a newline
separate list of module names, and supports line comments using '#'
since this file may be maintained by a human or scripting that
requires tagging for regions of the file.

Bug: 159424228
Bug: 151950334
Test: use modprobe as a service to load modules
Change-Id: Id32641c7244e65848fca3a4a82c8d08b2042bf2f
2020-06-24 18:10:12 -07:00
Mark Salyzyn
3ad274be15 modprobe: switch to getopt_long for argument parsing
Add support for long options, and fit existing options to upstream
behaviors and extensions.  Fix some missing std::endl and
android::base::Join() usage.

Bug: 159424228
Bug: 151950334
Test: manually test long options work
Change-Id: Id792d87d4407628e706aeccecb6e2bce22bcad10
2020-06-24 18:10:12 -07:00
Treehugger Robot
1351fcce68 Merge changes I14ed0839,I59f9fde5 am: 4db1b12b3c am: 24d0e12b3e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1339607

Change-Id: I683998901098e58371f89ab5a71df89e57af67dc
2020-06-16 19:14:16 +00:00
Mark Salyzyn
703fb74fb5 modprobe: Use more inclusive language for modprobe and libmodprobe
blacklist is replaced with blocklist.

Test: none
Change-Id: I59f9fde5900b9aee82aca1eab4a6ded3d136063b
2020-06-15 12:51:38 -07:00
Ytai Ben-Tsvi
7d6af00aca Control audio HAL services in start/stop
Some system services (e.g. SoundTriggerMiddleware) assume that
whenever they start, the audio HAL is in its default (reset) state.
init.rc scripts tie the lifetimes of the audio HAL and system
processes, but when using stop/start this is not the case, and this
may cause spurious crashes in this case.

stop/start is apparently being relied on in some test infrastructure,
so this change is needed to avoid causing problems for those systems
or false detection of problems, which are not actually present in
production.

Bug: 154029444
Test: Manually verify that the audio HAL is stopped on
      'adb shell stop', restarted on 'adb shell start' and that the
      system boots correctly after.
Change-Id: I39878b978b47a169c4fe446c43d7347809d15e06
Merged-In: I39878b978b47a169c4fe446c43d7347809d15e06
2020-04-23 12:01:46 -07:00
Ytai Ben-Tsvi
6025b731e6 Control audio HAL services in start/stop
Some system services (e.g. SoundTriggerMiddleware) assume that
whenever they start, the audio HAL is in its default (reset) state.
init.rc scripts tie the lifetimes of the audio HAL and system
processes, but when using stop/start this is not the case, and this
may cause spurious crashes in this case.

stop/start is apparently being relied on in some test infrastructure,
so this change is needed to avoid causing problems for those systems
or false detection of problems, which are not actually present in
production.

Bug: 154029444
Test: Manually verify that the audio HAL is stopped on
      'adb shell stop', restarted on 'adb shell start' and that the
      system boots correctly after.
Change-Id: I39878b978b47a169c4fe446c43d7347809d15e06
2020-04-23 10:42:55 -07:00
Igor Murashkin
2680b3158e start: Toggle iorapd on/off when using 'start' command (by itself)
iorapd depends on pm in system_server, so turn it off too when we
turn off system_server with the 'stop' command.

Bug: 153964298
Test: adb shell stop
Test: adb shell start
Change-Id: I08390472b1e1b969d0380843efa1bbd35b194250
2020-04-16 14:24:45 -07:00
Steve Muckle
64a553451a toolbox: add modprobe
Add an implementation of modprobe based on libmodprobe.

Change-Id: I85ba440766406fe6ca7e90bec204d06632785a66
2019-08-06 13:58:13 -07:00
Elliott Hughes
63b07755c7 toolbox: drop NetBSD grep for toybox grep.
Test: toybox grep tests
Change-Id: Ifb99980cc4d0a4d843a82671b2e2eaad67829e5c
2019-07-08 14:29:12 -07:00
Tom Cherry
65a1ee83a8 toolbox: add setprop, start, and stop
Move these from toybox as they're Android specific and more easily
maintained here.

A few changes during the conversion:
* Report error in setprop if value is not a UTF8 string; this would
  previously fail only after attempting to set the property
* Inform users to check dmesg for further failure messages for all
  three programs
* Only start/stop zygote_secondary if the device is not single arch

Bug: 117321744
Bug: 133901248
Test: setprop works, start and stop work on single and multi-arch.

Change-Id: Id2194cf2b65221bde38aff91f0e86b33edb37f42
2019-06-06 11:20:29 -07:00
Elliott Hughes
0865266048 Remove r in R.
Obsoleted by toybox `devmem` instead.

Test: builds
Change-Id: I35c1ed2cfa9b3073cab405cfaf3c989fb2a72aa2
2019-04-04 10:45:12 -07:00
Elliott Hughes
bfd9d63c74 grep: fix ASan heap-buffer-overflow.
Like the regular fgetln(), grep_fgetln() doesn't NUL-terminate the
string, which regexec() doesn't like. ASan just gained the ability to
intercept regexec(), which is why we didn't find this previously.

Bug: http://b/129089665
Test: adb shell grep -R /system -e "abc"
Test: toybox grep tests
Change-Id: Id707cea66a873b83bd763a3dcdf726ac7d062ce0
2019-04-01 10:58:38 -07:00
Elliott Hughes
720c1ecc90 BSD grep: sync with upstream.
No significant changes, but this does get rid of our local modifications.

Bug: http://b/129089665
Test: builds
Change-Id: Ie6e3cc2198c302fc998fe6fcf027661e5dca88f0
2019-03-28 14:29:00 -07:00
Petri Gynther
7c71e06f8e toolbox: make "r" available for /vendor
Make "r" package available for /vendor, so that we can easily add:

PRODUCT_PACKAGES_DEBUG += r.vendor

in device/google/<device>/device.mk

Change-Id: I46c23a85c95444083b8e4b68961c541d9af9b216
2019-03-01 17:51:56 -08:00
Gary Bisson
8cbf6bb535 toolbox: getevent: disable stdout buffering
So that the getevent output can be redirected and still be responsive
when events occur.

A good example is when using 'adb shell getevent' command, this latter
would only display the events when the buffer is full. With this patch
as soon as an event is received/printed, it is flushed to stdout.

Change-Id: I77eee96ed1aa59bf8d82f17eab666976ce966def
Signed-off-by: Gary Bisson <gbisson@essential.com>
2019-01-15 16:42:59 +01:00
Nick Kralevich
38e9f2320a getevent: O_RDWR -> O_RDONLY | O_CLOEXEC
No need to open the device read write. Just open it read-only.

This is a partial redo of
https://android-review.googlesource.com/c/platform/system/core/+/334583
which was reverted in
https://android-review.googlesource.com/c/platform/system/core/+/342483

Bug: 30861057
Test: ran getevent, saw correct output, played with device
Change-Id: I426efd68f39dcd97d3ee23c13ed1a9ed96cb4c2e
2018-08-24 12:16:17 -07:00
Elliott Hughes
8100d05778 Move back to BSD grep, and make it available for recovery too.
Bug: http://b/111849261
Bug: https://bugs.exim.org/show_bug.cgi?id=2294
Test: manual
Change-Id: Ia4f67b9f803c4f039d170f6d015a1bd2bb0ef23d
2018-08-01 10:35:46 -07:00
Elliott Hughes
f9408d5cdf Revert "Switch to PCRE grep."
This reverts commit 90a018a87a.

Not a clean revert because things have changed slightly, and I'm sticking
with the egrep/fgrep shell scripts for now.

Bug: http://b/111849261
Bug: https://bugs.exim.org/show_bug.cgi?id=2294
Test: manual
Change-Id: I72ae637c84f0eb1c2b5291db73ebff1628d54110
2018-07-26 14:52:45 -07:00
Treehugger Robot
c50fe3dc54 Merge "newfs_msdos: switch to external/newfs_msdos." 2018-06-20 19:06:59 +00:00
Elliott Hughes
76858a06d0 newfs_msdos: switch to external/newfs_msdos.
Bug: http://b/29899852
Test: builds
Change-Id: Iecd80d0c64cb5eec4c76ba4bce775508ee45df49
2018-06-13 13:21:24 -07:00
Jiyong Park
011ee12b1d Shared libs are supported in recovery mode
adbd has been built as a static executable since the same binary was
copied to the recovery partition where shared library is not supported.
However, since we now support shared library in the recovery partition,
adbd is built as a dynamic executable.

In addition, the dependency from adbd to libdebuggerd_handler is removed
as debuggerd is handled by the dynamic linker.

A few more modules in /system/core are marked as recovery_available:
true as they are transitive dependencies of the dynamic linker.

This change also includes ld.config.recovery.txt which is the linker
config file for the recovery mode. It is installed to /etc/ld.config.txt
and contains linker namespace config for the dynamic binaries under
/sbin.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: Select 'mount /system' in the recovery mode, then `adb shell`.
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.

Change-Id: I363d5a787863f1677ee40afb5d5841321ddaae77
2018-06-10 08:32:24 +09:00
Dan Willemsen
a228822c7d Compile toolbox's newfs_msdos for the host
For potential use with build/make/tools/fat16copy.py

Bug: 63035155
Test: mmma system/core/toolbox; newfs_msdos
Change-Id: I8ad50b8c181fc4ec21e191ec9fea8e9aa11d2d9b
2018-05-02 13:14:51 -07:00
Elliott Hughes
90a018a87a Switch to PCRE grep.
Bug: http://b/77150016
Test: boots, manual testing
Change-Id: I377ca42ed9783edcceab4daabe43e993ef74e837
2018-04-23 17:00:54 -07:00
Elliott Hughes
21ceafbaac Remove BSD dd.
Bug: N/A
Test: builds
Change-Id: Id80364241434abfc216149b4ce7440cef700abef
2018-04-20 17:55:44 -07:00
Elliott Hughes
8591440fe2 Lose dd to toybox.
Just the symlink for now. If this sticks, I'll come back to remove the code.

Bug: N/A
Test: `toolbox dd --help`
Change-Id: I9b967e9246f42db0d1f48d9d147c538d57fb3bc8
2018-04-20 13:34:20 -07:00