Commit graph

6799 commits

Author SHA1 Message Date
Yifan Hong
d81b8e3d77 roots.cpp: convert to C++ Fstab
Convert code to use C++ Fstab struct and C++ std::strings.

Bug: 62292478
Bug: 118634720
Test: boots
Change-Id: Ibdc1df5831bc885d7c1574419f41af026e49a137
2018-12-18 15:57:29 -08:00
Yifan Hong
0f339e27bb Move parts of roots.cpp to libfs_mgr
Move some mounting functionalities to libfs_mgr.

Test: run recovery tests

Bug: 118634720
Bug: 113182233

Change-Id: Ie59376664a744992429f0262ec96d13a1aed30f9
2018-12-18 15:57:29 -08:00
Treehugger Robot
8fc15c02bd Merge "C++17 is the default now." 2018-12-03 20:42:40 +00:00
Elliott Hughes
31b92a5d75 C++17 is the default now.
Test: builds
Change-Id: I91923da25f470621189589711c50f3d67e435c68
2018-12-03 09:27:17 -08:00
Treehugger Robot
a37aa092c7 Merge "Fix ensure_path_mounted_at for fsck_unshare_blocks" 2018-12-01 06:00:32 +00:00
Tianjie Xu
7846823125 Merge "ImageGenerator: ignore the duplicate locales" 2018-12-01 03:56:10 +00:00
Yifan Hong
d7b6858045 Fix ensure_path_mounted_at for fsck_unshare_blocks
Test: pass
Bug: 118634720
Change-Id: Icb2540892bd35659462f56c3883a39759f29eeab
2018-11-30 15:22:19 -08:00
Yifan Hong
cbfeb7f6af Merge "SYSTEM_ROOT -> get_system_root" 2018-11-30 22:07:24 +00:00
Tom Cherry
1f66578d6f Merge "Update for long long -> off64_t for fstab.length" 2018-11-30 16:33:54 +00:00
Tom Cherry
45e505a4e9 Update for long long -> off64_t for fstab.length
Test: boot
Change-Id: I755a5dd48f1d5be2cbd8e494b9c405674b12cebb
2018-11-29 13:33:07 -08:00
xunchang
a48f00a5e8 ImageGenerator: ignore the duplicate locales
Some language variants have the duplicated translations. Therefore,
we can compare the translated string for each locale to the default
text string for that language. And the duplicated ones will be skipped
to save some space.

Bug: 74397117
Test: generate and check the image
Change-Id: If51fa8fe700350c06f084f0e74d3698b82d6f177
2018-11-29 12:13:02 -08:00
Tianjie Xu
697003dbce Merge "ImageGenerator: Handle special characters in xml files" 2018-11-29 18:28:44 +00:00
xunchang
1eeee45a7d ImageGenerator: Handle special characters in xml files
In specific, the apostrophe appears as "\'"; and a new line appears as
"\n\n". We need to handle these two cases accordingly.

Bug: 74397117
Test: generate and check the image
Change-Id: I67b1ebce7494e4a685a0c7334da58dc6df2ccb29
2018-11-29 18:28:13 +00:00
Tianjie Xu
86936c46a8 Merge "ImageGenerator: switch to BreakIterator from icu library" 2018-11-28 18:27:58 +00:00
Jaegeuk Kim
4cd38430d7 Merge "make_f2fs: use -g android by default" 2018-11-28 00:57:25 +00:00
Treehugger Robot
c075d688fd Merge "Update README.md." 2018-11-28 00:50:44 +00:00
Yifan Hong
4932780606 SYSTEM_ROOT -> get_system_root
Add a get_system_root() function in roots.cpp
which returns / or /system based on fstab.
This factors out the 'if' check from recovery.cpp
and fsck_unshare_blocks.cpp.

Test: boot recovery, mount system
Bug: 118634720
Change-Id: If4947cba3a3f08dbe695fd2b50a9354cd302ee03
2018-11-27 15:57:47 -08:00
Tao Bao
a54b883607 Merge "minui: GRSurface::Create() computes data_size on its own." 2018-11-27 23:21:50 +00:00
xunchang
acacc9d30f ImageGenerator: switch to BreakIterator from icu library
The icu library takes care of the line boundary, so that we don't need
to worry about if the given language is logogram.

Bug: 74397117
Test: Generate and check the image
Change-Id: I1447f51b178c0fca83c5497d2f5b8e4009ca7f64
2018-11-27 15:11:04 -08:00
Tao Bao
2abb9fdc54 Update README.md.
The `ResourceTest` mentioned in the doc has been moved into
recovery_component_test in commit
6b28f05c5b.

