So I decided to lean how to build AOKP from source. I referenced other developers Github's and multiple tutorials. I finally manged to create a good device and vendor tree and successfully build AOKP from source. All is good, or so I thought. When I attempted to perform my first CWM backup, I was prompted (at the end) with the error message "MD5 error". Looking into the recovery log shows that the script nandroid-md5.sh was not found.
So, I check my build output, "out/target/product/i777/recovery/root/sbin" and discover that the script is missing. Next I start to dig into the bootable/recovery project. I evaluate the Android.mk file and I find the following:
Code:
include $(CLEAR_VARS)
LOCAL_MODULE := nandroid-md5.sh
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
LOCAL_SRC_FILES := nandroid-md5.sh
include $(BUILD_PREBUILT)
So the make file should include the script in the build, but I can't figure out what is missing. I've done the following without success.
Rebuilt with an earlier version (6.0.1.5) of CWM recovery.
Evaluated other devices to see if I'm missing something in my device/vendor trees.
Checked AOKP & CM forums for anyone reporting similar issues.
Built a supported device i9100 and the same problem occurs.
Now, I've found a workaround, but it seems more like a hack. If I include the following line in one of my make files, then the file will get copied.
Code:
PRODUCT_COPY_FILES += \
bootable/recovery/nandroid-md5.sh:recovery/root/sbin/nandroid-md5.sh
I'm hoping that someone can help me understand why my build is having this problem.
Related
Hi everyone,
I'm currently trying to compile Android 2.2.1 for my HTC Desire. My question is simple : how do i add Superuser and su to my build ? I managed to add Superuser but su isn't included... my android/system/extras/su/Makefile looks like that :
Code:
ifeq ($(BUILD_ORIGINAL_SU),true)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= su.c su.c activity.cpp
LOCAL_C_INCLUDES += external/sqlite/dist
LOCAL_SHARED_LIBRARIES := liblog libsqlite libandroid_runtime
LOCAL_MODULE:= su
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_STATIC_LIBRARIES := libc
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := debug
include $(BUILD_EXECUTABLE)
endif
I took the code from Cyanogenmod.. but it doesn't work ...
Thanks in advance for your help,
Renan.
su.c didn't produce any output? Was there an error in the build?
You could probably fake it by just copying sh to su and giving it SIUD (root:root 4755) permissions
Thanks for your reply.
I tried to compile with different Makefiles (stock, modified, cyanogenmod one) and different files (su.c or su.c, su.h and activity.cpp) but there's no output :/ I don't see su in /system/bin or in /system/xbin... And when I load my ROM on my phone, Superuser doesn't work because there isn't su. I tried to flash superuser.zip but there's an issue with the symbolic link I think.
I found a guide who explaned how to root aosp for motorola sholes but this method (the one I used) doesn't work for me..
It it's just a matter of the su executable, one from any android build would probably work. The command line tools are all ELF ARM-NONE-EABI.
It doesn't work at all...
If I remove su (chainsdd's android_system_extras) and add the binary, then create symlinks, it doesn't work.
su causes an issue when I'm building source:
Code:
android/system/system/extras/su/su.c:149: undefined reference to `_mktemp'
But it's strange... when I build without it and then re-add the source, all is ok. But on the phone, I get a seg fault when I try to run su...
What's wrong ? :/
I'm also interested in this...
Look at the sources of my ROM : http://github.com/python08/android_system_extras.git
Look at su/Android.mk
You will understand the problem
Sent from my HTC Desire using XDA App
I dont know if it is too late to answer you~
Be aware of the following:
LOCAL_MODULE_TAGS := debug
It means this module is included ONLY when you are building an "eng" or "userdebug" version.
If you build your android with "user" this module will not be included.
Try change LOCAL_MODULE_TAGS to "optional".
Questions should be posted in Q&A forums, not Development forums.
http://forum.xda-developers.com/announcement.php?a=81
See rule #15
Thread moved.
I'm compiling android from source. I've set up the environment, and tested the builds. Everything works fine.
My current objective is to add 10 custom xml files to /system/etc/permissions. I've tried modifying the Android.mk file in frameworks/base/data/etc to include the files, but the additions aren't appearing in the compiled system. What's strange is that the default files that were in the same folder and already in the makefile appear, so the makefile seems to be read and parsed at compile.
This is the code I'm using:
Code:
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]default_file_already_present.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]my_custom_file.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
For some reason, my_custom_file is not added, while the default_file_already_present is. Any ideas?
I've searched around, but can't find any decent documentation. I feel like I’m very close, so any help is much appreciated!
tl;dr - Adding files to system partition with makefile partially fails.
Solution!
For those who also run in to this problem:
As per Jean-Baptiste Quéru's post on a google group;
The Android makefiles are essentially split into 2 primary categories,
parsed in this order.
-the product definitions, which specify what modules need to be
installed for each product.
-the module definition, which specify how to build each module.
The build system protects itself against situation where you modify
the product definition from a module definition. PRODUCT_COPY_FILES is
part of the product definition, and can't be modify from a module
definition.
JBQ
Click to expand...
Click to collapse
What this means is that in order to copy files as is to the system image, we need to use product definitions.
What I did was first run ./build/envsetup.sh, in order to get access to commands like mgrep, etc.
I noticed that in frameworks/base/data/keyboards there was a keyboards.mk file, which got included correctly.
I made a copy and modifies it to suit my needs:
Code:
# Copyright (C) 2010 The Android Open Source Project
#
blah blah blah...
#
# This is the list of custom permissions to be injected in /system/etc/permissions
permissionsfiles := \
android.hardware.camera.front.xml \
android.hardware.usb.accessory.xml \
android.hardware.usb.host.xml \
android.hardware.wifi.direct.xml \
android.hardware.wifi.xml \
android.software.sip.voip.xml \
com.google.android.maps.xml \
com.google.android.media.effects.xml \
com.google.widevine.software.drm.xml \
handheld_core_hardware.xml \
platform_plus.xml \
features.xml
PRODUCT_COPY_FILES := $(foreach file,$(permissionsfiles),\
frameworks/base/data/etc/$(file):system/etc/permissions/$(file))
I ran "mgrep keyboards" and noted which makefiles included the keyboards.mk file, then I opened each file and duplicated that line, modifying it to instead include my custom_permissions.mk located in frameworks/base/data/etc/.
I compiled and the files were all there.
Hope this helps.
I'm compiling android from source. I've set up the environment, and tested the builds. Everything works fine.
My current objective is to add 10 custom xml files to /system/etc/permissions. I've tried modifying the Android.mk file in frameworks/base/data/etc to include the files, but the additions aren't appearing in the compiled system. What's strange is that the default files that were in the same folder and already in the makefile appear, so the makefile seems to be read and parsed at compile.
This is the code I'm using:
Code:
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]default_file_already_present.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]my_custom_file.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
For some reason, my_custom_file is not added, while the default_file_already_present is. Any ideas?
I've searched around, but can't find any decent documentation. I feel like I’m very close, so any help is much appreciated!
tl;dr - Adding files to system partition with makefile partially fails.
Solution!
For those who also run in to this problem:
As per Jean-Baptiste Quéru's post on a google group;
The Android makefiles are essentially split into 2 primary categories,
parsed in this order.
-the product definitions, which specify what modules need to be
installed for each product.
-the module definition, which specify how to build each module.
The build system protects itself against situation where you modify
the product definition from a module definition. PRODUCT_COPY_FILES is
part of the product definition, and can't be modify from a module
definition.
JBQ
Click to expand...
Click to collapse
What this means is that in order to copy files as is to the system image, we need to use product definitions.
What I did was first run ./build/envsetup.sh, in order to get access to commands like mgrep, etc.
I noticed that in frameworks/base/data/keyboards there was a keyboards.mk file, which got included correctly.
I made a copy and modifies it to suit my needs:
Code:
# Copyright (C) 2010 The Android Open Source Project
#
blah blah blah...
#
# This is the list of custom permissions to be injected in /system/etc/permissions
permissionsfiles := \
android.hardware.camera.front.xml \
android.hardware.usb.accessory.xml \
android.hardware.usb.host.xml \
android.hardware.wifi.direct.xml \
android.hardware.wifi.xml \
android.software.sip.voip.xml \
com.google.android.maps.xml \
com.google.android.media.effects.xml \
com.google.widevine.software.drm.xml \
handheld_core_hardware.xml \
platform_plus.xml \
features.xml
PRODUCT_COPY_FILES := $(foreach file,$(permissionsfiles),\
frameworks/base/data/etc/$(file):system/etc/permissions/$(file))
I ran "mgrep keyboards" and noted which makefiles included the keyboards.mk file, then I opened each file and duplicated that line, modifying it to instead include my custom_permissions.mk located in frameworks/base/data/etc/.
I compiled and the files were all there.
Hope this helps.
Note:
I noticed alot more people have been using MultiRom, So I decided to make a really simple basic How to guide for people who pretty much already know what they are doing.
Step #1, you need the omni source tree, I use Omni-lp5.1.1, But to use that, you will need to make some changes to your device tree, like g3-common and qcomm_common,
Only thing you will be doing to those to device tree sections, in g3-common you will remove the "liblight" directory. and in the qcomm_common Dir, you will remove The "power" Directory.
reason for that, because its already defined in hardware.. The above is only if you decide to use Omni LP trees.
If you use the Normal Omni KitKat 4.4.4, Then you dont have to remove anything.. should work right out of the box.
If using Omni 4.4.4, you can use your device from: https://github.com/TeamWin,
if your using Omni LP you can use your own device tree that works with LP..
Ok now for the code part:
open your BoardConfig.mk
and enter this at the bottom:
Code:
# Edited for TWRP Recovery
DEVICE_RESOLUTION := 1440x2560
RECOVERY_GRAPHICS_USE_LINELENGTH := true
TW_NO_USB_STORAGE := true
TW_INCLUDE_JB_CRYPTO := true
TW_INCLUDE_CRYPTO := true
BOARD_SUPPRESS_SECURE_ERASE := true
RECOVERY_SDCARD_ON_DATA := true
BOARD_HAS_NO_REAL_SDCARD := true
TW_BRIGHTNESS_PATH := "/sys/devices/mdp.0/qcom\x2cmdss_fb_primary.175/leds/lcd-backlight/brightness"
TW_MAX_BRIGHTNESS := 255
TW_SCREEN_BLANK_ON_BOOT := true
# TW_NO_SCREEN_TIMEOUT := false
# MultiROM
MR_INPUT_TYPE := type_b
MR_INIT_DEVICES := device/lge/d851/multirom/mr_init_devices.c
MR_RD_ADDR := 0x2200000
MR_DPI := xhdpi
MR_DPI_MUL := 1.5
MR_FSTAB := device/lge/d851/twrp.fstab
MR_KEXEC_MEM_MIN := 0x0ff00000
MR_KEXEC_DTB := true
MR_USE_MROM_FSTAB := true
MR_DPI_FONT := 420
MR_DEFAULT_BRIGHTNESS := 80
#MR_CONTINUOUS_FB_UPDATE := true
#MultiRom Hooks, So that we can run stock roms as secondary
MR_DEVICE_HOOKS := device/lge/d851/mr_hooks.c
MR_DEVICE_HOOKS_VER := 4
Of course change your device name and locations.
You will need to make changes to omni_(your device).mk (AKA cm_(your device).mk
and add this to it:
Code:
# Copy needed files to make everything work for recovery
PRODUCT_COPY_FILES += \
# device/lge/d851/kernel:kernel \
device/lge/d851/img_info:img_info \
device/lge/d851/postrecoveryboot.sh:recovery/root/sbin/postrecoveryboot.sh \
device/lge/d851/sign:recovery/root/res/sign
PRODUCT_COPY_FILES += device/lge/d851/fstab.g3:recovery/root/fstab.g3
PRODUCT_COPY_FILES += device/lge/d851/twrp.fstab:recovery/root/etc/twrp.fstab
PRODUCT_NAME := omni_d851
PRODUCT_DEVICE := d851
PRODUCT_BRAND := LG
PRODUCT_MODEL := G3
PRODUCT_MANUFACTURER := LG
Im not going to tell you how to get your own fstab. you should already know that.
You will need this for your hooks file: mr_hooks.c
I am sure you can see the location that it will go into, you can change it to meet your device spec.
Now read this for the rest of the way: https://github.com/Tasssadar/multirom/wiki/Porting-MultiROM
I already created a patch that works very well with the latest MultiRom: D851-CM_hardboot_kexec_kernel.patch
Yes the patch says D851, but its for the G3 kernel which all models use. And yes, it will work with CM based and stock based. If anything you will have to change the config file settings
to match the ones for your device config. This one is set for the d851_defconfig.. So just point it to your config when it asks.
Command to run patch from terminal: patch --verbose -p1 < patch/D851-CM_hardboot_kexec_kernel.patch
Yes when you copy it over, place it in its own dir called patch from your kernel tree.
or if you rather take an already patched kernel: 777Kernel-patched Branch "Testing"
Above kernel was patched by me with pemish from @777jon, I did remove his patch created by @Skin1980 since it didnt work well with todays MultiRom
and I added in mine.. I also made some changes to allow Sabermod 5.1 and 6.0 to compile it.
Ok this is it for me, I told you it was a quick guide for people that already know what they are doing. I am no good at teaching. I wrote this really quick so that others
can have the ability to get MultiRom running on their device (Developers)..
I will only answer questions from Developers that plan on porting to thier device and make it public.
any1 working on this?
I honestly forgot that I posted this. I do hope that some are working on this for their device.
I just dont have the time to port over to every single G3 family device......
I'm trying to build AOSP for Moto X 2013 (ghost). I've successfully built the kernel separately already (and flashed it to my device to make sure it works) but I can't seem to find a way to tell AOSP to use it. I get the following error when running make -j16 otapackage:
No private recovery resources for TARGET_DEVICE ghost
make: *** No rule to make target `out/target/product/ghost/kernel', needed by `out/target/product/ghost/boot.img'. Stop.
I've already tried to add this line to device.mk:
LOCAL_KERNEL := device/motorola/ghost-kernel/zImage
But it did nothing.
Any ideas?
I think, you should use TARGET_PREBUILT_KERNEL variable
https://stackoverflow.com/questions/9008761/replace-the-prebuilt-kernel-in-the-android-platform-source
http://wiki.cyanogenmod.org/w/Doc:_integrated_kernel_building
Fixed this build step by adding these lines to the device makefile:
Code:
TARGET_PREBUILT_KERNEL := device/motorola/ghost-kernel/zImage
PRODUCT_COPY_FILES += \
$(TARGET_PREBUILT_KERNEL):kernel
Effectively, this copies the kernel file to the output directory to be processed by subsequent steps.