diff options
author | Android Partner Docs <noreply@android.com> | 2017-06-13 21:26:42 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-06-13 21:26:42 +0000 |
commit | b8087179e42959b1efeb64a81110d6d0aa2b798f (patch) | |
tree | b0254fc055b6adcae6a60704966ac029afb600cf | |
parent | e5ecdabfcf75d07d42c93ab2b472b8340b674ae7 (diff) | |
parent | 669198e6d1bd5047baeea4f298f27ec22fbc71f5 (diff) | |
download | source.android.com-b8087179e42959b1efeb64a81110d6d0aa2b798f.tar.gz |
Merge "Docs: Changes to source.android.com" am: 0a9ccdf0b0 am: c391221fea am: 6ccb9c7cc8
am: 669198e6d1
Change-Id: Idf6e6994594f7e8514edbd0c54bd1cc92dd898de
43 files changed, 799 insertions, 590 deletions
diff --git a/en/_index.yaml b/en/_index.yaml index df0c381d..deaf9354 100644 --- a/en/_index.yaml +++ b/en/_index.yaml @@ -60,6 +60,14 @@ landing_page: image_path: /images/android_stack.png - heading: News items: + - heading: Updated Debugging Docs + description: > + Debugging documentation has been updated with details on using + <code>debuggerd</code> (includes new examples), <code>stack</code>, + <code>strace</code>, and <code>Valgrind</code> tools. + buttons: + - label: June 5th, 2017 + path: /devices/tech/debug/ - heading: Using Reference Boards description: > The former <em>Selecting Devices</em> page has been renamed @@ -84,14 +92,6 @@ landing_page: buttons: - label: April 27th, 2017 path: /devices/tech/debug/eval_perf - - heading: Camera Image Test Suite (ITS) Test - description: > - The Android Compatibility Test Suite (CTS) now supports ITS test - automation via Camera ITS-in-a-box, an assembly for testing - multiple devices at once. - buttons: - - label: April 20th, 2017 - path: /compatibility/cts/camera-its-box - classname: devsite-landing-row-100 tf-row-centered items: - buttons: diff --git a/en/compatibility/5.1/android-5.1-cdd.html b/en/compatibility/5.1/android-5.1-cdd.html index 3fcff269..77448964 100644 --- a/en/compatibility/5.1/android-5.1-cdd.html +++ b/en/compatibility/5.1/android-5.1-cdd.html @@ -2096,18 +2096,20 @@ devices only when supported by hardware.</p> <p class="table_footnote">2 STRONGLY RECOMMENDED for Android Television device implementations when supported by hardware.</p> -<p>Android device implementations, when supporting H.265 codec as described in <a href="#5_1_3_video_codecs">section 5.1.3</a>, MUST support the Main Profile Level 3 Main tier and the following SD video -decoding profiles and SHOULD support the HD decoding profiles. Android -Television devices MUST support the Main Profile Level 4.1 Main tier and the HD -1080p decoding profile and SHOULD support Main10 Level 5 Main Tier profile and -the UHD decoding profile.</p> +<p>Android device implementations, when supporting H.265 codec as described in +<a href="#5_1_3_video_codecs">section 5.1.3</a>, MUST support the Main Profile Level 3 Main tier +and the following SD video decoding profiles and SHOULD support the HD decoding profiles. Android +Television devices SHOULD support Main10 Level 5 Main Tier profile and the UHD decoding profile. +Android Television devices are STRONGLY RECOMMENDED to support the HD 1080p decoding profile. +If the HD 1080p decoding profile is supported, it MUST support the Main Profile Level +4.1 Main tier</p> <table> <tr> <th></th> <th>SD (Low quality)</th> <th>SD (High quality)</th> <th>HD 720p </strong>1 </td> - <th>HD 1080p </strong>1 </td> + <th>HD 1080p </strong>2 </td> <th>UHD </strong>2</td> </tr> <tr> @@ -2140,7 +2142,7 @@ the UHD decoding profile.</p> <p class="table_footnote">1 Required for Android Television device implementation, but for other type of devices only when supported by hardware.</p> -<p class="table_footnote">2 Required for Android Television device implementations when supported by +<p class="table_footnote">2 STRONGLY RECOMMENDED for Android Television device implementations when supported by hardware.</p> <h2 id="5_4_audio_recording">5.4. Audio Recording</h2> diff --git a/en/compatibility/6.0/android-6.0-cdd.html b/en/compatibility/6.0/android-6.0-cdd.html index d3e7d4ce..ba8ea512 100644 --- a/en/compatibility/6.0/android-6.0-cdd.html +++ b/en/compatibility/6.0/android-6.0-cdd.html @@ -2446,17 +2446,17 @@ supported by hardware.</p> <a href="#5_1_3_video_codecs">section 5.1.3</a>, MUST support the Main Profile Level 3 Main tier and the following SD video decoding profiles and SHOULD support the HD decoding profiles. -Android Television devices MUST support the Main Profile Level 4.1 Main tier and -the HD 1080p decoding profile and is STRONGLY RECOMMENDED to support the UHD -decoding profile. If UHD decoding is supported, then it MUST support Main10 -Level 5 Main Tier profile.</p> +Android Television devices are STRONGLY RECOMMENDED to support the UHD decoding profile +and the HD 1080p decoding profile. If the HD 1080p decoding profile is supported, it MUST support +the Main Profile Level 4.1 Main tier. If UHD decoding is supported, then it MUST support +Main10 Level 5 Main Tier profile.</p> <table> <tr> <th></th> <th>SD (Low quality)</th> <th>SD (High quality)</th> <th>HD 720p<sup>1</sup></th> - <th>HD 1080p<sup>1</sup></th> + <th>HD 1080p<sup>2</sup></th> <th>UHD<sup>2</sup></th> </tr> <tr> @@ -3495,7 +3495,8 @@ remote or can be a software-based remote that is accessible from a mobile phone or tablet. The remote control MUST meet the requirements defined below.</p> <ul> - <li><strong>Search affordance</strong>. Device implementations MUST fire KEYCODE_SEARCH when the user invokes voice search either on the physical or software-based remote.</li> + <li><strong>Search affordance</strong>. Device implementations MUST fire KEYCODE_SEARCH (or KEYCODE_ASSIST if the device supports an assistant) + when the user invokes voice search on either the physical or software-based remote.</li> <li><strong>Navigation</strong>. All Android Television remotes MUST include Back, Home, and Select buttons and support for D-pad events [<a href="http://developer.android.com/reference/android/view/KeyEvent.html">Resources, 88</a>].</li> </ul> diff --git a/en/devices/accessories/aoa.html b/en/devices/accessories/aoa.html index 6acdfc06..c57fef60 100644 --- a/en/devices/accessories/aoa.html +++ b/en/devices/accessories/aoa.html @@ -99,7 +99,7 @@ if the device supports that mode:</p> it returns a non-zero number that represents the supported protocol version. The control request is on endpoint 0 with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_IN | USB_TYPE_VENDOR request: 51 value: 0 @@ -116,7 +116,7 @@ data: protocol version number (16 bits little endian sent from the request is on endpoint 0 (for each string ID) with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_OUT | USB_TYPE_VENDOR request: 52 value: 0 @@ -127,7 +127,7 @@ data zero terminated UTF8 string sent from accessory to device <p>The following string IDs are supported, with a maximum size of 256 bytes for each string (must be zero-terminated with <code>\0</code>).</p> -<pre> +<pre class="devsite-click-to-copy"> manufacturer name: 0 model name: 1 description: 2 @@ -140,7 +140,7 @@ serial number: 5 <li>Send a control request to ask the device to start in accessory mode. The control request is on endpoint 0 with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_OUT | USB_TYPE_VENDOR request: 53 value: 0 diff --git a/en/devices/accessories/aoa2.html b/en/devices/accessories/aoa2.html index 1f965937..83e27929 100644 --- a/en/devices/accessories/aoa2.html +++ b/en/devices/accessories/aoa2.html @@ -53,7 +53,8 @@ devices.</p> (<code><adk-src>/adk1/board/AndroidAccessory/AndroidAccessory.cpp</code>) library demonstrates this protocol check:</p> -<pre><code>bool AndroidAccessory::switchDevice(byte addr) +<pre class="devsite-click-to-copy"> +bool AndroidAccessory::switchDevice(byte addr) { int protocol = getProtocol(addr); if (protocol >= 1) { @@ -74,7 +75,7 @@ library demonstrates this protocol check:</p> USB_SETUP_RECIPIENT_DEVICE, ACCESSORY_START, 0, 0, 0, 0, NULL); return true; } -</code></pre> +</pre> <p>AOAv2 includes new USB product IDs for each combination of USB interfaces available in accessory mode:</p> @@ -146,14 +147,15 @@ the future).</p> <p>To enable audio support, the accessory must send a new USB control request: </p> -<pre><code>**SET_AUDIO_MODE** +<pre class="devsite-click-to-copy"> +**SET_AUDIO_MODE** requestType: USB_DIR_OUT | USB_TYPE_VENDOR request: 58 value: 0 for no audio (default), 1 for 2 channel, 16-bit PCM at 44100 KHz index: 0 data none -</code></pre> +</pre> <p>This command must be sent <em>before</em> sending the <code>ACCESSORY_START</code> command for entering accessory mode.</p> @@ -201,7 +203,8 @@ accessory to the Android device.</li> <p>The code definitions for the new control requests are:</p> -<pre><code>/* Control request for registering a HID device. +<pre class="devsite-click-to-copy"> +/* Control request for registering a HID device. * Upon registering, a unique ID is sent by the accessory in the * value parameter. This ID will be used for future commands for * the device @@ -248,7 +251,7 @@ accessory to the Android device.</li> * data the HID report for the event */ #define ACCESSORY_SEND_HID_EVENT 57 -</code></pre> +</pre> <h2 id="interoperability-with-aoa-10-features">Interoperability with AOAv1</h2> diff --git a/en/devices/accessories/headset/usb-headset-spec.html b/en/devices/accessories/headset/usb-headset-spec.html index 8d067c61..9a7cbad1 100644 --- a/en/devices/accessories/headset/usb-headset-spec.html +++ b/en/devices/accessories/headset/usb-headset-spec.html @@ -170,6 +170,11 @@ mappings. </tr> </table> +<p class="note">Key mappings should be declared within a HID application +collection. For accessories without a microphone, use Headphone (Usage +Page: Consumer (0x0C), Usage: Headphone (0x05)). For accesories with a +microphone, use Headset (Usage Page: Telephony (0x0B), Usage: Headset (0x05)).</p> + <h2 id="mechanical">Mechanical</h2> <p> Accessory manufacturers must follow the requirements for USB connectors diff --git a/en/devices/accessories/stylus.html b/en/devices/accessories/stylus.html index d2c2b79f..da739f9a 100644 --- a/en/devices/accessories/stylus.html +++ b/en/devices/accessories/stylus.html @@ -52,7 +52,7 @@ Bluetooth Low Energy (BTLE), or USB.</p> <h3 id="hid-descriptor">HID descriptor</h3> -<p><pre> +<pre class="devsite-click-to-copy"> UsagePage(Digitizer) Usage(Pen) Collection(Application) @@ -110,7 +110,7 @@ unsigned char HID_DESC[] = { 0xC0, // End Collection 0xC0, // End Collection } -</pre></p> +</pre> <h2 id="guidelines-devs">Guidelines for stylus application developers</h2> <p>The Android 6.0 platform automatically handles pairing and event correlation, diff --git a/en/devices/audio/implement-policy.html b/en/devices/audio/implement-policy.html index 16cd0820..a6ccf0e9 100644 --- a/en/devices/audio/implement-policy.html +++ b/en/devices/audio/implement-policy.html @@ -75,10 +75,9 @@ shows many of these features in use.</p> <code>/system/etc</code>. To view a simple audio policy configuration in the new XML file format, view the example below.</p> -<p> <section class="expandable"> <h4 class="showalways">Show audio policy example</h4> -<pre> +<pre class="devsite-click-to-copy"> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude"> <globalConfiguration speaker_drc_enabled="true"/> @@ -139,7 +138,6 @@ XML file format, view the example below.</p> <xi:include href="default_volume_tables.xml"/> </audioPolicyConfiguration> </pre></section> -</p> <p>The top level structure contains modules that correspond to each audio HAL hardware module, where each module has a list of mix ports, device ports, and @@ -160,7 +158,7 @@ overwritten.</p> <section class="expandable"> <h4 class="showalways">Show volume table example</h4> -<p><pre> +<pre class="devsite-click-to-copy"> <?xml version="1.0" encoding="UTF-8"?> <volumes> <reference name="FULL_SCALE_VOLUME_CURVE"> @@ -178,11 +176,11 @@ overwritten.</p> <point>100,0</point> </reference> </volumes> -</pre></p></section> +</pre></section> <section class="expandable"> <h4 class="showalways">Show volumes example</h4> -<p><pre> +<pre class="devsite-click-to-copy"> <?xml version="1.0" encoding="UTF-8"?> <volumes> <volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_VOLUME_CURVE"/> @@ -255,7 +253,7 @@ overwritten.</p> <volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="FULL_SCALE_VOLUME_CURVE"/> <volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="FULL_SCALE_VOLUME_CURVE"/> </volumes> -</pre></p></section> +</pre></section> <h2 id=file_inclusions>File inclusions</h2> <p>The XML Inclusions (XInclude) method can be used to include audio policy @@ -391,7 +389,7 @@ product. The following example from a Galaxy Nexus shows a <em>dynamic</em> channel mask, which means the audio policy manager queries the actual channel masks supported by the HDMI sink after connection.</p> -<pre> +<pre class="devsite-click-to-copy"> audio_hw_modules { primary { outputs { diff --git a/en/devices/audio/implement-pre-processing.html b/en/devices/audio/implement-pre-processing.html index e42dfc1c..adbf156f 100644 --- a/en/devices/audio/implement-pre-processing.html +++ b/en/devices/audio/implement-pre-processing.html @@ -83,7 +83,7 @@ audio HAL implementation's default behavior.</p> the <code>AudioSource</code> configuration in this manner, the framework will automatically request from the audio HAL the use of those effects.</p> -<p><pre> +<pre class="devsite-click-to-copy"> pre_processing { voice_communication { aec {} @@ -93,7 +93,7 @@ pre_processing { agc {} } } -</pre></p> +</pre> <h2 id=tuning>Source tuning</h2> diff --git a/en/devices/audio/implement-shared-library.html b/en/devices/audio/implement-shared-library.html index 0c999c81..9f687079 100644 --- a/en/devices/audio/implement-shared-library.html +++ b/en/devices/audio/implement-shared-library.html @@ -34,7 +34,7 @@ directory to contain your library's source files.</li> <li>Create an <code>Android.mk</code> file to build the shared library. Ensure the Makefile contains the following line: <br> -<pre> +<pre class="devsite-click-to-copy"> LOCAL_MODULE := audio.primary.<device> </pre> <br> @@ -46,7 +46,8 @@ hardware located on the device. The module names <code>audio.usb.<device></code> are also available for Bluetooth and USB audio interfaces. Here is an example of an <code>Android.mk</code> from the Galaxy Nexus audio hardware:</p> -<p><pre> + +<pre class="devsite-click-to-copy"> LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -62,29 +63,29 @@ LOCAL_SHARED_LIBRARIES := liblog libcutils libtinyalsa libaudioutils libdl LOCAL_MODULE_TAGS := optional include $(BUILD_SHARED_LIBRARY) -</pre></p> +</pre> </li> <br> <li>If your product supports low latency audio as specified by the Android CDD, copy the corresponding XML feature file into your product. For example, in your product's <code>device/<company>/<device>/device.mk</code> Makefile: -<p><pre> +<pre class="devsite-click-to-copy"> PRODUCT_COPY_FILES := ... PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \ -</pre></p> +</pre> </li> <br> <li>Copy the audio policy configuration file you created earlier to the <code>system/etc/</code> directory in your product's <code>device/<company>/<device>/device.mk</code> Makefile. For example: -<p><pre> +<pre class="devsite-click-to-copy"> PRODUCT_COPY_FILES += \ device/samsung/tuna/audio/audio_policy.conf:system/etc/audio_policy.conf -</pre></p> +</pre> </li> <br> <li>Declare the shared modules of your audio HAL that are required by your @@ -92,7 +93,7 @@ product in the product's <code>device/<company>/<device>/device.mk</code> Makefile. For example, the Galaxy Nexus requires the primary and Bluetooth audio HAL modules: -<pre> +<pre class="devsite-click-to-copy"> PRODUCT_PACKAGES += \ audio.primary.tuna \ audio.a2dp.default diff --git a/en/devices/audio/latency_design.html b/en/devices/audio/latency_design.html index f777c8ab..59ab47e0 100644 --- a/en/devices/audio/latency_design.html +++ b/en/devices/audio/latency_design.html @@ -43,7 +43,10 @@ The client can optionally set bit <code>AUDIO_OUTPUT_FLAG_FAST</code> in the </p> <ul> -<li>Android native audio based on OpenSL ES</li> +<li>Android native audio based on <a +href="https://developer.android.com/ndk/guides/audio/opensl/index.html">OpenSL +ES</a> or <a +href="https://developer.android.com/ndk/guides/audio/aaudio/aaudio.html">AAudio</a></li> <li><a href="http://developer.android.com/reference/android/media/SoundPool.html">android.media.SoundPool</a></li> <li><a href="http://developer.android.com/reference/android/media/ToneGenerator.html">android.media.ToneGenerator</a></li> </ul> diff --git a/en/devices/index.html b/en/devices/index.html index a1c3e4ee..49bea636 100644 --- a/en/devices/index.html +++ b/en/devices/index.html @@ -127,7 +127,7 @@ by the contract defined in each hardware-specific HAL interface. contains a <code>hw_module_t</code> struct along with other camera-specific function pointers: </p> -<pre> +<pre class="devsite-click-to-copy"> typedef struct camera_module { hw_module_t common; int (*get_number_of_cameras)(void); @@ -137,7 +137,8 @@ typedef struct camera_module { <p>When you implement a HAL and create the module struct, you must name it <code>HAL_MODULE_INFO_SYM</code>. For instance, here is an example from the Nexus 9 audio HAL:</p> -<pre> + +<pre class="devsite-click-to-copy"> struct audio_module HAL_MODULE_INFO_SYM = { .common = { .tag = HARDWARE_MODULE_TAG, @@ -159,7 +160,7 @@ struct audio_module HAL_MODULE_INFO_SYM = { <code>audio_hw_device_t</code> struct type contains function pointers to audio device operations: </p> -<pre> +<pre class="devsite-click-to-copy"> struct audio_hw_device { struct hw_device_t common; diff --git a/en/devices/tech/admin/multi-user.html b/en/devices/tech/admin/multi-user.html index 11a63df9..cc187660 100644 --- a/en/devices/tech/admin/multi-user.html +++ b/en/devices/tech/admin/multi-user.html @@ -91,7 +91,7 @@ for on-call duty.</p> shared by the primary user and the corp profile.</li> <li><em>Restricted</em>. Uses accounts based off the primary user, who can control what apps are available on the restricted profile. Available only on - tablets.</li> + tablets and television devices.</li> </ul> <h2 id=applying_the_overlay>Enabling multi-user</h2> diff --git a/en/devices/tech/debug/asan.html b/en/devices/tech/debug/asan.html index e510a05b..0ab286dc 100644 --- a/en/devices/tech/debug/asan.html +++ b/en/devices/tech/debug/asan.html @@ -23,8 +23,6 @@ -<h2 id=purpose>Purpose</h2> - <p>AddressSanitizer (ASan) is a fast compiler-based tool for detecting memory bugs in native code. It is comparable to Valgrind (Memcheck tool), but, unlike it, ASan:</p> diff --git a/en/security/authentication/gatekeeper.html b/en/security/authentication/gatekeeper.html index 94661684..692212c5 100644 --- a/en/security/authentication/gatekeeper.html +++ b/en/security/authentication/gatekeeper.html @@ -128,7 +128,7 @@ in GateKeeper.</p> only the addition of device-specific routines to be complete. To implement a TEE Gatekeeper with device-specific code for your TEE, please refer to the functions and comments in the following file:</p> -<pre> +<pre class="devsite-click-to-copy"> system/gatekeeper/include/gatekeeper/gatekeeper.h </pre> diff --git a/en/security/bulletin/2017-06-01.html b/en/security/bulletin/2017-06-01.html index 8c3f8faf..02a2578a 100644 --- a/en/security/bulletin/2017-06-01.html +++ b/en/security/bulletin/2017-06-01.html @@ -20,7 +20,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<p><em>Published June 5, 2017</em></p> +<p><em>Published June 5, 2017 | Updated June 7, 2017</em></p> <p>The Android Security Bulletin contains details of security vulnerabilities affecting Android devices. Security patch levels of June 05, 2017 or later @@ -31,8 +31,8 @@ level.</p> <p>Partners were notified of the issues described in the bulletin at least a month ago. Source code patches for these issues will be released to the Android -Open Source Project (AOSP) repository in the next 48 hours. We will revise this -bulletin with the AOSP links when they are available.</p> +Open Source Project (AOSP) repository and linked from this bulletin. This +bulletin also includes links to patches outside of AOSP.</p> <p>The most severe of these issues is a critical security vulnerability in Media Framework that could enable a remote attacker using a specially crafted file to @@ -132,21 +132,21 @@ to access data outside of its permission levels.</p> </tr> <tr> <td>CVE-2017-0639</td> - <td>A-35310991</td> + <td><a href="https://android.googlesource.com/platform/packages/apps/Bluetooth/+/f196061addcc56878078e5684f2029ddbf7055ff">A-35310991</a></td> <td>ID</td> <td>High</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-0645</td> - <td>A-35385327</td> + <td><a href="https://android.googlesource.com/platform/packages/apps/Bluetooth/+/14b7d7e1537af60b7bca6c7b9e55df0dc7c6bf41">A-35385327</a></td> <td>EoP</td> <td>Moderate</td> <td>6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-0646</td> - <td>A-33899337</td> + <td><a href="https://android.googlesource.com/platform/system/bt/+/2bcdf8ec7db12c5651c004601901f1fc25153f2c">A-33899337</a></td> <td>ID</td> <td>Moderate</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> @@ -172,70 +172,70 @@ unprivileged process.</p> </tr> <tr> <td>CVE-2015-8871</td> - <td>A-35443562</td> + <td>A-35443562<a href="#asterisk">*</a></td> <td>RCE</td> <td>High</td> <td>5.0.2, 5.1.1, 6.0, 6.0.1</td> </tr> <tr> <td>CVE-2016-8332</td> - <td>A-37761553</td> + <td>A-37761553<a href="#asterisk">*</a></td> <td>RCE</td> <td>High</td> <td>5.0.2, 5.1.1, 6.0, 6.0.1</td> </tr> <tr> <td>CVE-2016-5131</td> - <td>A-36554209</td> + <td><a href="https://android.googlesource.com/platform/external/libxml2/+/0eff71008becb7f2c2b4509708da4b79985948bb">A-36554209</a></td> <td>RCE</td> <td>High</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2016-4658</td> - <td>A-36554207</td> + <td><a href="https://android.googlesource.com/platform/external/libxml2/+/8ea80f29ea5fdf383ee3ae59ce35e55421a339f8">A-36554207</a></td> <td>RCE</td> <td>High</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-0663</td> - <td>A-37104170</td> + <td><a href="https://android.googlesource.com/platform/external/libxml2/+/521b88fbb6d18312923f0df653d045384b500ffc">A-37104170</a></td> <td>RCE</td> <td>High</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-7376</td> - <td>A-36555370</td> + <td><a href="https://android.googlesource.com/platform/external/libxml2/+/51e0cb2e5ec18eaf6fb331bc573ff27b743898f4">A-36555370</a></td> <td>RCE</td> <td>High</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-5056</td> - <td>A-36809819</td> + <td><a href="https://android.googlesource.com/platform/external/libxml2/+/3f571b1bb85cf56903f06bab3a820182115c5541">A-36809819</a></td> <td>RCE</td> <td>Moderate</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-7375</td> - <td>A-36556310</td> + <td><a href="https://android.googlesource.com/platform/external/libxml2/+/308396a55280f69ad4112d4f9892f4cbeff042aa">A-36556310</a></td> <td>RCE</td> <td>Moderate</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-0647</td> - <td>A-36392138</td> + <td><a href="https://android.googlesource.com/platform/system/core/+/3d6a43155c702bce0e7e2a93a67247b5ce3946a5">A-36392138</a></td> <td>ID</td> <td>Moderate</td> <td>5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2016-1839</td> - <td>A-36553781</td> + <td><a href="https://android.googlesource.com/platform/external/libxml2/+/ff20cd797822dba8569ee518c44e6864d6b4ebfa">A-36553781</a></td> <td>DoS</td> <td>Moderate</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> @@ -261,49 +261,49 @@ data processing.</p> </tr> <tr> <td>CVE-2017-0637</td> - <td>A-34064500</td> + <td><a href="https://android.googlesource.com/platform/external/libhevc/+/ebaa71da6362c497310377df509651974401d258">A-34064500</a></td> <td>RCE</td> <td>Critical</td> <td>5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-0391</td> - <td>A-32322258</td> + <td><a href="https://android.googlesource.com/platform/external/libhevc/+/14bc1678a80af5be7401cf750ab762ae8c75cc5a">A-32322258</a></td> <td>DoS</td> <td>High</td> <td>5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-0640</td> - <td>A-33129467</td> + <td>A-33129467<a href="#asterisk">*</a></td> <td>DoS</td> <td>High</td> <td>6.0, 6.0.1, 7.0, 7.1.1</td> </tr> <tr> <td>CVE-2017-0641</td> - <td>A-34360591</td> + <td><a href="https://android.googlesource.com/platform/external/libvpx/+/698796fc930baecf5c3fdebef17e73d5d9a58bcb">A-34360591</a></td> <td>DoS</td> <td>High</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-0642</td> - <td>A-34819017</td> + <td><a href="https://android.googlesource.com/platform/external/libhevc/+/913d9e8d93d6b81bb8eac3fc2c1426651f5b259d">A-34819017</a></td> <td>DoS</td> <td>High</td> <td>5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1, 7.1.2</td> </tr> <tr> <td>CVE-2017-0643</td> - <td>A-35645051</td> + <td>A-35645051<a href="#asterisk">*</a></td> <td>DoS</td> <td>High</td> <td>5.0.2, 5.1.1, 6.0, 6.0.1, 7.0, 7.1.1</td> </tr> <tr> <td>CVE-2017-0644</td> - <td>A-35472997</td> + <td>A-35472997<a href="#asterisk">*</a></td> <td>DoS</td> <td>High</td> <td>4.4.4, 5.0.2, 5.1.1, 6.0, 6.0.1</td> @@ -329,7 +329,7 @@ unprivileged process.</p> </tr> <tr> <td>CVE-2017-0638</td> - <td>A-36368305</td> + <td><a href="https://android.googlesource.com/platform/external/libgdx/+/a98943dd4aece3024f023f00256607d50dcbcd1e">A-36368305</a></td> <td>RCE</td> <td>High</td> <td>7.1.1, 7.1.2</td> @@ -400,7 +400,7 @@ using a specially crafted file to gain access to sensitive information.</p> </tr> <tr> <td>CVE-2015-7995</td> - <td>A-36810065</td> + <td>A-36810065<a href="#asterisk">*</a></td> <td>ID</td> <td>Moderate</td> <td>4.4.4</td> @@ -1395,6 +1395,11 @@ site</a>.</p> <td>June 5, 2017</td> <td>Bulletin published.</td> </tr> + <tr> + <td>1.1</td> + <td>June 7, 2017</td> + <td>Bulletin revised to include AOSP links.</td> + </tr> </table> </body> </html> diff --git a/en/security/encryption/file-based.html b/en/security/encryption/file-based.html index f1471519..37750fa0 100644 --- a/en/security/encryption/file-based.html +++ b/en/security/encryption/file-based.html @@ -254,7 +254,9 @@ into FBE mode as is the case in the developer preview. It is also possible to enable FBE from fastboot using this command: </p> <p> -<code>$ fastboot --wipe-and-use-fbe</code> +<pre class="devsite-terminal devsite-click-to-copy"> +fastboot --wipe-and-use-fbe +</pre> </p> <p> This is intended solely for development purposes as a platform for demonstrating @@ -302,9 +304,7 @@ created and the encryption policy links these keys to those directories. In the current AOSP implementation, the encryption policy is hardcoded into this location: </p> -<p> -<code>/system/extras/ext4_utils/ext4_crypt_init_extensions.cpp</code> -</p> +<pre class="devsite-click-to-copy">/system/extras/ext4_utils/ext4_crypt_init_extensions.cpp</pre> <p> It is possible to add exceptions in this file to prevent certain directories from being encrypted at all, by adding to the <code>directories_to_exclude</code> @@ -330,7 +330,7 @@ can be set at the application level. The system apps. The <code>directBootAware</code> attribute is available to all. </p> -<pre> +<pre class="devsite-click-to-copy"> <application android:directBootAware="true" android:defaultToDeviceProtectedStorage="true"> @@ -422,8 +422,8 @@ order to test with <a hre="https://git.kernel.org/cgit/fs/ext2/xfstests-bld.git/plain/quick-start?h=META"> xfstest</a> by using: </p> -<pre> -$ kvm-xfstests -c encrypt -g auto +<pre class="devsite-terminal devsite-click-to-copy"> +kvm-xfstests -c encrypt -g auto </pre> <p> In addition, device manufacturers may perform these manual tests. On a device diff --git a/en/security/encryption/full-disk.html b/en/security/encryption/full-disk.html index 21ede79b..a855b650 100644 --- a/en/security/encryption/full-disk.html +++ b/en/security/encryption/full-disk.html @@ -615,7 +615,7 @@ lost, and give the user a button to reboot the system.</td> </table> <h2 id=init_actions>Init actions</h2> -<pre> +<pre class="devsite-click-to-copy"> on post-fs-data on nonencrypted on property:vold.decrypt=trigger_reset_main diff --git a/en/security/keystore/implementer-ref.html b/en/security/keystore/implementer-ref.html index 16f56b88..c0b2ad93 100644 --- a/en/security/keystore/implementer-ref.html +++ b/en/security/keystore/implementer-ref.html @@ -37,7 +37,7 @@ key generation to specify key characteristics.</p> <p>Possible values are defined by the following enumeration:</p> -<pre> +<pre class="devsite-click-to-copy"> typedef enum { KM_PURPOSE_ENCRYPT = 0, KM_PURPOSE_DECRYPT = 1, @@ -58,7 +58,7 @@ key, the operation must fail with <code>KM_ERROR_INCOMPATIBLE_PURPOSE</code>.</p <p>Possible values are defined by the following enumeration:</p> -<pre> +<pre class="devsite-click-to-copy"> typedef enum { KM_ALGORITHM_RSA = 1, KM_ALGORITHM_EC = 3, @@ -85,7 +85,7 @@ only relevant to AES keys.</p> <p>Possible values are defined by the following enumeration:</p> -<pre> +<pre class="devsite-click-to-copy"> typedef enum { KM_MODE_ECB = 1, KM_MODE_CBC = 2, @@ -107,7 +107,7 @@ HMAC keys.</p> <p>Possible values are defined by the following enumeration:</p> -<pre> +<pre class="devsite-click-to-copy"> typedef enum { KM_DIGEST_NONE = 0, KM_DIGEST_MD5 = 1, @@ -132,7 +132,7 @@ relevant to RSA and AES keys.</p> <p>Possible values are defined by the following enumeration:</p> -<pre> +<pre class="devsite-click-to-copy"> typedef enum { KM_PAD_NONE = 1, KM_PAD_RSA_OAEP = 2, @@ -210,7 +210,7 @@ key to be used.</p> <p>Possible values are defined by the following enumeration:</p> -<pre> +<pre class="devsite-click-to-copy"> typedef enum { KM_BLOB_STANDALONE = 0, KM_BLOB_REQUIRES_FILE_SYSTEM = 1, @@ -357,7 +357,7 @@ network-ordered integers to host-ordered integers and <p>The value is a 32-bit integer bitmask of values from the enumeration:</p> -<pre> +<pre class="devsite-click-to-copy"> typedef enum { HW_AUTH_NONE = 0, HW_AUTH_PASSWORD = 1 << 0, @@ -445,7 +445,7 @@ by the trustlet.</p> <p>The possible values are defined in <code>keymaster_origin_t</code>:</p> -<pre> +<pre class="devsite-click-to-copy"> typedef enum { KM_ORIGIN_GENERATED = 0, KM_ORIGIN_IMPORTED = 2, diff --git a/en/security/keystore/index.html b/en/security/keystore/index.html index 54a6f83b..8ce4b7a4 100644 --- a/en/security/keystore/index.html +++ b/en/security/keystore/index.html @@ -73,7 +73,7 @@ reached through some kernel interface. The resulting architecture looks like the following:</p> <div align="center"> - <img src="../images/access-to-keymaster.png" alt="Access to Keymaster" id="figure1" /> + <img src="/security/images/access-to-keymaster.png" alt="Access to Keymaster" id="figure1" /> </div> <p class="img-caption"><strong>Figure 1.</strong> Access to Keymaster</p> diff --git a/en/security/selinux/concepts.html b/en/security/selinux/concepts.html index 543a1dc4..227a3c53 100644 --- a/en/security/selinux/concepts.html +++ b/en/security/selinux/concepts.html @@ -116,7 +116,9 @@ for each class are represented by permissions. </p> </ul> <p>And so an example use of this would follow the structure:</p> -<code>allow appdomain app_data_file:file rw_file_perms;</code> +<pre class="devsite-click-to-copy"> +allow appdomain app_data_file:file rw_file_perms; +</pre> <p>This says that all application domains are allowed to read and write files labeled app_data_file. Note that this rule relies upon macros defined in the @@ -129,13 +131,13 @@ failures due to denials on related permissions.</p> <p>Use the syntax above to create avc rules that comprise the essence of an SELinux policy. A rule takes the form: -<pre> -<rule variant> <source_types> <target_types> : <classes> <permissions> +<pre class="devsite-click-to-copy"> +<var>RULE_VARIANT SOURCE_TYPES TARGET_TYPES</var> : <var>CLASSES PERMISSIONS</var> </pre> <p>The rule indicates what should happen when a subject labeled with any of the <em>source_types</em> attempts an action corresponding to any of the <em>permissions</em> on an object with any of the class <em>classes</em> which has any of the <em>target_types</em> label. The most common example of one of these rules is an allow rule, e.g.:</p> -<pre> +<pre class="devsite-click-to-copy"> allow domain null_device:chr_file { open }; </pre> @@ -143,7 +145,7 @@ allow domain null_device:chr_file { open }; <p> This rule allows a process with any <em>domain</em> associated with the ‘domain’ attribute to take the action described by the <em>permission</em> ‘open’ on an object of <em>class</em> ‘chr_file’ (character device file) that has the <em>target_type</em> label of ‘null_device.’ In practice, this rule may be extended to include other permissions: </p> -<pre> +<pre class="devsite-click-to-copy"> allow domain null_device:chr_file { getattr open read ioctl lock append write}; </pre> diff --git a/en/security/selinux/customize.html b/en/security/selinux/customize.html index c8ead37c..294d4040 100644 --- a/en/security/selinux/customize.html +++ b/en/security/selinux/customize.html @@ -100,7 +100,7 @@ should supply the modifications to the default SELinux policy as a <a href="/sou <p>In the following example, all domains are granted access to read from or write to <code>/dev/null</code> and read from <code>/dev/zero</code>.</p> -<pre> +<pre class="devsite-click-to-copy"> # Allow read / write access to /dev/null allow domain null_device:chr_file { getattr open read ioctl lock append write}; @@ -111,7 +111,7 @@ allow domain zero_device:chr_file { getattr open read ioctl lock }; <p>This same statement can be written with SELinux <code>*_file_perms</code> macros (shorthand):</p> -<pre> +<pre class="devsite-click-to-copy"> # Allow read / write access to /dev/null allow domain null_device:chr_file rw_file_perms; @@ -123,7 +123,7 @@ allow domain zero_device:chr_file r_file_perms; <p>Here is a complete example policy for DHCP, which we examine below:</p> -<pre> +<pre class="devsite-click-to-copy"> type dhcp, domain; permissive dhcp; type dhcp_exec, exec_type, file_type; diff --git a/en/security/selinux/device-policy.html b/en/security/selinux/device-policy.html index 82e6c4b1..6fe8b209 100644 --- a/en/security/selinux/device-policy.html +++ b/en/security/selinux/device-policy.html @@ -62,7 +62,9 @@ After modifying the command line, perform <code>make clean</code>, then <p>After that, confirm permissive mode with:</p> -<p><code>adb getenforce</code></p> +<pre class="devsite-terminal devsite-click-to-copy"> +adb getenforce +</pre> <p>Two weeks is a reasonable amount of time to be in global permissive mode. After @@ -104,7 +106,7 @@ scratch on a new device, which include:</p> <p>Denials generated by core services are typically addressed by file labeling. For example:</p> -<pre class="no-pretty-print"> +<pre> avc: denied { open } for pid=1003 comm=”mediaserver” path="/dev/kgsl-3d0” dev="tmpfs" scontext=u:r:mediaserver:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1 @@ -164,7 +166,7 @@ permissions.</p> <p>The service is launched in our device’s <code>init.<target>.rc</code> file as:</p> -<pre class="no-pretty-print"> +<pre class="devsite-click-to-copy"> service foo /system/bin/foo class core </pre> @@ -175,7 +177,7 @@ service foo /system/bin/foo <p>Create the file <code>device/<oem>/<target>/sepolicy/foo.te</code> with the following contents:</p> -<pre class="no-pretty-print"> +<pre class="devsite-click-to-copy"> # foo service type foo, domain; type foo_exec, exec_type, file_type; @@ -193,7 +195,7 @@ init_daemon_domain(foo) <p>Add the following to <code>device/<oem>/<target>/sepolicy/ file_contexts</code>:</p> -<pre class="no-pretty-print"> +<pre class="devsite-click-to-copy"> /system/bin/foo u:object_r:foo_exec:s0 </pre> @@ -231,7 +233,7 @@ device-specific policies.</p> <p>The following example rule is like locking the front door but leaving the windows open:</p> -<p><code>allow { domain -untrusted_app } scary_debug_device:chr_file rw_file_perms</code>.</p> +<pre>allow { domain -untrusted_app } scary_debug_device:chr_file rw_file_perms</pre> <p>The intent is clear: everyone but third-party apps may have access to the debug device. </p> diff --git a/en/security/selinux/implement.html b/en/security/selinux/implement.html index e899eb4d..11473906 100644 --- a/en/security/selinux/implement.html +++ b/en/security/selinux/implement.html @@ -127,7 +127,7 @@ containing the sepolicy subdirectory - to reference the sepolicy subdirectory and each policy file once created, as shown below. The BOARD_SEPOLICY variables and their meaning is documented in the system/sepolicy/README file.</p> -<pre> +<pre class="devsite-click-to-copy"> BOARD_SEPOLICY_DIRS += \ <root>/device/manufacturer/device-name/sepolicy @@ -195,7 +195,9 @@ SELinux to protect your devices:</p> <li>Enable SELinux in the kernel: <code>CONFIG_SECURITY_SELINUX=y</code> <li>Change the kernel_cmdline parameter so that:<br/> -<code>BOARD_KERNEL_CMDLINE := androidboot.selinux=permissive</code>. +<pre class="devsite-click-to-copy"> +BOARD_KERNEL_CMDLINE := androidboot.selinux=permissive +</pre> <br/> This is only for initial development of policy for the device. Once you have an initial bootstrap policy, remove this parameter so that your device is @@ -203,10 +205,14 @@ enforcing or it will fail CTS. <li>Boot up the system in permissive and see what denials are encountered on boot:<br/> On Ubuntu 14.04 or newer: <br/> -<code>adb shell su -c dmesg | grep denied | audit2allow -p out/target/product/<em>board</em>/root/sepolicy</code> +<pre class="devsite-terminal devsite-click-to-copy"> +adb shell su -c dmesg | grep denied | audit2allow -p out/target/product/<var>BOARD</var>/root/sepolicy +</pre> <br/> -On Ubuntu 12.04: -<code>adb shell su -c dmesg | grep denied | audit2allow</code> +On Ubuntu 12.04:<br/> +<pre class="devsite-terminal devsite-click-to-copy"> +adb shell su -c dmesg | grep denied | audit2allow +</pre> <li>Evaluate the output. See <a href="validate.html">Validation</a> for instructions and tools. <li>Identify devices, and other new files that need labeling. <li>Use existing or new labels for your objects. @@ -216,8 +222,12 @@ to assign a new one. Ideally, this will be an existing label which will fit into policy, but sometimes a new label will be needed, and rules for access to that label will be needed, as well. <li>Identify domains/processes that should have their own security domains. A policy will likely need to be written for each of these from scratch. All services spawned from <code>init</code>, for instance, should have their own. The following commands help reveal those that remain running (but ALL services need such a treatment):<br/> -<code>$ adb shell su -c ps -Z | grep init</code><br/> -<code>$ adb shell su -c dmesg | grep 'avc: '</code> +<pre class="devsite-terminal devsite-click-to-copy"> +adb shell su -c ps -Z | grep init +</pre> +<pre class="devsite-terminal devsite-click-to-copy"> +adb shell su -c dmesg | grep 'avc: ' +</pre> <li>Review init.<device>.rc to identify any which are without a type. These should be given domains EARLY in order to avoid adding rules to init or otherwise diff --git a/en/security/selinux/validate.html b/en/security/selinux/validate.html index ba3e6ec8..93ecc050 100644 --- a/en/security/selinux/validate.html +++ b/en/security/selinux/validate.html @@ -73,9 +73,9 @@ run at the time the denial was generated. In this case, it’s a pretty good hin </ul> <p>And here is another example:</p> - +<pre class="devsite-terminal devsite-click-to-copy">adb shell su root dmesg | grep 'avc: '</pre> +<p>Output:</p> <pre> -$ adb shell su root dmesg | grep 'avc: ' <5> type=1400 audit: avc: denied { read write } for pid=177 comm="rmt_storage" name="mem" dev="tmpfs" ino=6004 scontext=u:r:rmt:s0 tcontext=u:object_r:kmem_device:s0 tclass=chr_file @@ -101,18 +101,18 @@ tcontext=u:object_r:kmem_device:s0 tclass=chr_file on production devices. CTS tests confirm enforcing mode is enabled.</p> -<p>To turn a device’s SELinux enforcement into globally permissive via ADB, as -root issue:</p> - -<pre> -$ adb shell su root setenforce 0 +<p>SELinux enforcement can be disabled via ADB on userdebug or eng builds. To do so, +first switch ADB to root by running <code>adb root</code>. Then, to disable SELinux +enforcement, run: +<pre class="devsite-terminal devsite-click-to-copy"> +adb shell setenforce 0 </pre> <p>Or at the kernel command line (during early device bring-up):</p> -<pre> -androidboot.selinux=permissive -androidboot.selinux=enforcing +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">androidboot.selinux=permissive</code> +<code class="devsite-terminal">androidboot.selinux=enforcing</code> </pre> <h2 id=using_audit2allow>Using audit2allow</h2> @@ -125,8 +125,8 @@ is compiled automatically when you build Android from source.</p> <p>To use it, run:</p> -<pre> -$ adb shell su root dmesg | audit2allow -p $OUT/root/sepolicy +<pre class="devsite-terminal devsite-click-to-copy"> +adb shell su root dmesg | audit2allow -p $OUT/root/sepolicy </pre> <p>Nevertheless, care must be taken to examine each potential addition for diff --git a/en/security/trusty/index.html b/en/security/trusty/index.html index a6f60512..dbdba9a3 100644 --- a/en/security/trusty/index.html +++ b/en/security/trusty/index.html @@ -147,10 +147,10 @@ trusted by the user of the product on which the application runs.</p> <a href="https://android.googlesource.com/kernel/common/+/android-trusty-3.18">https://android.googlesource.com/kernel/common/+/android-trusty-3.18</a></p> <p>To make Trusty, run the following commands (assuming the Android toolchain is already in the path):</p> -<pre> -$ repo init -u https://android.googlesource.com/trusty/manifest -$ repo sync -$ make -j24 generic-arm64 +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">repo init -u https://android.googlesource.com/trusty/manifest</code> +<code class="devsite-terminal">repo sync</code> +<code class="devsite-terminal">make -j24 generic-arm64</code> </pre> <p>You may select another supported build target from: <code>device/*/*/project/*</code></p> diff --git a/en/security/verifiedboot/dm-verity.html b/en/security/verifiedboot/dm-verity.html index 763b2e4c..07e7821d 100644 --- a/en/security/verifiedboot/dm-verity.html +++ b/en/security/verifiedboot/dm-verity.html @@ -82,7 +82,7 @@ integral to dm-verity. The <a href="https://gitlab.com/cryptsetup/cryptsetup/wikis/DMVerity">cryptsetup</a> tool will generate a hash tree for you. Alternatively, a compatible one is defined here:</p> -<pre> +<pre class="devsite-click-to-copy"> <your block device name> <your block device name> <block size> <block size> <image size in blocks> <image size in blocks + 8> <root hash> <salt> </pre> diff --git a/en/security/verifiedboot/verified-boot.html b/en/security/verifiedboot/verified-boot.html index 856263de..e907dcb0 100644 --- a/en/security/verifiedboot/verified-boot.html +++ b/en/security/verifiedboot/verified-boot.html @@ -434,7 +434,7 @@ message, which can be parsed with a decoder similar to the one found at: <a href="https://android.googlesource.com/platform/bootable/recovery/+/f4a6ab27b335b69fbc419a9c1ef263004b561265/asn1_decoder.cpp">platform/bootable/recovery/asn1_decoder.cpp</a><br/> The message format itself is as follows:</p> -<pre> +<pre class="devsite-click-to-copy"> AndroidVerifiedBootSignature DEFINITIONS ::= BEGIN FormatVersion ::= INTEGER diff --git a/en/source/64-bit-builds.html b/en/source/64-bit-builds.html index d34715db..f0079a86 100644 --- a/en/source/64-bit-builds.html +++ b/en/source/64-bit-builds.html @@ -49,7 +49,7 @@ within its manifest to avoid potential errors.</p> <p>In <code>BoardConfig.mk</code>, we added the following variables to configure the second CPU architecture and ABI:</p> -<pre class=prettyprint> +<pre> TARGET_2ND_ARCH TARGET_2ND_ARCH_VARIANT TARGET_2ND_CPU_VARIANT @@ -63,7 +63,7 @@ TARGET_2ND_CPU_ABI2 <p>If you want the build system to build 32-bit executables and apps by default, set the following variable:</p> -<pre class=prettyprint> +<pre class="devsite-click-to-copy"> TARGET_PREFER_32_BIT := true </pre> @@ -161,7 +161,7 @@ $(TARGET_OUT_SHARED_LIBRARIES)/hw</code>.</p> <p>In Multilib build, use <code>LOCAL_MODULE_RELATIVE_PATH</code> instead:</p> -<pre class=prettyprint> +<pre class="devsite-click-to-copy"> LOCAL_MODULE_RELATIVE_PATH := hw </pre> diff --git a/en/source/add-device.html b/en/source/add-device.html index 9443ebdf..bd869f97 100644 --- a/en/source/add-device.html +++ b/en/source/add-device.html @@ -158,19 +158,19 @@ href="https://android.googlesource.com/platform/frameworks/base/+/master/core/re <p> To set up a resource overlay on this file, add the overlay directory to the project buildfile, as follows:</p> -<pre> -PRODUCT_PACKAGE_OVERLAYS := device/<i>device_implementer</i>/<i>device_name</i>/overlay +<pre class="devsite-click-to-copy"> +PRODUCT_PACKAGE_OVERLAYS := device/<var>DEVICE_IMPLEMENTER</var>/<var>DEVICE_NAME</var>/overlay </pre> <p>or</p> -<pre> -PRODUCT_PACKAGE_OVERLAYS := vendor/<i>vendor_name</i>/overlay +<pre class="devsite-click-to-copy"> +PRODUCT_PACKAGE_OVERLAYS := vendor/<var>VENDOR_NAME</var>/overlay </pre> <p> Then, add an overlay file to the directory, for example:</p> -<pre> +<pre class="devsite-click-to-copy"> vendor/foobar/overlay/frameworks/base/core/res/res/config.xml </pre> @@ -213,7 +213,7 @@ to that of the Nexus 6 product line: <code>vendor/moto/shamu/device-vendor.mk</code> files via the Makefile while also declaring the product-specific information such as name, brand, and model. -<pre> +<pre class="devsite-click-to-copy"> # Inherit from the common Open Source product configuration $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) @@ -242,7 +242,7 @@ PRODUCT_PACKAGES += \ <li>Create an <code>AndroidProducts.mk</code> file that points to the product's Makefiles. In this example, only the product definition Makefile is needed. The example below is from <code>device/moto/shamu/AndroidProducts.mk</code>: - <pre> +<pre class="devsite-click-to-copy"> # # This file should set PRODUCT_MAKEFILES to a list of product makefiles # to expose to the build system. LOCAL_DIR will already be set to @@ -265,8 +265,8 @@ PRODUCT_MAKEFILES := \ <li>Create a <code>vendorsetup.sh</code> file to add your product (a "lunch combo") to the build along with a <a href="#build-variants">build variant</a> separated by a dash. For example: -<pre> -add_lunch_combo <product_name>-userdebug +<pre class="devsite-click-to-copy"> +add_lunch_combo <var><PRODUCT_NAME></var>-userdebug </pre> </li> diff --git a/en/source/build-numbers.html b/en/source/build-numbers.html index 1c1580e5..5b977c6b 100644 --- a/en/source/build-numbers.html +++ b/en/source/build-numbers.html @@ -197,6 +197,42 @@ site:</p> </thead> <tbody> <tr> + <td>NJH47B</td> + <td>android-7.1.2_r17</td> + <td>Nougat</td> + <td>Pixel XL, Pixel</td> + </tr> + <tr> + <td>NJH34C</td> + <td>android-7.1.2_r16</td> + <td>Nougat</td> + <td>Pixel XL, Pixel</td> + </tr> + <tr> + <td>NKG47L</td> + <td>android-7.1.2_r15</td> + <td>Nougat</td> + <td>Pixel XL, Pixel</td> + </tr> + <tr> + <td>NHG47N</td> + <td>android-7.1.2_r14</td> + <td>Nougat</td> + <td>Pixel XL, Pixel</td> + </tr> + <tr> + <td>N2G47X</td> + <td>android-7.1.2_r13</td> + <td>Nougat</td> + <td>Nexus Player</td> + </tr> + <tr> + <td>N2G47W</td> + <td>android-7.1.2_r12</td> + <td>Nougat</td> + <td>Nexus 5X, Nexus 6P, Pixel C</td> + </tr> + <tr> <td>NHG47L</td> <td>android-7.1.2_r11</td> <td>Nougat</td> @@ -257,6 +293,24 @@ site:</p> <td>Pixel C</td> </tr> <tr> + <td>N9F27C</td> + <td>android-7.1.1_r43</td> + <td>Nougat</td> + <td>Nexus 9 (volantis)</td> + </tr> + <tr> + <td>N6F27E</td> + <td>android-7.1.1_r42</td> + <td>Nougat</td> + <td>Nexus 6</td> + </tr> + <tr> + <td>N4F27E</td> + <td>android-7.1.1_r41</td> + <td>Nougat</td> + <td>Nexus 9 (volantisg)</td> + </tr> + <tr> <td>N6F27C</td> <td>android-7.1.1_r40</td> <td>Nougat</td> @@ -1780,15 +1834,15 @@ tested.</p> associated with each project by issuing the following command and passing it the two branch tags:</p> -<pre><code>$ repo forall -pc 'git log --no-merges --oneline branch-1..branch-2'</pre></code> +<pre class="devsite-terminal devsite-click-to-copy">repo forall -pc 'git log --no-merges --oneline branch-1..branch-2'</pre> <p>For example:</p> -<pre><code>$ repo forall -pc 'git log --no-merges --oneline android-4.4.2_r2..android-4.4.2_r1'</pre></code> +<pre class="devsite-terminal devsite-click-to-copy">repo forall -pc 'git log --no-merges --oneline android-4.4.2_r2..android-4.4.2_r1'</pre> <p>And to output to a text file:</p> -<pre><code>repo forall -pc 'git log --no-merges --oneline android-4.4.2_r2..android-4.4.2_r1' > /tmp/android-4.4.2_r2-android-4.4.2_r1-diff.txt</pre></code> +<pre class="devsite-terminal devsite-click-to-copy">repo forall -pc 'git log --no-merges --oneline android-4.4.2_r2..android-4.4.2_r1' > /tmp/android-4.4.2_r2-android-4.4.2_r1-diff.txt</pre> <h2 id="honeycomb-gpl-modules">Honeycomb GPL Modules</h2> <p>For Honeycomb, the entire platform source code isn't available. @@ -1872,10 +1926,11 @@ commands work for 3.0_r1.1, and using other versions can be done by switching the git checkout paramater, and if necessary the -m parameter in repo init. The git checkout command outputs an error for the non-GPL projects, where it can't find the tag in question.</p> -<pre><code>$ repo init -b master -m base-for-3.0-gpl.xml -$ repo sync -$ repo forall -c git checkout android-3.0_r1.1 -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">repo init -b master -m base-for-3.0-gpl.xml</code> +<code class="devsite-terminal">repo sync</code> +<code class="devsite-terminal">repo forall -c git checkout android-3.0_r1.1</code> +</pre> </body> diff --git a/en/source/building-kernels.html b/en/source/building-kernels.html index 5bdd796b..1ddfe4fa 100644 --- a/en/source/building-kernels.html +++ b/en/source/building-kernels.html @@ -176,12 +176,13 @@ sources.</p> <p>After determining the device project you want to work with, view the git log for the kernel binary. Device projects use the form -<code>device/<vendor>/<name></code>.</p> +<code>device/<var>VENDOR</var>/<var>NAME</var></code>.</p> -<pre><code>$ git clone https://android.googlesource.com/kernel/hikey-linaro -$ cd hikey-linaro -$ git log --max-count=1 kernel -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">git clone https://android.googlesource.com/kernel/hikey-linaro</code> +<code class="devsite-terminal">cd hikey-linaro</code> +<code class="devsite-terminal">git log --max-count=1 kernel</code> +</pre> <p>The commit message for the kernel binary contains a partial git log of the kernel sources used to build the binary. The first entry in the log is the most @@ -193,61 +194,61 @@ as you will need it in a later step.</p> <p>To determine the kernel version used in a system image, run the following command against the kernel file:</p> -<pre><code>$ dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version' -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version' +</pre> <p>For Nexus 5 (hammerhead), the command is:</p> -<pre><code>$ dd if=zImage-dtb bs=1 skip=$(LC_ALL=C od -Ad -x -w2 zImage-dtb | grep 8b1f | cut -d ' ' -f1 | head -1) | zgrep -a 'Linux version' -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +dd if=zImage-dtb bs=1 skip=$(LC_ALL=C od -Ad -x -w2 zImage-dtb | grep 8b1f | cut -d ' ' -f1 | head -1) | zgrep -a 'Linux version' +</pre> <h2 id="downloading-sources">Downloading sources</h2> <p>Download the source for the kernel you want to build using the appropriate -<code>git clone</code> command:</p> - -<pre><code>$ git clone https://android.googlesource.com/kernel/common.git -$ git clone https://android.googlesource.com/kernel/hikey-linaro -$ git clone https://android.googlesource.com/kernel/x86_64.git -$ git clone https://android.googlesource.com/kernel/exynos.git -$ git clone https://android.googlesource.com/kernel/goldfish.git -$ git clone https://android.googlesource.com/kernel/msm.git -$ git clone https://android.googlesource.com/kernel/omap.git -$ git clone https://android.googlesource.com/kernel/samsung.git -$ git clone https://android.googlesource.com/kernel/tegra.git -</code></pre> - -<ul> -<li>The <code>goldfish</code> project contains the kernel sources for the -emulated platforms.</li> -<li>The <code>msm</code> project has the sources for ADP1, ADP2, Nexus One, -Nexus 4, Nexus 5, Nexus 6, Nexus 5X, Nexus 6P, Nexus 7 (2013), Pixel, -and Pixel XL, and can be used -as a starting point for work on Qualcomm MSM chipsets.</li> -<li>The <code>omap</code> project is used for PandaBoard and Galaxy Nexus, -and can be used as a starting point for work on TI OMAP chipsets.</li> -<li>The <code>samsung</code> project is used for Nexus S, and can be used as a -starting point for work on Samsung Hummingbird chipsets.</li> -<li>The <code>tegra</code> project is for Xoom, Nexus 7 (2012), Nexus 9, -and can be used as a starting point for work on NVIDIA Tegra chipsets.</li> -<li>The <code>exynos</code> project has the kernel sources for Nexus 10, -and can be used as a starting point for work on Samsung Exynos chipsets.</li> -<li>The <code>x86_64</code> project has the kernel sources for Nexus Player, -and can be used as a starting point for work on Intel x86_64 chipsets.</li> -<li>The <code>hikey-linaro</code> project is used for HiKey reference boards, -and can be used as a starting point for work on HiSilicon 620 chipsets.</li> -</ul> +<code>git clone</code> command. For example, the following command clones the <code>common</code> kernel, a generic, customizable kernel:</p> +<pre class="devsite-terminal devsite-click-to-copy"> +git clone https://android.googlesource.com/kernel/common +</pre> + +<p>A full list of the kernel projects can be found in the <a href="https://android.googlesource.com/kernel">Kernel</a> directory. Below are some of the commonly used kernels and their respective <code>git clone</code> commands.</p> + +<p>The <code>exynos</code> project has the kernel sources for Nexus 10, and can be used as a starting point for work on Samsung Exynos chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/exynos</pre> + +<p>The <code>goldfish</code> project contains the kernel sources for the emulated platforms.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/goldfish</pre> + +<p>The <code>hikey-linaro</code> project is used for HiKey reference boards, and can be used as a starting point for work on HiSilicon 620 chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/hikey-linaro</pre> + +<p>The <code>msm</code> project has the sources for ADP1, ADP2, Nexus One, Nexus 4, Nexus 5, Nexus 6, Nexus 5X, Nexus 6P, Nexus 7 (2013), Pixel, and Pixel XL, and can be used as a starting point for work on Qualcomm MSM chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/msm</pre> + +<p>The <code>omap</code> project is used for PandaBoard and Galaxy Nexus, and can be used as a starting point for work on TI OMAP chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/omap</pre> + +<p>The <code>samsung</code> project is used for Nexus S, and can be used as a starting point for work on Samsung Hummingbird chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/samsung</pre> + +<p>The <code>tegra</code> project is for Xoom, Nexus 7 (2012), Nexus 9, and can be used as a starting point for work on NVIDIA Tegra chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/tegra</pre> + +<p>The <code>x86_64</code> project has the kernel sources for Nexus Player, and can be used as a starting point for work on Intel x86_64 chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/x86_64</pre> <h2 id="building">Building the kernel</h2> <p>When you know the last commit message for a kernel and have successfully downloaded the kernel source and prebuilt gcc, you are ready to build the kernel. The following build commands use the hikey kernel:</p> -<pre><code>$ export ARCH=arm64 -$ export CROSS_COMPILE=aarch64-linux-android- -$ cd hikey-linaro -$ git checkout -b android-hikey-linaro-4.1 origin/android-hikey-linaro-4.1 -$ make hikey_defconfig -$ make -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">export ARCH=arm64</code> +<code class="devsite-terminal">export CROSS_COMPILE=aarch64-linux-android-</code> +<code class="devsite-terminal">cd hikey-linaro</code> +<code class="devsite-terminal">git checkout -b android-hikey-linaro-4.1 origin/android-hikey-linaro-4.1</code> +<code class="devsite-terminal">make hikey_defconfig</code> +<code class="devsite-terminal">make</code> +</pre> <p>To build a different kernel, simply replace <code>hikey-linaro</code> with the name of the kernel you want to build.</p> @@ -264,12 +265,13 @@ command line that builds a boot image). This variable is supported by all devices as it is set up via <code>device/common/populate-new-device.sh</code>. For example:</p> -<pre><code>$ export TARGET_PREBUILT_KERNEL=$your_kernel_path/arch/arm/boot/zImage-dtb -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +export TARGET_PREBUILT_KERNEL=$your_kernel_path/arch/arm/boot/zImage-dtb +</pre> <p class="note"><strong>Note:</strong> Kernel names differ by device. To locate the correct filename for your kernel, refer to -<code>device/<vendor>/<name></code> in the kernel source.</p> +<code>device/<var>VENDOR</var>/<var>NAME</var></code> in the kernel source.</p> </body> </html> diff --git a/en/source/building.html b/en/source/building.html index 34aa0db0..aada660b 100644 --- a/en/source/building.html +++ b/en/source/building.html @@ -63,24 +63,28 @@ will be installed in the <code>vendor/</code> hierarchy of the source tree.</p> <p>To ensure the newly installed binaries are properly taken into account after being extracted, delete the existing output of any previous build using:</p> -<pre><code>$ make clobber -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +make clobber +</pre> <h2 id="initialize">Set up environment</h2> <p>Initialize the environment with the <code>envsetup.sh</code> script. Note that replacing <code>source</code> with <code>.</code> (a single dot) saves a few characters, and the short form is more commonly used in documentation.</p> -<pre><code>$ source build/envsetup.sh -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +source build/envsetup.sh +</pre> <p>or</p> -<pre><code>$ . build/envsetup.sh -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +. build/envsetup.sh +</pre> <h2 id="choose-a-target">Choose a target</h2> <p>Choose which target to build with <code>lunch</code>. The exact configuration can be passed as an argument. For example, the following command:</p> -<pre><code>$ lunch aosp_arm-eng -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +lunch aosp_arm-eng +</pre> <p>refers to a complete build for the emulator, with all debugging enabled.</p> <p>If run with no arguments <code>lunch</code> will prompt you to choose a target from the menu.</p> @@ -127,8 +131,8 @@ dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between <code>make -j16</code> and <code>make -j32</code>.</p> -<pre> -$ make -j4 +<pre class="devsite-terminal devsite-click-to-copy"> +make -j4 </pre> <h2 id="run-it">Run it!</h2> @@ -156,8 +160,8 @@ instructions.</p> <p>The emulator is added to your path automatically by the build process. To run the emulator, type:</p> -<pre> -$ emulator +<pre class="devsite-terminal devsite-click-to-copy"> +emulator </pre> <h2 id="troubleshooting-common-build-errors">Troubleshooting Common Build Errors</h2> @@ -194,8 +198,8 @@ correct JDK to the beginning of your PATH or remove the problematic JDK.</li> unfortunately incompatible with Python 3. In order to use repo, please install Python 2.x:</p> -<pre> -$ apt-get install python +<pre class="devsite-terminal devsite-click-to-copy"> +apt-get install python </pre> <h3 id="case-insensitive-filesystem">Case Insensitive Filesystem</h3> diff --git a/en/source/developing.html b/en/source/developing.html index b990e250..0535776b 100644 --- a/en/source/developing.html +++ b/en/source/developing.html @@ -70,96 +70,114 @@ For information about using repo to download source, see <a href="/source/downlo <a href="/source/using-repo.html">Using Repo</a>.</p> <h2 id="synchronizing-your-client">Synchronizing your client</h2> <p>To synchronize the files for all available projects: </p> -<pre><code>$ repo sync -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo sync +</pre> <p>To synchronize the files for selected projects:</p> -<pre><code>$ repo sync PROJECT0 PROJECT1 PROJECT2 ... -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo sync <var>PROJECT0 PROJECT1 ... PROJECTN</var> +</pre> <h2 id="creating-topic-branches">Creating topic branches</h2> <p>Start a topic branch in your local work environment whenever you begin a change, for example when you begin work on a bug or new feature. A topic branch is not a copy of the original files; it is a pointer to a particular commit. This makes creating local branches and switching among them a light-weight operation. By using branches, you can isolate one aspect of your work from the others. For an interesting article about using topic branches, see <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/separating-topic-branches.txt">Separating topic branches</a>.</p> <p>To start a topic branch using Repo, navigate into the project to be modified and issue: </p> -<pre><code>$ repo start BRANCH_NAME . -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo start <var>BRANCH_NAME</var> . +</pre> <p>Please note, the period represents the project in the current working directory. To verify your new branch was created:</p> -<pre><code>$ repo status . -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo status . +</pre> <h2 id="using-topic-branches">Using topic branches</h2> <p>To assign the branch to a particular project:</p> -<pre><code>$ repo start BRANCH_NAME PROJECT_NAME -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo start <var>BRANCH_NAME PROJECT_NAME</var> +</pre> <p>See <a href="https://android.googlesource.com/">android.googlesource.com</a> for a list of all projects. Again, if you've already navigated into a particular project directory, you may simply pass a period to represent the current project.</p> <p>To switch to another branch that you have created in your local work environment:</p> -<pre><code>$ git checkout BRANCH_NAME -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +git checkout <var>BRANCH_NAME</var> +</pre> <p>To see a list of existing branches:</p> -<pre><code>$ git branch -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +git branch +</pre> <p>or </p> -<pre><code>$ repo branches -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo branches +</pre> <p>The name of the current branch will be preceded by an asterisk.</p> <p class="note"><strong>Note:</strong> A bug might be causing <code>repo sync</code> to reset the local topic branch. If <code>git branch</code> shows * (no branch) after you run <code>repo sync</code>, then run <code>git checkout</code> again.</p> <h2 id="staging-files">Staging files</h2> <p>By default, Git notices but does not track the changes you make in a project. In order to tell git to preserve your changes, you must mark them for inclusion in a commit. This is also called "staging". </p> <p>You can stage your changes by running</p> -<pre><code>git add -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +git add +</pre> <p>which accepts as arguments any files or directories within the project directory. Despite the name, <code>git add</code> does not simply add files to the git repository; it can also be used to stage file modifications and deletions.</p> <h2 id="viewing-client-status">Viewing client status</h2> <p>To list the state of your files:</p> -<pre><code>$ repo status -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo status +</pre> <p>To see uncommitted edits:</p> -<pre><code>$ repo diff -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo diff +</pre> <p>The <code>repo diff</code> command shows every local edit that you have made that would <em>not</em> go into the commit, if you were to commit right now. To see every edit that would go into the commit if you were to commit right now, you need a Git command, <code>git diff</code>. Before running it, be sure you are in the project directory:</p> -<pre><code>$ cd ~/WORKING_DIRECTORY/PROJECT -$ git diff --cached -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">cd <var>~/WORKING_DIRECTORY/PROJECT</var></code> +<code class="devsite-terminal">git diff --cached</code> +</pre> <h2 id="committing-changes">Committing changes</h2> <p>A commit is the basic unit of revision control in git, consisting of a snapshot of directory structure and file contents for the entire project. Creating a commit in git is as simple as typing</p> -<pre><code>git commit -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +git commit +</pre> <p>You will be prompted for a commit message in your favorite editor; please provide a helpful message for any changes you submit to the AOSP. If you do not add a log message, the commit will be aborted. </p> <h2 id="uploading-changes-to-gerrit">Uploading changes to Gerrit</h2> <p>Before uploading, update to the latest revisions:</p> -<pre><code>repo sync -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo sync +</pre> <p>Next run</p> -<pre><code>repo upload -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo upload +</pre> <p>This will list the changes you have committed and prompt you to select which branches to upload to the review server. If there is only one branch, you will see a simple <code>y/n</code> prompt.</p> <h2 id="recovering-sync-conflicts">Recovering sync conflicts</h2> <p>If a <code>repo sync</code> shows sync conflicts:</p> <ul> -<li>View the files that are unmerged (status code = U).</li> -<li>Edit the conflict regions as necessary.</li> -<li> -<p>Change into the relevant project directory, run <code>git add</code> and <code>git commit</code> for the files in question, and then "rebase" the changes. For example:</p> -<pre><code>$ git add . -$ git commit -$ git rebase --continue -</code></pre> -</li> -<li> -<p>When the rebase is complete start the entire sync again:</p> -<pre><code>$ repo sync PROJECT0 PROJECT1 ... PROJECTN -</code></pre> -</li> + <li>View the files that are unmerged (status code = U).</li> + <li>Edit the conflict regions as necessary.</li> + <li><p>Change into the relevant project directory, run <code>git add</code> and <code>git commit</code> for the files in question, and then "rebase" the changes. For example:</p> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">git add .</code> +<code class="devsite-terminal">git commit</code> +<code class="devsite-terminal">git rebase --continue</code> +</pre> + </li> + <li><p>When the rebase is complete start the entire sync again:</p> +<pre class="devsite-terminal devsite-click-to-copy">repo sync <var>PROJECT0 PROJECT1 ... PROJECTN</var></pre> + </li> </ul> + <h2 id="cleaning-up-your-client-files">Cleaning up your client files</h2> <p>To update your local working directory after changes are merged in Gerrit:</p> -<pre><code>$ repo sync -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo sync +</pre> <p>To safely remove stale topic branches: </p> -<pre><code>$ repo prune -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo prune +</pre> + <h2 id="deleting-a-client">Deleting a client</h2> <p>Because all state information is stored in your client, you only need to delete the directory from your filesystem:</p> -<pre><code>$ rm -rf WORKING_DIRECTORY -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +rm -rf <var>WORKING_DIRECTORY</var> +</pre> <p>Deleting a client will <em>permanently delete</em> any changes you have not yet uploaded for review.</p> <h2 id="git-and-repo-cheatsheet">Git and Repo cheatsheet</h2> <img src="/images/git-repo-1.png" alt="list of basic git and repo commands" id="figure2" /> diff --git a/en/source/devices.html b/en/source/devices.html index 4970ac0e..0e1b3cb3 100644 --- a/en/source/devices.html +++ b/en/source/devices.html @@ -73,65 +73,85 @@ HiKey960 board.</p> <h3 id="960userspace">Compiling userspace</h3> <ol> -<li>Download the Android source tree: -<pre>$ repo init -u <a href="https://android.googlesource.com/platform/manifest">https://android.googlesource.com/platform/manifest</a> -b master -$ repo sync -j24</pre></li> -<li>Download and extract binaries into the Android source tree: -<pre>$ wget https://dl.google.com/dl/android/aosp/arm-hikey960-NOU-7ad3cccc.tgz -$ tar xzf arm-hikey960-NOU-7ad3cccc.tgz -$ ./extract-arm-hikey960.sh</pre></li> -<li>Build: -<pre>$ . ./build/envsetup.sh -$ lunch hikey960-userdebug -$ make -j32</pre></li> + <li>Download the Android source tree: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">repo init -u <a href="https://android.googlesource.com/platform/manifest">https://android.googlesource.com/platform/manifest</a> -b master</code> +<code class="devsite-terminal">repo sync -j24</code> +</pre> + </li> + <li>Download and extract binaries into the Android source tree: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">wget https://dl.google.com/dl/android/aosp/arm-hikey960-NOU-7ad3cccc.tgz</code> +<code class="devsite-terminal">tar xzf arm-hikey960-NOU-7ad3cccc.tgz</code> +<code class="devsite-terimnal">./extract-arm-hikey960.sh</code> +</pre> + </li> + <li>Build: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">. ./build/envsetup.sh</code> +<code class="devsite-terminal">lunch hikey960-userdebug</code> +<code class="devsite-terminal">make -j32</code> +</pre> + </li> </ol> <h3 id="960fastboot">Installing initial images</h3> <ol> -<li>Select fastboot mode turning ON switch 1 and 3 (for details, refer to the + <li>Select fastboot mode turning ON switch 1 and 3 (for details, refer to the HiKey960 user guide).</li> -<li>Power the board.</li> -<li>Flash initial images: -<pre>$ cd device/linaro/hikey/installer/hikey960 -$ ./flash-all.sh</pre></li> -<li>Turn OFF switch 3 and power cycle the board.</li> + <li>Power the board.</li> + <li>Flash initial images: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">cd device/linaro/hikey/installer/hikey960</code> +<code class="devsite-terminal">./flash-all.sh</code> +</pre> + </li> + <li>Turn OFF switch 3 and power cycle the board.</li> </ol> <h3 id="960images">Flashing images</h3> <ol> -<li>Enter fastboot mode by turning ON switch 1 and 3.</li> -<li>Flash images by running the following commands: -<pre>$ fastboot flash boot out/target/product/hikey960/boot.img -$ fastboot flash dts out/target/product/hikey960/dt.img -$ fastboot flash system out/target/product/hikey960/system.img -$ fastboot flash cache out/target/product/hikey960/cache.img -$ fastboot flash userdata out/target/product/hikey960/userdata.img</pre> -</li> -<li>Turn OFF switch 3 and power cycle the board.</li> + <li>Enter fastboot mode by turning ON switch 1 and 3.</li> + <li>Flash images by running the following commands: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">fastboot flash boot out/target/product/hikey960/boot.img</code> +<code class="devsite-terminal">fastboot flash dts out/target/product/hikey960/dt.img</code> +<code class="devsite-terminal">fastboot flash system out/target/product/hikey960/system.img</code> +<code class="devsite-terminal">fastboot flash cache out/target/product/hikey960/cache.img</code> +<code class="devsite-terminal">fastboot flash userdata out/target/product/hikey960/userdata.img</code> +</pre> + </li> + <li>Turn OFF switch 3 and power cycle the board.</li> </ol> <h3 id="960kernel">Building the kernel</h3> <ol> -<li>Run the following commands: -<pre>$ git clone <a href="https://android.googlesource.com/kernel/hikey-linaro">https://android.googlesource.com/kernel/hikey-linaro</a> -$ cd hikey-linaro -$ git checkout -b android-hikey-linaro-4.4 origin/android-hikey-linaro-4.4 -$ make ARCH=arm64 hikey960_defconfig -$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24</pre></li> -<li>Update the kernel in the boot image. -<ul> -<li>Copy hi3660-hikey960.dtb -(<code>arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb</code>) to the -hikey-kernel directory as file hi3660-hikey960.dtb.</li> -<li>Copy the Image file <code>(arch/arm64/boot/Image.gz</code>) to the -hikey-kernel directory as file Image.gz-hikey960.</li></ul> -<li>Make the boot image: -<pre>$ make bootimage -j24</pre></li> + <li>Run the following commands: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">git clone <a href="https://android.googlesource.com/kernel/hikey-linaro">https://android.googlesource.com/kernel/hikey-linaro</a></code> +<code class="devsite-terminal">cd hikey-linaro</code> +<code class="devsite-terminal">git checkout -b android-hikey-linaro-4.4 origin/android-hikey-linaro-4.4</code> +<code class="devsite-terminal">make ARCH=arm64 hikey960_defconfig</code> +<code class="devsite-terminal">make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24</code> +</pre> + </li> + <li>Update the kernel in the boot image. + <ul> + <li>Copy hi3660-hikey960.dtb (<code>arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb</code>) to the hikey-kernel directory as file hi3660-hikey960.dtb.</li> + <li>Copy the Image file <code>(arch/arm64/boot/Image.gz</code>) to the hikey-kernel directory as file Image.gz-hikey960.</li> + </ul> + <li>Make the boot image: +<pre class="devsite-terminal devsite-click-to-copy"> +make bootimage -j24 +</pre> + </li> </ol> <h3 id="960serial">Setting serial number</h3> <p>To set random serial number, run: -<pre>$ fastboot getvar nve:SN@<em>16-digit-number</em></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +fastboot getvar nve:SN@<var>16_DIGIT_NUMBER</var> +</pre> <p>Bootloader exports the generated serial number to kernel via <code>androidboot.serialno=</code>. @@ -167,19 +187,31 @@ board.</p> <h3 id="620userspace">Compiling userspace</h3> <ol> -<li>Download the Android source tree: -<pre>$ repo init -u <a href="https://android.googlesource.com/platform/manifest">https://android.googlesource.com/platform/manifest</a> -b master -$ repo sync -j24</pre></li> -<li>Download and extract HDMI binaries into the Android source tree: -<pre>$ wget <a href="https://dl.google.com/dl/android/aosp/linaro-hikey-20170523-4b9ebaff.tgz">https://dl.google.com/dl/android/aosp/linaro-hikey-20170523-4b9ebaff.tgz</a> -$ tar xzf linaro-hikey-20170523-4b9ebaff.tgz -$ ./extract-linaro-hikey.sh</pre></li> -<li>Install mcopy utility: -<pre>$ apt-get install mtools</pre></li> -<li>Build: -<pre>$ . ./build/envsetup.sh -$ lunch hikey-userdebug -$ make -j32</pre></li> + <li>Download the Android source tree: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">repo init -u <a href="https://android.googlesource.com/platform/manifest">https://android.googlesource.com/platform/manifest</a> -b master</code> +<code class="devsite-terminal">repo sync -j24</code> +</pre> + </li> + <li>Download and extract HDMI binaries into the Android source tree: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">wget <a href="https://dl.google.com/dl/android/aosp/linaro-hikey-20170523-4b9ebaff.tgz">https://dl.google.com/dl/android/aosp/linaro-hikey-20170523-4b9ebaff.tgz</a></code> +<code class="devsite-terminal">tar xzf linaro-hikey-20170523-4b9ebaff.tgz</code> +<code class="devsite-terminal">./extract-linaro-hikey.sh</code> +</pre> + </li> + <li>Install mcopy utility: +<pre class="devsite-terminal devsite-click-to-copy"> +apt-get install mtools +</pre> + </li> + <li>Build: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">. ./build/envsetup.sh</code> +<code class="devsite-terminal">lunch hikey-userdebug</code> +<code class="devsite-terminal">make -j32</code> +</pre> + </li> </ol> <p class="note"><strong>Note:</strong> For 4GB eMMC, instead of <code>$ make -j32</code> @@ -187,44 +219,55 @@ use: <code>$ make -j32 TARGET_USERDATAIMAGE_4GB=true</code>.</p> <h3 id="620fastboot">Installing initial fastboot and ptable</h3> <ol> -<li>Select special bootloader mode by linking J15 1-2 and 3-4 pins (for details, + <li>Select special bootloader mode by linking J15 1-2 and 3-4 pins (for details, refer to the <a href="https://www.96boards.org/wp-content/uploads/2015/02/HiKey_User_Guide_Rev0.2.pdf">HiKey user guide</a>).</li> -<li>Connect USB to PC to get ttyUSB device (ex: <code>/dev/ttyUSB1</code>).</li> -<li>Power the board: -<pre>$ cd device/linaro/hikey/installer/hikey -$ ./flash-all.sh /dev/ttyUSB1 [4g]</pre></li> -<li>Remove jumper 3-4 and power the board.</li> + <li>Connect USB to PC to get ttyUSB device (ex: <code>/dev/ttyUSB1</code>).</li> + <li>Power the board: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">cd device/linaro/hikey/installer/hikey</code> +<code class="devsite-terminal">./flash-all.sh /dev/ttyUSB1 [4g]</code> +</pre> + </li> + <li>Remove jumper 3-4 and power the board.</li> </ol> <h3 id="620images">Flashing images</h3> <ol> -<li>Enter fastboot mode by linking J15 1-2 and 5-6 pins.</li> -<li>Run the following commands: -<pre>$ fastboot flash boot out/target/product/hikey/boot.img -$ fastboot flash -w system out/target/product/hikey/system.img</pre></li> -<li>Remove jumper 5-6 and power the board.</li> + <li>Enter fastboot mode by linking J15 1-2 and 5-6 pins.</li> + <li>Run the following commands: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">fastboot flash boot out/target/product/hikey/boot.img</code> +<code class="devsite-terminal">fastboot flash -w system out/target/product/hikey/system.img</code> +</pre> + </li> + <li>Remove jumper 5-6 and power the board.</li> </ol> <h3 id="620kernel">Building the kernel</h3> <ol> -<li>Run the following commands: -<pre>$ git clone <a href="https://android.googlesource.com/kernel/hikey-linaro">https://android.googlesource.com/kernel/hikey-linaro</a> -$ cd hikey-linaro -$ git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9 -$ make ARCH=arm64 hikey_defconfig -$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24</pre></li> -<li>Copy output to the hikey kernel directory -(<code>/kernel/hikey-linaro</code>): -<ul> -<li>Copy hi6220-hikey.dtb -(<code>arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb</code>) to the + <li>Run the following commands: +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">git clone <a href="https://android.googlesource.com/kernel/hikey-linaro">https://android.googlesource.com/kernel/hikey-linaro</a></code> +<code class="devsite-terminal">cd hikey-linaro</code> +<code class="devsite-terminal">git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9</code> +<code class="devsite-terminal">make ARCH=arm64 hikey_defconfig</code> +<code class="devsite-terminal">make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24</code> +</pre> + </li> + <li>Copy output to the hikey kernel directory (<code>/kernel/hikey-linaro</code>): + <ul> + <li>Copy hi6220-hikey.dtb (<code>arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb</code>) to the hikey-kernel directory as file hi6220-hikey.dtb-4.9.</li> -<li>Copy the Image file <code>(arch/arm64/boot/Image-dtb</code>) to the -hikey-kernel directory as file Image-dtb-4.9.</li></ul> -<li>Make the boot image: -<pre>$ make bootimage -j24</pre></li> + <li>Copy the Image file <code>(arch/arm64/boot/Image-dtb</code>) to the +hikey-kernel directory as file Image-dtb-4.9.</li> + </ul> + <li>Make the boot image: +<pre class="devsite-terminal devsite-click-to-copy"> +make bootimage -j24 +</pre> + </li> </ol> <h3 id="620resolution">Setting monitor resolution</h3> diff --git a/en/source/downloading.html b/en/source/downloading.html index 83de272b..1821acad 100644 --- a/en/source/downloading.html +++ b/en/source/downloading.html @@ -49,19 +49,18 @@ Make sure you have a bin/ directory in your home directory and that it is included in your path: </p> - <pre> -<code>$ mkdir ~/bin -$ PATH=~/bin:$PATH -</code> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">mkdir ~/bin</code> +<code class="devsite-terminal">PATH=~/bin:$PATH</code> </pre> </li> <li> <p> Download the Repo tool and ensure that it is executable: </p> - <pre> -$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo -$ chmod a+x ~/bin/repo +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo</code> +<code class="devsite-terminal">chmod a+x ~/bin/repo</code> </pre> </li> </ol> @@ -86,9 +85,9 @@ $ chmod a+x ~/bin/repo Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like: </p> -<pre> -$ mkdir WORKING_DIRECTORY -$ cd WORKING_DIRECTORY +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">mkdir WORKING_DIRECTORY</code> +<code class="devsite-terminal">cd WORKING_DIRECTORY</code> </pre> </li> <li> @@ -99,12 +98,11 @@ $ cd WORKING_DIRECTORY address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions. </p> -<pre> -$ git config --global user.name "Your Name" -$ git config --global user.email "you@example.com" +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">git config --global user.name "Your Name"</code> +<code class="devsite-terminal">git config --global user.email "you@example.com"</code> </pre> </li> - </li> <li> <p> Run <code>repo init</code> to bring down the latest version of Repo with all its most @@ -112,14 +110,14 @@ $ git config --global user.email "you@example.com" various repositories included in the Android source will be placed within your working directory. </p> -<pre> -$ repo init -u https://android.googlesource.com/platform/manifest +<pre class="devsite-terminal devsite-click-to-copy"> +repo init -u https://android.googlesource.com/platform/manifest </pre> <p> To check out a branch other than "master", specify it with <code>-b</code>. For a list of branches, see <a href="build-numbers.html#source-code-tags-and-builds">Source Code Tags and Builds</a>. </p> -<pre> -$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1 +<pre class="devsite-terminal devsite-click-to-copy"> +repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1 </pre> </li> </ol> @@ -135,7 +133,7 @@ $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0 To pull down the Android source tree to your working directory from the repositories as specified in the default manifest, run </p> -<pre>$ repo sync</pre> +<pre class="devsite-terminal devsite-click-to-copy">repo sync</pre> <p> The Android source files will be located in your working directory under their project names. The initial sync operation will take an hour or more to complete. For more about <code>repo @@ -168,8 +166,8 @@ $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0 <code>/a/</code> directory prefix triggers mandatory authentication. You can convert an existing client to use mandatory authentication with the following command: </p> -<pre> -$ repo init -u https://android.googlesource.com/a/platform/manifest +<pre class="devsite-terminal devsite-click-to-copy"> +repo init -u https://android.googlesource.com/a/platform/manifest </pre> <h2 id="troubleshooting-network-issues"> Troubleshooting network issues @@ -178,9 +176,9 @@ $ repo init -u https://android.googlesource.com/a/platform/manifest When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo: </p> -<pre> -$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port> -$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port></code> +<code class="devsite-terminal">export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port></code> </pre> <p> More rarely, Linux clients experience connectivity issues, getting stuck in the middle of @@ -188,9 +186,9 @@ $ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<pro settings of the TCP/IP stack and using non-parallel commands can improve the situation. You need root access to modify the TCP setting: </p> -<pre> -$ sudo sysctl -w net.ipv4.tcp_window_scaling=0 -$ repo sync -j1 +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">sudo sysctl -w net.ipv4.tcp_window_scaling=0</code> +<code class="devsite-terminal">repo sync -j1</code> </pre> <h2 id="using-a-local-mirror"> Using a local mirror @@ -206,30 +204,31 @@ $ repo sync -j1 The first step is to create and sync the mirror itself. Notice the <code>--mirror</code> flag, which can be specified only when creating a new client: </p> -<pre> -$ mkdir -p /usr/local/aosp/mirror -$ cd /usr/local/aosp/mirror -$ repo init -u https://android.googlesource.com/mirror/manifest --mirror -$ repo sync +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">mkdir -p /usr/local/aosp/mirror</code> +<code class="devsite-terminal">cd /usr/local/aosp/mirror</code> +<code class="devsite-terminal">repo init -u https://android.googlesource.com/mirror/manifest --mirror</code> +<code class="devsite-terminal">repo sync</code> </pre> <p> Once the mirror is synced, new clients can be created from it. Note that it's important to specify an absolute path: </p> -<pre>$ mkdir -p /usr/local/aosp/master -$ cd /usr/local/aosp/master -$ repo init -u /usr/local/aosp/mirror/platform/manifest.git -$ repo sync +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">mkdir -p /usr/local/aosp/master</code> +<code class="devsite-terminal">cd /usr/local/aosp/master</code> +<code class="devsite-terminal">repo init -u /usr/local/aosp/mirror/platform/manifest.git</code> +<code class="devsite-terminal">repo sync</code> </pre> <p> Finally, to sync a client against the server, the mirror needs to be synced against the server, then the client against the mirror: </p> -<pre> -$ cd /usr/local/aosp/mirror -$ repo sync -$ cd /usr/local/aosp/master -$ repo sync +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">cd /usr/local/aosp/mirror</code> +<code class="devsite-terminal">repo sync</code> +<code class="devsite-terminal">cd /usr/local/aosp/master</code> +<code class="devsite-terminal">repo sync</code> </pre> <p> It's possible to store the mirror on a LAN server and to access it over NFS, SSH or Git. It's @@ -243,14 +242,14 @@ $ repo sync Load the following public key into your GnuPG key database. The key is used to sign annotated tags that represent releases. </p> -<pre> -$ gpg --import +<pre class="devsite-terminal devsite-click-to-copy"> +gpg --import </pre> <p> - Copy and paste the key(s) below, then enter EOF (Ctrl-D) to end the input and process the + Copy and paste the key below, then enter EOF (Ctrl-D) to end the input and process the keys. </p> -<pre> +<pre class="devsite-click-to-copy"> -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.2.2 (GNU/Linux) @@ -285,8 +284,8 @@ EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM= <p> After importing the keys, you can verify any tag with </p> -<pre> -$ git tag -v TAG_NAME +<pre class="devsite-terminal devsite-click-to-copy"> +git tag -v TAG_NAME </pre> <p> If you haven't <a href="initializing.html#ccache">set up ccache</a> yet, now would be a good diff --git a/en/source/initializing.html b/en/source/initializing.html index b4f7b594..7e87f5e1 100644 --- a/en/source/initializing.html +++ b/en/source/initializing.html @@ -61,9 +61,9 @@ versions.</p> <h4 id="for-ubuntu-15-04">For Ubuntu >= 15.04</h4> <p>Run the following:</p> -<pre> -$ sudo apt-get update -$ sudo apt-get install openjdk-8-jdk +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">sudo apt-get update</code> +<code class="devsite-terminal">sudo apt-get install openjdk-8-jdk</code> </pre> <h4 id="for-ubuntu-14-04">For Ubuntu LTS 14.04</h4> @@ -91,23 +91,23 @@ with SHA256 <code>6e47215cf6205aa829e6a0a64985075bd29d1f428a4006a80c9db371c2fc3c <p>Optionally, confirm the checksums of the downloaded files against the SHA256 string listed with each package above.</p> <p>For example, with the <code>sha256sum</code> tool:</p> -<pre> -$ sha256sum {downloaded.deb file} +<pre class="devsite-terminal devsite-click-to-copy"> +sha256sum {downloaded.deb file} </pre> </li> <li> <p>Install the packages:</p> -<pre> -$ sudo apt-get update +<pre class="devsite-terminal devsite-click-to-copy"> +sudo apt-get update </pre> <p>Run <code>dpkg</code> for each of the .deb files you downloaded. It may produce errors due to missing dependencies:</p> -<pre> -$ sudo dpkg -i {downloaded.deb file} +<pre class="devsite-terminal devsite-click-to-copy"> +sudo dpkg -i {downloaded.deb file} </pre> <p>To fix missing dependencies:</p> -<pre> -$ sudo apt-get -f install +<pre class="devsite-terminal devsite-click-to-copy"> +sudo apt-get -f install </pre> </li> </ol> @@ -116,9 +116,9 @@ $ sudo apt-get -f install <p>Optionally, for the Ubuntu versions above update the default Java version by running:</p> -<pre> -$ sudo update-alternatives --config java -$ sudo update-alternatives --config javac +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">sudo update-alternatives --config java</code> +<code class="devsite-terminal">sudo update-alternatives --config javac</code> </pre> <p>If, during a build, you encounter version errors for Java, set its @@ -129,11 +129,8 @@ Java Version</a> section.</p> <p>You will need a 64-bit version of Ubuntu. Ubuntu 14.04 is recommended.</p> -<pre> -$ sudo apt-get install git-core gnupg flex bison gperf build-essential \ - zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \ - lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \ - libgl1-mesa-dev libxml2-utils xsltproc unzip +<pre class="devsite-terminal devsite-click-to-copy"> +sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip </pre> <p class="note"><strong>Note:</strong> To use SELinux tools for policy @@ -149,13 +146,9 @@ package.</p> <p>You may use Ubuntu 12.04 to build older versions of Android. Version 12.04 is not supported on master or recent releases.</p> -<pre> -$ sudo apt-get install git gnupg flex bison gperf build-essential \ - zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ - libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \ - libgl1-mesa-dev g++-multilib mingw32 tofrodos \ - python-markdown libxml2-utils xsltproc zlib1g-dev:i386 -$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386</code> +<code class="devsite-terminal">sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so</code> </pre> <h3 id="installing-required-packages-ubuntu-1004-1110">Installing required @@ -163,24 +156,20 @@ packages (Ubuntu 10.04 -- 11.10)</h3> <p>Building on Ubuntu 10.04-11.10 is no longer supported, but may be useful for building older releases of AOSP.</p> -<pre> -$ sudo apt-get install git gnupg flex bison gperf build-essential \ - zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \ - x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \ - libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \ - libxml2-utils xsltproc +<pre class="devsite-terminal devsite-click-to-copy"> +sudo apt-get install git gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc </pre> <p>On Ubuntu 10.10:</p> -<pre> -$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so +<preclass="devsite-terminal devsite-click-to-copy"> +sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so </pre> <p>On Ubuntu 11.10:</p> -<pre> -$ sudo apt-get install libx11-dev:i386 +<pre class="devsite-terminal devsite-click-to-copy"> +sudo apt-get install libx11-dev:i386 </pre> <h3 id="configuring-usb-access">Configuring USB Access</h3> @@ -195,8 +184,8 @@ system needs to be configured to allow such access.</p> href="51-android.txt">51-android.txt</a> file attached to this site, modify it to include your username, and place it in the correct location:</p> -<pre> -$ wget -S -O - http://source.android.com/source/51-android.txt | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules +<pre class="devsite-terminal devsite-click-to-copy"> +wget -S -O - http://source.android.com/source/51-android.txt | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules </pre> <p>Those new rules take effect the next time a device is plugged in. @@ -219,8 +208,8 @@ in case of filesystem corruption.</p> to point to the location where your output directories will be stored.</p> -<pre> -$ export OUT_DIR_COMMON_BASE=<path-to-your-out-directory> +<pre class="devsite-terminal devsite-click-to-copy"> +export OUT_DIR_COMMON_BASE=<path-to-your-out-directory> </pre> <p>The output directory for each separate source tree will be @@ -263,8 +252,8 @@ saves space while allowing to grow later as the need arises. Be sure to select "case sensitive, journaled" as the volume format.</p> <p>You can also create it from a shell with the following command:</p> -<pre> -# hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg +<pre class="devsite-click-to-copy"> +<span class="no-select"># </span>hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg </pre> <p>This will create a <code>.dmg</code> (or possibly a @@ -274,8 +263,8 @@ the required formatting for Android development.</p> <p>If you need a larger volume later, you can also resize the sparse image with the following command:</p> -<pre> -# hdiutil resize -size <new-size-you-want>g ~/android.dmg.sparseimage +<pre class="devsite-click-to-copy"> +<span class="no-select"># </span>hdiutil resize -size <new-size-you-want>g ~/android.dmg.sparseimage </pre> <p>For a disk image named <code>android.dmg</code> stored in your home @@ -285,7 +274,7 @@ directory, you can add helper functions to your <code>~/.bash_profile</code>:</p <li> To mount the image when you execute <code>mountAndroid</code>:</p> -<pre> +<pre class="devsite-click-to-copy"> # mount the android file image function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; } </pre> @@ -297,7 +286,7 @@ function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/androi <li> <p>To unmount it when you execute <code>umountAndroid</code>:</p> -<pre> +<pre class="devsite-click-to-copy"> # unmount the android file image function umountAndroid() { hdiutil detach /Volumes/android; } </pre> @@ -318,8 +307,8 @@ use when developing various versions of Android.</p> <ol> <li> <p>Install Xcode command line tools with: -<pre> -$ xcode-select --install +<pre class="devsite-terminal devsite-click-to-copy"> +xcode-select --install </pre> <p>For older versions of Mac OS (10.8 or earlier), you need to install Xcode from @@ -337,8 +326,8 @@ href="http://www.macports.org/install.php">macports.org</a>.</p> <code>/usr/bin</code>. If not, please add the following to your <code>~/.bash_profile</code> file:</p> -<pre> -<code>export PATH=/opt/local/bin:$PATH</code> +<pre class="devsite-click-to-copy"> +export PATH=/opt/local/bin:$PATH </pre> <p class="note"><strong>Note:</strong> If you do not have a @@ -348,13 +337,13 @@ href="http://www.macports.org/install.php">macports.org</a>.</p> <li> <p>Get make, git, and GPG packages from MacPorts:</p> -<pre> -$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git gnupg +<pre class="devsite-terminal devsite-click-to-copy"> +POSIXLY_CORRECT=1 sudo port install gmake libsdl git gnupg </pre> <p>If using Mac OS X v10.4, also install bison:</p> -<pre> -$ POSIXLY_CORRECT=1 sudo port install bison +<pre class="devsite-terminal devsite-click-to-copy"> +POSIXLY_CORRECT=1 sudo port install bison </pre> </li> </ol> @@ -368,35 +357,35 @@ MacPorts with these steps:</p> <ol> <li> <p>Edit <code>/opt/local/etc/macports/sources.conf</code> and add a line that says:</p> -<pre> +<pre class="devsite-click-to-copy"> file:///Users/Shared/dports </pre> <p>above the rsync line. Then create this directory:</p> -<pre> -$ mkdir /Users/Shared/dports +<pre class="devsite-terminal devsite-click-to-copy"> +mkdir /Users/Shared/dports </pre> </li> <li> <p>In the new <code>dports</code> directory, run:</p> -<pre> -$ svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/ +<pre class="devsite-terminal devsite-click-to-copy"> +svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/ </pre> </li> <li> <p>Create a port index for your new local repository:</p> -<pre> -$ portindex /Users/Shared/dports +<pre class="devsite-terminal devsite-click-to-copy"> +portindex /Users/Shared/dports </pre> </li> <li> <p>Install the old version of gmake with:</p> -<pre> -$ sudo port install gmake @3.81 +<pre class="devsite-terminal devsite-click-to-copy"> +sudo port install gmake @3.81 </pre> </li> </ol> @@ -407,7 +396,7 @@ $ sudo port install gmake @3.81 open is too low and a highly parallel build process may exceed this limit.</p> <p>To increase the cap, add the following lines to your <code>~/.bash_profile</code>: </p> -<pre> +<pre class="devsite-click-to-copy"> # set the number of open files to be 1024 ulimit -S -n 1024 </pre> @@ -429,17 +418,17 @@ slow your builds down by making you pay for cache misses.</p> <p>To use ccache, issue these commands in the root of the source tree:</p> -<pre> -$ export USE_CCACHE=1 -$ export CCACHE_DIR=/<path_of_your_choice>/.ccache -$ prebuilts/misc/linux-x86/ccache/ccache -M 50G +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">export USE_CCACHE=1</code> +<code class="devsite-terminal">export CCACHE_DIR=/<path_of_your_choice>/.ccache</code> +<code class="devsite-terminal">prebuilts/misc/linux-x86/ccache/ccache -M 50G</code> </pre> <p>The suggested cache size is 50-100G.</p> <p>Put the following in your <code>.bashrc</code> (or equivalent):</p> -<pre> +<pre class="devsite-click-to-copy"> export USE_CCACHE=1 </pre> @@ -449,14 +438,14 @@ you will want to specify the directory in your <code>.bashrc</code> file too.</p <p>On Mac OS, you should replace <code>linux-x86</code> with <code>darwin-x86</code>:</p> -<pre> +<pre class="devsite-click-to-copy"> prebuilts/misc/darwin-x86/ccache/ccache -M 50G </pre> <p>When building Ice Cream Sandwich (4.0.x) or older, ccache is in a different location:</p> -<pre> +<pre class="devsite-click-to-copy"> prebuilt/linux-x86/ccache/ccache -M 50G </pre> @@ -464,8 +453,8 @@ prebuilt/linux-x86/ccache/ccache -M 50G <p>On Linux, you can watch ccache being used by doing the following:</p> -<pre> -$ watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s +<pre class="devsite-terminal devsite-click-to-copy"> +watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s </pre> <h2 id="next-download-the-source">Next: Download the source</h2> diff --git a/en/source/jack.html b/en/source/jack.html index 3df975c0..7c3e952d 100644 --- a/en/source/jack.html +++ b/en/source/jack.html @@ -33,7 +33,7 @@ until the replacement is available. </p> -<p>Jack is a new Android toolchain that compiles Java +<p>Jack is an Android toolchain that compiles Java source into Android dex bytecode. It replaces the previous Android toolchain, which consists of multiple tools, such as javac, ProGuard, jarjar, and dx.</p> @@ -190,9 +190,8 @@ available at <a href="http://b.android.com">http://b.android.com</a>, with the <p>In case of reproducible Jack failures, you can get a more detailed log by setting one variable, as follows:</p> -<pre class=prettyprint> -$ export ANDROID_JACK_EXTRA_ARGS="--verbose debug --sanity-checks on -D -sched.runner=single-threaded" +<pre class="devsite-terminal devsite-click-to-copy"> +export ANDROID_JACK_EXTRA_ARGS="--verbose debug --sanity-checks on -D sched.runner=single-threaded" </pre> <p>Then use your standard makefile commands to compile the tree or your project @@ -200,8 +199,8 @@ and attach its standard output and error.</p> <p>To remove detailed build logs use:</p> -<pre class=prettyprint> -$ unset ANDROID_JACK_EXTRA_ARGS +<pre class="devsite-terminal devsite-click-to-copy"> +unset ANDROID_JACK_EXTRA_ARGS </pre> <h3 id=jack_limitations>Jack limitations</h3> @@ -258,7 +257,7 @@ or multi-dex legacy is enabled.</p> incremental builds, add the following line to the Android.mk file of the project that you want to build incrementally:</p> -<pre class=prettyprint> +<pre class="devsite-click-to-copy"> LOCAL_JACK_ENABLED := incremental </pre> diff --git a/en/source/known-issues.html b/en/source/known-issues.html index 51ce563f..90c95f8d 100644 --- a/en/source/known-issues.html +++ b/en/source/known-issues.html @@ -43,6 +43,7 @@ warning is printed early during the build: such file or directory</code></p> <p><strong>Cause</strong>: Some makefile references that path, which doesn't exist.</p> <p><strong>Fix</strong>: None. This is a harmless warning.</p> + <h3 id="black-gingerbread-emulator">Black Gingerbread Emulator</h3> <p><strong>Symptom</strong>: The emulator built directly from the gingerbread branch doesn't start and stays stuck on a black screen.</p> @@ -51,10 +52,12 @@ which doesn't have all the features necessary to run recent versions of gingerbread.</p> <p><strong>Fix</strong>: Use version R12 of the emulator, and a newer kernel that matches those tools. No need to do a clean build.</p> -<pre><code>$ repo forall platform/external/qemu -c git checkout aosp/tools_r12 -$ make -$ emulator -kernel prebuilt/android-arm/kernel/kernel-qemu-armv7 -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">repo forall platform/external/qemu -c git checkout aosp/tools_r12</code> +<code class="devsite-terminal">make</code> +<code class="devsite-terminal">emulator -kernel prebuilt/android-arm/kernel/kernel-qemu-armv7</code> +</pre> + <h3 id="emulator-built-on-macos-107-lion-doesnt-work">Emulator built on MacOS 10.7 Lion doesn't work.</h3> <p><strong>Symptom</strong>: The emulator (any version) built on MacOS 10.7 Lion and/or on XCode 4.x doesn't start.</p> @@ -69,11 +72,12 @@ on emulator builds, the resulting build doesn't work.</p> <p><strong>Cause</strong>: All emulator builds now run Dex optimization at build time by default, which requires to follow all dependencies to re-optimize the applications each time the framework changes.</p> -<p><strong>Fix</strong>: Locally disable Dex optimizations with -<code>export WITH_DEXPREOPT=false</code>, delete the existing optimized -versions with <code>make installclean</code> and run a full build to -re-generate non-optimized versions. After that, partial builds -will work.</p> +<p><strong>Fix</strong>: Locally disable Dex optimizations by entering the following command:</p> +<pre class="devsite-terminal devsite-click-to-copy">export WITH_DEXPREOPT=false</pre> +<p>Delete the existing optimized version by entering the following command:</p> +<pre class="devsite-terminal devsite-click-to-copy">make installclean</pre> +<p>Run a full build to re-generate non-optimized versions. After that, partial builds will work.</p> + <h3 id="permission-denied-during-builds">"Permission Denied" during builds.</h3> <p><strong>Symptom</strong>: All builds fail with "Permission Denied", possibly along with anti-virus warnings.</p> @@ -83,6 +87,7 @@ viruses.</p> <p><strong>Fix</strong>: After verifying that there are no actual viruses involved, disable anti-virus on the Android tree. This has the added benefit of reducing build times.</p> + <h3 id="build-errors-related-to-using-the-wrong-compiler">Build errors related to using the wrong compiler.</h3> <p><strong>Symptom</strong>: The build fails with various symptoms. One such symptom is <code>cc1: error: unrecognized command line option "-m32"</code></p> @@ -93,6 +98,7 @@ the Android NDK or building the kernel) cause the default compiler to not be a host compiler.</p> <p><strong>Fix</strong>: Use a "clean" shell, in which no previous actions could have swapped the default compiler.</p> + <h3 id="build-errors-caused-by-non-default-tool-settings">Build errors caused by non-default tool settings.</h3> <p><strong>Symptom</strong>: The build fails with various symptoms, possibly complaining about missing files or files that have the @@ -104,6 +110,7 @@ confuse the build system. Variables known to cause such issues are <code>CDPATH</code> and <code>GREP_OPTIONS</code>.</p> <p><strong>Fix</strong>: Build Android in an environment that has as few customizations as possible.</p> + <h3 id="build-error-with-40x-and-earlier-on-macos-107">Build error with 4.0.x and earlier on MacOS 10.7.</h3> <p><strong>Symptom</strong>: Building IceCreamSandwich 4.0.x (and older versions) fails on MacOS 10.7 with errors similar to this: @@ -111,15 +118,18 @@ versions) fails on MacOS 10.7 with errors similar to this: <p><strong>Cause</strong>: 4.0.x is not compatible with MacOS 10.7.</p> <p><strong>Fix</strong>: Either downgrade to MacOS 10.6, or use the master branch, which can be built on MacOS 10.7.</p> -<pre><code>$ repo init -b master -$ repo sync -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">repo init -b master</code> +<code class="devsite-terminal">repo sync</code> +</pre> + <h3 id="build-error-on-macos-with-xcode-43">Build error on MacOS with XCode 4.3.</h3> <p><strong>Symptom</strong>: All builds fail when using XCode 4.3.</p> <p><strong>Cause</strong>: XCode 4.3 switched the default compiler from gcc to llvm, and llvm rejects code that used to be accepted by gcc.</p> <p><strong>Fix</strong>: Use XCode 4.2.</p> + <h3 id="build-error-with-40x-and-earlier-on-ubuntu-1110">Build error with 4.0.x and earlier on Ubuntu 11.10.</h3> <p><strong>Symptom</strong>: Building IceCreamSandwich 4.0.x (and older versions) on Ubuntu 11.10 and newer fails with errors similar to this: @@ -129,11 +139,12 @@ is defined by default, and Android also defines that symbol, which causes a conflict.</p> <p><strong>Fix</strong>: Either downgrade to Ubuntu 10.04, or use the master branch, which can be compiled on Ubuntu 11.10 and newer.</p> -<pre><code>$ repo init -b master -$ repo sync +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">repo init -b master</code> +<code class="devsite-terminal">repo sync</code> </code></pre> -<h2 id="source-sync">Source sync issues<h2> +<h2 id="source-sync">Source sync issues</h2> <h3 id="difficulties-syncing-the-source-code-proxy-issues">Difficulties syncing the source code (proxy issues).</h3> <p><strong>Symptom</strong>: <code>repo init</code> or <code>repo sync</code> fail with http errors, @@ -144,6 +155,7 @@ large amounts of data getting transferred.</p> <p><strong>Fix</strong>: While there's no general solution, using python 2.7 and explicitly using <code>repo sync -j1</code> have been reported to improve the situation for some users.</p> + <h3 id="difficulties-syncing-the-source-tree-virtualbox-ethernet-issues">Difficulties syncing the source tree (VirtualBox Ethernet issues).</h3> <p><strong>Symptom</strong>: When running <code>repo sync</code> in some VirtualBox installations, the process hangs or fails with a variety of possible symptoms. @@ -154,6 +166,7 @@ NAT (Network Address Translation) to connect the guest system to the network. The heavy network activity of repo sync triggers some corner cases in the NAT code.</p> <p><strong>Fix</strong>: Configure VirtualBox to use bridged network instead of NAT.</p> + <h3 id="difficulties-syncing-the-source-tree-dns-issues">Difficulties syncing the source tree (DNS issues).</h3> <p><strong>Symptom</strong>: When running <code>repo sync</code>, the process fails with various errors related to not recognizing the hostname. One such @@ -166,25 +179,29 @@ those results locally.</p> <p>You can resolve them with the <code>nslookup</code> command, which will give you one numerical IP address for each of those (typically in the "Address" part of the output).</p> -<pre><code>$ nslookup googlesource.com -$ nslookup android.googlesource.com -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">nslookup googlesource.com</code> +<code class="devsite-terminal">nslookup android.googlesource.com</code> +</pre> <p>You can then hard-code them locally by editing <code>/etc/hosts</code>, and adding two lines in that file, of the form:</p> -<pre><code>aaa.bbb.ccc.ddd googlesource.com +<pre class="devsite-click-to-copy"> +aaa.bbb.ccc.ddd googlesource.com eee.fff.ggg.hhh android.googlesource.com -</code></pre> +</pre> <p>Note that this will only work as long as the servers' addresses don't change, and if they do and you can't connect you'll have to resolve those hostnames again and edit <code>etc/hosts</code> accordingly.</p> + <h3 id="difficulties-syncing-the-source-tree-tcp-issues">Difficulties syncing the source tree (TCP issues).</h3> <p><strong>Symptom</strong>: <code>repo sync</code> hangs while syncing, often when it's completed 99% of the sync.</p> <p><strong>Cause</strong>: Some settings in the TCP/IP stack cause difficulties in some network environments, such that <code>repo sync</code> neither completes nor fails.</p> -<p><strong>Fix</strong>: On linux, <code>sysctl -w net.ipv4.tcp_window_scaling=0</code>. On -MacOS, disable the rfc1323 extension in the network settings.</p> +<p><strong>Fix</strong>: On Linux, enter the command:</p> +<pre class="devsite-terminal devsite-click-to-copy">sysctl -w net.ipv4.tcp_window_scaling=0</pre> +<p>On MacOS, disable the rfc1323 extension in the network settings.</p> <h2 id="runtime-issues">Runtime issues</h2> diff --git a/en/source/report-bugs.html b/en/source/report-bugs.html index 581dc780..f273d7ff 100644 --- a/en/source/report-bugs.html +++ b/en/source/report-bugs.html @@ -1,6 +1,6 @@ <html devsite> <head> - <title>Report Bugs</title> + <title>Reporting Bugs</title> <meta name="project_path" value="/_project.yaml" /> <meta name="book_path" value="/_book.yaml" /> </head> diff --git a/en/source/running.html b/en/source/running.html index b1b8670e..4a67565f 100644 --- a/en/source/running.html +++ b/en/source/running.html @@ -32,8 +32,9 @@ designed to complement the information in regular build system. Use the instructions in <a href="/source/building.html">Building a System</a> and replace the main <code>make</code> command with:</p> -<pre><code>$ make fastboot adb -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +make fastboot adb +</pre> <h2 id="booting-into-fastboot-mode">Booting into fastboot mode</h2> <p><em>Fastboot</em> is a bootloader mode in which you can flash a device. @@ -186,33 +187,47 @@ Nexus 9) have factory reset protection and require a multi-step process to unlock the bootloader.</p> <ol> -<li>Enable OEM unlocking on the device: -<ol style="list-style-type:lower-alpha"> -<li>In Settings, tap <strong>About phone</strong>, then tap <strong>Build -number</strong> seven (7) times.</li> -<li>When you see the message "You are a developer", tap the back button.</li> -<li>Tap <strong>Developer options</strong> and enable -<strong>OEM unlocking</strong> and <strong>USB debugging</strong>. -(If OEM unlocking is disabled, connect to the Internet so the device can check -in at least once. If it remains disabled, your device may be SIM locked by your -carrier and the bootloader cannot be unlocked.)</li></ol></li> -<li>Reboot into the bootloader and use fastboot to unlock it. -<ul> -<li>For new devices (2015 and later): <code>$ fastboot flashing unlock</code> -</li> -<li>For older devices (2014 and earlier): <code>$ fastboot oem -unlock</code></li></ul> -You must confirm the unlock onscreen.</li></ol> + <li>Enable OEM unlocking on the device: + <ol style="list-style-type:lower-alpha"> + <li>In Settings, tap <strong>About phone</strong>, then tap <strong>Build number</strong> seven (7) times.</li> + <li>When you see the message "You are a developer", tap the back button.</li> + <li>Tap <strong>Developer options</strong> and enable <strong>OEM unlocking</strong> and <strong>USB debugging</strong>. (If OEM unlocking is disabled, connect to the Internet so the device can check in at least once. If it remains disabled, your device may be SIM locked by your carrier and the bootloader cannot be unlocked.)</li> + </ol> + </li> + <li>Reboot into the bootloader and use fastboot to unlock it. + <ul> + <li>For new devices (2015 and later): +<pre class="devsite-terminal devsite-click-to-copy"> +fastboot flashing unlock +</pre> + </li> + <li>For older devices (2014 and earlier): +<pre class="devsite-terminal devsite-click-to-copy"> +fastboot oem unlock +</pre> + </li> + </ul> + You must confirm the unlock onscreen. + </li> +</ol> -<p class="note"><strong>Note</strong> On Nexus 10, after unlocking the +<p class="note"><strong>Note:</strong> On Nexus 10, after unlocking the bootloader, the internal storage remains unformatted. You can format the device using <code>fastboot format cache</code> followed by <code>fastboot format userdata</code></p> <h3 id="relocking-the-bootloader">Re-locking the bootloader</h3> <p>To re-lock the bootloader:</p> <ul> -<li>For new devices (2015 and later): <code>$ fastboot flashing lock</code></li> -<li>For older devices (2014 and earlier): <code>$ fastboot oem lock</code></li> + <li>For new devices (2015 and later): +<pre class="devsite-terminal devsite-click-to-copy"> +fastboot flashing lock +</pre> + </li> + <li>For older devices (2014 and earlier): +<pre class="devsite-terminal devsite-click-to-copy"> +fastboot oem lock +</pre> + </li> </ul> <p class="note"><strong>Note</strong>: Re-locking the bootloading on a Motorola @@ -429,14 +444,14 @@ unlock</code>.</p> <p>Place the device in fastboot mode either manually by holding the appropriate key combination at boot, or from the shell with:</p> -<pre> -$ adb reboot bootloader +<pre class="devsite-terminal devsite-click-to-copy"> +adb reboot bootloader </pre> <p>After the device is in fastboot mode, run:</p> -<pre> -$ fastboot flashall -w +<pre class="devsite-terminal devsite-click-to-copy"> +fastboot flashall -w </pre> <p>The <code>-w</code> option wipes the <code>/data</code> partition on the diff --git a/en/source/submit-patches.html b/en/source/submit-patches.html index 85244534..5620209e 100644 --- a/en/source/submit-patches.html +++ b/en/source/submit-patches.html @@ -56,7 +56,9 @@ made directly to that project, as described in <a href="#upstream-projects">Upstream Projects</a>.</p> </li> </ul> + <h2 id="for-contributors">For contributors</h2> + <h3 id="authenticate-with-the-server">Authenticate with the server</h3> <p>Before you can upload to Gerrit, you need to <a href="https://android.googlesource.com/new-password">establish a password</a> @@ -67,17 +69,19 @@ Authentication</a> for additional details.</p> <h3 id="start-a-repo-branch">Start a repo branch</h3> <p>For each change you intend to make, start a new branch within the relevant git repository:</p> -<pre><code>$ repo start NAME . -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo start <var>NAME</var> . +</pre> <p>You can start several independent branches at the same time in the same repository. The branch NAME is local to your workspace and will not be included on gerrit or the final source tree.</p> <h3 id="make-your-change">Make your change</h3> <p>Once you have modified the source files (and validated them, please) commit the changes to your local repository:</p> -<pre><code>$ git add -A -$ git commit -s -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">git add -A</code> +<code class="devsite-terminal">git commit -s</code> +</pre> <p>Provide a detailed description of the change in your commit message. This description will be pushed to the public AOSP repository, so please follow our guidelines for writing changelist descriptions: </p> @@ -102,19 +106,21 @@ may be important when another contributor works on this feature next year.</p> </ul> <p>Here is an example commit message:</p> -<pre><code>short description on first line +<pre class="devsite-click-to-copy">short description on first line more detailed description of your patch, which is likely to take up multiple lines. -</code></pre> +</pre> <p>A unique change ID and your name and email as provided during <code>repo init</code> will be automatically added to your commit message. </p> + <h3 id="upload-to-gerrit">Upload to gerrit</h3> <p>Once you have committed your change to your personal history, upload it to gerrit with</p> -<pre><code>$ repo upload -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo upload +</pre> <p>If you have started multiple branches in the same repository, you will be prompted to select which one(s) to upload.</p> <p>After a successful upload, repo will provide you the URL of a new page on @@ -126,37 +132,45 @@ for your patch.</p> <p>Suppose a reviewer has looked at your patch and requested a small modification. You can amend your commit within git, which will result in a new patch on gerrit with the same change ID as the original.</p> -<p><em>Note that if you have made other commits since uploading this patch, -you will need to manually move your git HEAD.</em></p> -<pre><code>$ git add -A -$ git commit --amend -</code></pre> +<aside class="note"><b>Note:</b> If you have made other commits since uploading this patch, + you will need to manually move your git HEAD.</aside> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">git add -A</code> +<code class="devsite-terminal">git commit --amend</code> +</pre> <p>When you upload the amended patch, it will replace the original on gerrit and in your local git history.</p> + <h3 id="resolving-sync-conflicts">Resolving sync conflicts</h3> <p>If other patches are submitted to the source tree that conflict with yours, you will need to rebase your patch on top of the new HEAD of the source repository. The easy way to do this is to run</p> -<pre><code>$ repo sync -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo sync +</pre> <p>This command first fetches the updates from the source server, then attempts to automatically rebase your HEAD onto the new remote HEAD.</p> <p>If the automatic rebase is unsuccessful, you will have to perform a manual rebase.</p> -<pre><code>$ repo rebase -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo rebase +</pre> <p>Using <code>git mergetool</code> may help you deal with the rebase conflict. Once you have successfully merged the conflicting files,</p> -<pre><code>$ git rebase --continue -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +git rebase --continue +</pre> <p>After either automatic or manual rebase is complete, run <code>repo upload</code> to submit your rebased patch.</p> + <h3 id="after-a-submission-is-approved">After a submission is approved</h3> <p>After a submission makes it through the review and verification process, Gerrit automatically merges the change into the public repository. Other users will be able to run <code>repo sync</code> to pull the update into their local client.</p> + <h2 id="for-reviewers-and-verifiers">For reviewers and verifiers</h2> + <h3 id="reviewing-a-change">Reviewing a change</h3> <p>If you are assigned to be the Approver for a change, you need to determine the following:</p> @@ -200,12 +214,14 @@ commands.</p> "Fails," and add a message explaining what problems were identified.</p> </li> </ul> + <h3 id="downloading-changes-from-gerrit">Downloading changes from Gerrit</h3> <p>A submission that has been verified and merged will be downloaded with the next <code>repo sync</code>. If you wish to download a specific change that has not yet been approved, run</p> -<pre><code>$ repo download TARGET CHANGE -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo download <var>TARGET CHANGE</var> +</pre> <p>where TARGET is the local directory into which the change should be downloaded and CHANGE is the change number as listed in <a diff --git a/en/source/using-repo.html b/en/source/using-repo.html index e0298256..9fc473ff 100644 --- a/en/source/using-repo.html +++ b/en/source/using-repo.html @@ -23,33 +23,38 @@ <p>Repo usage takes the following form: </p> -<pre><code>repo <em><COMMAND></em> <em><OPTIONS></em> -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo <var><COMMAND> <OPTIONS></var> +</pre> <p>Optional elements are shown in brackets [ ]. For example, many commands take a project list as an argument. You can specify project-list as a list of names or a list of paths to local source directories for the projects:</p> -<pre><code>repo sync [<em><PROJECT0></em> <em><PROJECT1></em> <em><PROJECTN></em>] -repo sync [<em></PATH/TO/PROJECT0></em> ... <em></PATH/TO/PROJECTN></em>] -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">repo sync [<var><PROJECT0> <PROJECT1> ... <PROJECTN></var>]</code> +<code class="devsite-terminal">repo sync [<var></PATH/TO/PROJECT0> ... </PATH/TO/PROJECTN></var>]</code> +</pre> <h2 id="help">help</h2> <p>Once Repo is installed, you can find the latest documentation starting with a summary of all commands by running:</p> -<pre><code>repo help -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo help +</pre> <p>You can get information about any command by running this within a Repo tree:</p> -<pre><code>repo help <em><COMMAND></em> -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo help <var><COMMAND></var> +</pre> <p>For example, the following command yields a description and list of options for the <code>init</code> argument of Repo, which initializes Repo in the current directory. (See <a href="#init">init</a> for more details.)</p> -<pre><code>repo help init -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo help init +</pre> <h2 id="init">init</h2> -<pre><code>$ repo init -u <em><URL></em> [<em><OPTIONS></em>] -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy">repo init -u <var><URL></var> [<var><OPTIONS></var>] +</pre> <p>Installs Repo in the current directory. This creates a <code>.repo/</code> directory that contains Git repositories for the Repo source code and the standard Android manifest files. The <code>.repo/</code> directory also contains <code>manifest.xml</code>, which is a symlink to the selected manifest in the <code>.repo/manifests/</code> directory.</p> <p>Options:</p> <ul> @@ -64,9 +69,11 @@ current directory. (See <a href="#init">init</a> for more details.)</p> </li> </ul> <p class="note"><strong>Note:</strong> For all remaining Repo commands, the current working directory must either be the parent directory of <code>.repo/</code> or a subdirectory of the parent directory.</p> + <h2 id="sync">sync</h2> -<pre><code>repo sync [<em><PROJECT_LIST></em>] -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo sync [<var><PROJECT_LIST></var>] +</pre> <p>Downloads new changes and updates the working files in your local environment. If you run <code>repo sync</code> without any arguments, it will synchronize the files for all the projects.</p> <p>When you run <code>repo sync</code>, this is what happens:</p> <ul> @@ -75,10 +82,10 @@ current directory. (See <a href="#init">init</a> for more details.)</p> </li> <li> <p>If the project has already been synchronized once, then <code>repo sync</code> is equivalent to:</p> -<pre><code>git remote update -git rebase origin/<em><BRANCH></em> +<pre><code>git remote update +git rebase origin/<var><BRANCH></var> </code></pre> -<p>where <code><em><BRANCH></em></code> is the currently checked-out branch in the local project directory. If the local branch is not tracking a branch in the remote repository, then no synchronization will occur for the project.</p> +<p>where <code><BRANCH></code> is the currently checked-out branch in the local project directory. If the local branch is not tracking a branch in the remote repository, then no synchronization will occur for the project.</p> </li> <li> <p>If the git rebase operation results in merge conflicts, you will need to use the normal Git commands (for example, <code>git rebase --continue</code>) to resolve the conflicts.</p> @@ -97,9 +104,11 @@ git rebase origin/<em><BRANCH></em> <p><code>-f</code>: proceed with syncing other projects even if a project fails to sync.</p> </li> </ul> + <h2 id="upload">upload</h2> -<pre><code>repo upload [<em><PROJECT_LIST></em>] -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo upload [<var><PROJECT_LIST></var>] +</pre> <p>For the specified projects, Repo compares the local branches to the remote branches updated during the last repo sync. Repo will prompt you to select one or more of the branches that have not yet been uploaded for review.</p> <p>After you select one or more branches, all commits on the selected branches are transmitted to Gerrit over an HTTPS connection. You will need to @@ -127,25 +136,32 @@ single commit, use git rebase -i before you run repo upload.</p> </li> </ul> <p>After the upload is complete the changes will have an additional Patch Set.</p> + <h2 id="diff">diff</h2> -<pre><code>repo diff [<em><PROJECT_LIST></em>] -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo diff [<var><PROJECT_LIST></var>] +</pre> <p>Shows outstanding changes between commit and working tree using <code>git diff</code>. </p> + <h2 id="download">download</h2> -<pre><code>repo download <em><TARGET></em> <em><CHANGE></em> -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo download <var><TARGET> <CHANGE></var> +</pre> <p>Downloads the specified change from the review system and makes it available in your project's local working directory.</p> <p>For example, to download <a href="https://android-review.googlesource.com/23823">change 23823</a> into your platform/build directory:</p> -<pre><code>$ repo download platform/build 23823 -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo download platform/build 23823 +</pre> <p>A <code>repo sync</code> should effectively remove any commits retrieved via <code>repo download</code>. Or, you can check out the remote branch; e.g., <code>git checkout m/master</code>.</p> <p class="note"><strong>Note:</strong> There is a slight mirroring lag between when a change is visible on the web in <a href="https://android-review.googlesource.com/">Gerrit</a> and when <code>repo download</code> will be able to find it for all users, because of replication delays to all servers worldwide.</p> + <h2 id="forall">forall</h2> -<pre><code>repo forall [<em><PROJECT_LIST></em>] -c <em><COMMAND></em> -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo forall [<var><PROJECT_LIST></var>] -c <var><COMMAND></var> +</pre> <p>Executes the given shell command in each project. The following additional environment variables are made available by <code>repo forall</code>:</p> <ul> <li> @@ -176,20 +192,25 @@ delays to all servers worldwide.</p> <p><code>-v</code>: show messages the command writes to stderr. </p> </li> </ul> + <h2 id="prune">prune</h2> -<pre><code>repo prune [<em><PROJECT_LIST></em>] -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo prune [<var><PROJECT_LIST></var>] +</pre> <p>Prunes (deletes) topics that are already merged.</p> + <h2 id="start">start</h2> -<pre><code>repo start <em><BRANCH_NAME></em> [<em><PROJECT_LIST></em>] +<pre class="devsite-terminal devsite-click-to-copy">repo start <var><BRANCH_NAME></var> [<var><PROJECT_LIST></var>] </code></pre> <p>Begins a new branch for development, starting from the revision specified in the manifest.</p> -<p>The <code><em><BRANCH_NAME></em></code> argument should provide a short description of the change you are trying to make to the projects.If you don't know, consider using the name default.</p> -<p>The <code><em><PROJECT_LIST></em></code> specifies which projects will participate in this topic branch. </p> +<p>The <code><BRANCH_NAME></code> argument should provide a short description of the change you are trying to make to the projects.If you don't know, consider using the name default.</p> +<p>The <code><PROJECT_LIST></code> specifies which projects will participate in this topic branch. </p> <p class="note"><strong>Note:</strong> "." is a useful shorthand for the project in the current working directory.</p> + <h2 id="status">status</h2> -<pre><code>repo status [<em><PROJECT_LIST></em>] -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +repo status [<var><PROJECT_LIST></var>] +</pre> <p>Compares the working tree to the staging area (index) and the most recent commit on this branch (HEAD) in each project specified. Displays a summary line for each file where there is a difference between these three states.</p> <p>To see the status for only the current branch, run <code>repo status</code>. The status information will be listed by project. For each file in the project, a two-letter code is used:</p> <p>In the first column, an uppercase letter indicates how the staging area differs from the last committed state.</p> |