Since Q, `/sbin/adbd` has been relocated to `/system/bin/adbd`. And `adb
shell` no longer requires mounting /system first, because
`/system/bin/sh` has been included in recovery image.

Test: N/A
Change-Id: I72029a6c8bfaac7a17c0a526a3c511de19356baa
2018-11-27 13:47:13 -08:00
Tao Bao
dd78982d58 minui: GRSurface::Create() computes data_size on its own.
GRSurface::Create() doesn't need to rely on caller specifying the buffer
size, as it can compute that info based on the given args.

This CL also uses `size_t` for all the parameters in
GRSurface::Create().

Test: Run recovery_unit_test on marlin.
Test: Build and boot into blueline recovery. `Run graphics test`.
Test: Build and boot into blueline charger mode.
Change-Id: Idec9381079196abf13553a475006fefcfca10950
2018-11-26 22:46:19 -08:00
Tao Bao
ea4ec3149b Merge "minui: Fix a wrong arg in calling GRSurface::Create()." 2018-11-27 04:52:56 +00:00
Tao Bao
2201d08f8d minui: Fix a wrong arg in calling GRSurface::Create().
This is a bug introduced while refactoring init_display_surface(), in
[1]. As a result, user of res_create_multi_display_surface(), which is
effectively `charger` right now, crashes due to buffer overrun.

This CL fixes the wrong arg and adds a sanity test for
res_create_multi_display_surface(). The testdata (battery_scale.png) is
copied from system/core/healthd/images/battery_scale.png.

[1] commit 44820ac1e3.

Bug: 119122296
Test: Run recovery_unit_test on marlin.
Test: Build and boot into charger mode on blueline. Verify that
      `charger` no longer crashes.
Change-Id: Ib6d083e1512a9c3c6eb63874d26d22658921d693
2018-11-26 17:06:53 -08:00
Tianjie Xu
fb8a636a2d Merge changes I7b7cee68,I07d22c0d
* changes:
  ImageGenerator: add an option to specify the supported locales
  Handle rendering problem for the word "Android" and punctuations
2018-11-26 22:03:29 +00:00
Tianjie Xu
7b636b64a1 ImageGenerator: add an option to specify the supported locales
A smaller list of locales helps to reduce the size of the generated
images; and mitigate the additional space requirement on the tight boot
image for some devices. The caller of the program will be responsible
for providing the locale list.

Also add a verbose option and switch to logger.

Bug: 74397117
Test: generate and check the image
Change-Id: I7b7cee681ccdc6e13fdd0575cf02f8add2ad9a2d
2018-11-26 10:44:24 -08:00
Tianjie Xu
542c617883 Handle rendering problem for the word "Android" and punctuations
The word "Android" is not translated. As a result, some locales fail to
render this word and some punctuations, leading to holes in the middle
of the text. In these cases, we will need to fall back to the default font
and re-measure the text width.

For now, we haven't handled the mix of latin and logogram languages; and
we can blacklist the problematic ones first.

Bug: 74397117
Test: generate and inspect the image
Change-Id: I07d22c0dae2e31eb74f2954e354cd39a42c22f14
2018-11-26 10:44:24 -08:00
Jaegeuk Kim
d65cde7c5a Merge "uncrypt: write permission for f2fs_pin_file" 2018-11-22 09:34:33 +00:00
Jaegeuk Kim
91e631d4dd make_f2fs: use -g android by default
Bug: 119875846
Change-Id: Ibff18ea6f92620852222fff4073379ec8afd0e10
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-11-21 12:53:09 -08:00
Jaegeuk Kim
051b9d87e2 uncrypt: write permission for f2fs_pin_file
We need a write permission to set a flag in the file.

Change-Id: I4896ecbe0fc04374e01d006b1c8acdb932e5d16d
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-11-21 12:52:29 -08:00
Tianjie Xu
14d5540426 Merge "Delete the dumpkey host tool" 2018-11-21 01:45:39 +00:00
Tianjie Xu
d01f664cae Merge "Import translations. DO NOT MERGE" 2018-11-21 01:45:22 +00:00
Treehugger Robot
b22bd959e5 Merge "logical -> dynamic partitions." 2018-11-16 23:35:28 +00:00
Yifan Hong
d17174c3e5 logical -> dynamic partitions.
Reflect a name change.
Test: boots
Test: boot into recovery
Bug: 119286600

