Android 4.0 compilation mode Eng-> User Problems

Source: Internet
Author: User

Keywords:Android 4.0 user Eng camera NAND serial port

Platform information:

Kernel:Linux3.0

System:Android4.0.3

Platform:S5pv310 (Samsung exynos 4210)

 

Problem description:The following problems occur after the android4.0 compilation mode is changed from Eng to user:

1. The options for setting the WiFi switch are no longer available (ON and OFF );

2. The application APK cannot be installed;

3. The camera prompts you to insert an SD card (the actual SD card and NAND are mounted normally );

4. The serial port terminal outputs information but cannot perform operations (only kernel output information can be seen, and the keyboard does not respond ).

1. Android compilation options: ENG, user, and userdebug,Let's take a look at the differences between several modes.

Eng: many tools are included for development;
User: it is intended for users at the factory;
Userdebug: Some debug options are enabled;

Three modes:
Http://www.kandroid.org/online-pdk/guide/build_system.html#androidBuildVariants
1. Eng engineering model
This is the default flavor. A plain make is the same as make Eng.
Installmodules tagged with: ENG, debug, user, and/or development.
Installnon-APK modules that have no tags specified.
Installapks according to the product definition files, in addition to tagged apks.
Ro. Secure = 0
 Ro. debuggable = 1 // open the serial port for debugging
Ro. kernel. Android. checkjni = 1
ADB is enabled by default.
2. User Mode
Make user
This is the flavor intended to be the final release bits.
Installmodules tagged with user.
Installnon-APK modules that have no tags specified.
Installapks according to the product definition files; tags are ignored for APK modules.
Ro. Secure = 1
Ro. debuggable = 0 // disable serial port debugging. The 4th problem we mentioned is that the serial port cannot be operated. This is the control of this place.
ADB is disabled by default.
3. userdebug user debugging mode
Make userdebug
The same as user, doesn t:
Also installmodules tagged with debug.
Ro. debuggable = 1 // open the serial port for debugging
ADB is enabled by default.

Ii. Change the compilation script build_android.sh

Find the following script and change it to user mode:

Eng mode: Echo make-J $ cpu_job_num product-full _ $ SEC_PRODUCT-eng echo make-J $ cpu_job_num product-full _ $ SEC_PRODUCT-enguser mode: echo make-J $ cpu_job_num product-full _ $ SEC_PRODUCT-user echo make-J $ cpu_job_num product-full _ $ SEC_PRODUCT-user

Iii. Problem Analysis and Solution

1. Analysis of problems 2 and 3

Application APK cannot be installed; camera prompts SD card insertion (the actual SD card and NAND are mounted normally );

The permission is not granted to the NAND and SD cards. View permission:

Shell @ Android: /mnt $ la-ladrwxr-XR-x root system 2000-01-01 Alibaba-XR-x root system 2000-01-01 obbd --- rwxr-x system sdcard_rw 1970-01-01 sdcard // SD card permission D --- rwxr -X system sdcard_rw 1970-01-01 sdcard2 // NAND permission drwx ------ Root 2000-01-01 secured --------- system 2000-01-01 USB

2. Compare the compiled system to find the problem

It is found that system/etc/permissions is different in two modes, 4.0.3 _ R1/out/target/product/smdkv310/system/etc/permissions/missing some XML files when compiling to a user,

For example, Android. Hardware. Camera. XML, Android. Hardware. Wifi. XML, and platform. xml.

We know that the files generated in the out directory are copied elsewhere. Find These XML files in the source: 4.0.3 _ R1/frameworks/base/data/etc, view 4.0.3 _ R1/frameworks/base/data/etc/ndraoid. MK compilation options, found some problems:

########################include $(CLEAR_VARS)LOCAL_MODULE := platform.xmlLOCAL_MODULE_TAGS := engLOCAL_MODULE_CLASS := ETC# This will install the file in /system/etc/permissions#LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissionsLOCAL_SRC_FILES := $(LOCAL_MODULE)include $(BUILD_PREBUILT)

The value of local_module_tags: = ENG is Eng. Therefore, during compilation in user mode, the corresponding file is not copied. When local_module_tags: = user, an error occurs during compilation. If the compilation script is too deep, I cannot understand the content, so I thought of a simple method. I did not judge the mode during compilation and copied the file directly:

3. Add the copy operation to device. mk to solve the problem.

We add the Copy command in 4.0.3 _ R1/device/Samsung/smdkv310/deivce. mk, as follows:

PRODUCT_COPY_FILES += \frameworks/base/data/etc/android.hardware.camera.xml:system/etc/permissions/android.hardware.camera.xml\frameworks/base/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml\frameworks/base/data/etc/android.hardware.touchscreen.multitouch.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.xml\frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml\frameworks/base/data/etc/platform.xml:system/etc/permissions/platform.xml\frameworks/base/data/etc/tablet_core_hardware.xml:system/etc/permissions/tablet_core_hardware.xml

Check the directory 4.0.3 _ R1/out/target/product/smdkv310/system/etc/permissions/after compilation, whether to copy the XML file in the frameworks/base/data/etc/directory.

Note: during the burning, the userdata \ cache partitions are cleared, and some system information is stored. If the system information is not cleared, Errors still occur.

To solve the first three problems, let's look at the fourth problem:

4. Select a serial port (debugable)

Problem: the serial port terminal outputs information, but cannot operate (only kernel output information can be seen, and the keyboard does not respond ).

This problem was accidentally discovered. In user mode, serial ports cannot be operated, that is to say, this is a normal phenomenon, but we have considered that there will always be some problems during the trial production process, you need to use the serial port tracking information, so you still want to find the reason:

(1) default. Prop

Let's compare the differences between default. Prop compilation in two modes:

In user mode, the serial port is unavailable: Shell @ Android:/$ cat default. prop # additional_default_properties # Ro. secure = 1ro. allow. mock. location = 0ro. debuggable = 0 // This value is 0, that is, debug cannot be used, so persist cannot be used for serial ports. SYS. USB. config = mass_storageshell @ Android:/$ user mode, serial port is available: Shell @ Android:/# Cat default. prop # additional_default_properties # Ro. secure = 0ro. allow. mock. location = 1ro. debuggable = 1 // This value is 1, so you can use persist for serial port operations. SYS. USB. config = mass_storage, ADB

(2) Perform a global search and find the location 4.0.3 _ R1/build/CORE/Main. mk.
Change: 4.0.3 _ R1/build/CORE/Main. mk

Ifeq (true, $ (Strip $ (enable_target_debugging) # target is more debuggable and adbd is on by default additional_default_properties + = Ro. debuggable = 1 // Eng mode # include the debugging/testing OTA keys in this build. include_test_ota_keys: = trueelse #! Enable_target_debugging # target is less debuggable and adbd is off by defaultadditional_default_properties + = Ro. debuggable = 1 // in user mode, the original value is 0. Now it is changed to 1 endif #! Enable_target_debugging

Both user and ENG modes should be supported in BSP. Maybe the BSP we get is incomplete. The problem here is only for some issues in user and ENG compilation. I can't analyze it in detail. On the one hand, I do driver work and have limited understanding of the system. On the other hand, BSP compilation rules are generally done by the chip factory. I hope it will be helpful to the "classmates" who encounter the same problem, and I will also make a memo.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.