Change-Id: I7c323f27574ce033b8fc1750aab00f7300c5cc84
2018-11-16 12:56:44 -08:00
Bill Yi
967d4ac73c Import translations. DO NOT MERGE
Change-Id: I1bd6d7f12c7bfffb7e022f09347a5be5a96766a3
Auto-generated-cl: translation import
2018-11-15 16:16:39 -08:00
Treehugger Robot
814c306106 Merge "switch to using android-base/file.h instead of android-base/test_utils.h" 2018-11-15 15:59:45 +00:00
Josh Gao
b67811dd49 Merge "minadbd: track adb C++ version change." 2018-11-15 08:48:11 +00:00
Tianjie Xu
4ef9cb27eb Merge "Adjust the background text image width to reduce its size" 2018-11-15 05:47:54 +00:00
Tianjie Xu
b8564e1093 Adjust the background text image width to reduce its size
We can adjust the image width with respect to the maximum width of the
wrapped text. This will remove some black margins and reduce the final
size of the images, especially for those with short strings, e.g.
"recovery_error".

Also, add an option to centrally align the text; and fix a boundary
check in the recovery resource test.

Bug: 74397117
Test: Generate and check the image
Change-Id: Ib6cf61a9c99c4aeede16751dc0adfa23ce3f5424
2018-11-15 00:33:14 +00:00
Mark Salyzyn
8b54bc5e04 switch to using android-base/file.h instead of android-base/test_utils.h
Test: compile
Bug: 119313545
Change-Id: I664fb32522d01909c603d7b903475c4e9aea9223
2018-11-14 15:49:19 -08:00
Treehugger Robot
87e2fc3831 Merge "Use the non-LTO/PGO hwbinder in recovery_component_test" 2018-11-14 23:33:44 +00:00
Pirama Arumuga Nainar
b3339ddc6b Use the non-LTO/PGO hwbinder in recovery_component_test
Bug: http://b/119560349
Bug: http://b/112277682

Currently, any binary links in a PGO-enabled static library also needs
to opt into PGO.  With b/119560349, this should be done automatically by
the build system.  Until then, use the non-PGO version of libhwbinder in
recovery_component_test.

Test: m ANDROID_PGO_INSTRUMENT=all
Change-Id: Ic6e44c1cb6d6f13e60e11a46fd7e5ef54238942b
2018-11-14 11:42:23 -08:00
Tianjie Xu
860c82a66b Merge "image generator: format the java file" 2018-11-14 19:10:38 +00:00
Josh Gao
9828dc14cb minadbd: track adb C++ version change.
adb is going to start using shiny new C++17 features like
std::optional in headers that minadbd includes.

Test: mma
Change-Id: I7eb100c48abbf2364d6ff5f30aa223480e2466a6
2018-11-13 14:19:04 -08:00
Tianjie Xu
b97f7e5343 image generator: format the java file
Format the file with google-java-format --aosp. This makes the presubmit
hook happy.

Bug: 74397117
Test: mma
Change-Id: Ie342ed11449414b63f2d1ae781023e940b136bcb
2018-11-13 20:29:16 +00:00
Treehugger Robot
02a945556e Merge "Check and dump the signal info for killed updater." 2018-11-08 22:57:47 +00:00
Tao Bao
481613b35f Merge "minui: GRSurface manages data with std::unique_ptr." 2018-11-08 17:31:40 +00:00
Tao Bao
e7b775ca2c Check and dump the signal info for killed updater.
WEXITSTATUS only gives meaningful value if WIFEXITED is true. So we may
see a slightly confusing message of "E:Error in /path/to/package (Status
0)" for a killed updater process (e.g. updater calling abort(3)). This
CL dumps the signal number for such a case.

Test: abort() in child process. Check the output.
Change-Id: I72e6654a6499d65155085de658062efb9f1e36ac
2018-11-07 15:25:30 -08:00
Tao Bao
9cf163e673 minui: GRSurface manages data with std::unique_ptr.
Test: Run recovery_unit_test on marlin.
Test: `Run graphics test` on taimen.
Change-Id: I34bd862049900b0030f2840a92a7fa3e02fa2c10
2018-11-07 14:36:45 -08:00
Tao Bao
67b7e64034 Merge changes If24c6b7c,I381b0103
* changes:
  image_generator: Fix the warnings on import order.
  Add tools/ to the style-checking path.
2018-11-06 22:04:50 +00:00
Tao Bao
529bb742b7 image_generator: Fix the warnings on import order.
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:36: Wrong order for java.util.StringTokenizer import. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports. https://source.android.com/setup/code-style#order-import-statementsERRORS:
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:43: Wrong order for org.apache.commons.cli.CommandLine import. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports. https://source.android.com/setup/code-style#order-import-statementsERRORS:
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:50: Extra separation in import group before 'org.w3c.dom.Document'

Test: `mmma -j bootable/recovery`
Test: `repo upload` no longer gives warnings.
Change-Id: If24c6b7ca33b9223b3e326a48885c24c35b5fa68
2018-11-06 11:34:31 -08:00