Hi @lklaus ,
I do see the su binary in the out folder as I pasted, but I installed SuperUser and it says there’s no su binary available. I just checked with ls - it is available in /system/xbin but ls says lstat '/system/xbin/su' failed: Permission denied
I’ll see how much time I have (real life catching up), maybe repo grep will come up with something useful that sets the wrong permissions, then I can check the permissions according to what I see on the FP1.
EDIT: I saw on system/core/include/private/android_filesystem_config.h that the permissions were set to 0750 . Maybe it’s the read permission from “others” that made it unusable? I set to 06774 according to http://android.stackexchange.com/questions/55714/setting-appropriate-permissions-on-su-binary and I’m compiling the image again. Will report much later tonight though, I won’t be here when compilation ends.
The Docker image works now on my machine (I still can’t build because of lack of disk space though).
My machine runs Ubuntu 15.10 with this kernel:
$ uname -a
Linux frederik 4.2.0-23-generic #28-Ubuntu SMP Sun Dec 27 17:47:31 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Does anyone want to try it [Edit: Possibly with some additional steps found meanwhile; e.g. update-api]? Docker would also be a very handy tool for those trying to build on Macs or Windows machines.
I can give it a try, not sure how it works, but I let it run for awhile and let you know later.
Sending build context to Docker daemon 5.12 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:14.04
14.04: Pulling from ubuntu
895b070402bd: Pull complete
02e5bca4149b: Pull complete
b2ae0a712b39: Pull complete
af88597ec24b: Pull complete
ubuntu:14.04: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:098d121c6a9b39080f835563695f8e05faf765f46c174570e61d08197e82b820
Status: Downloaded newer image for ubuntu:14.04
---> af88597ec24b
Step 1 : RUN dpkg --add-architecture i386
---> Running in f946241b7607
---> 85e86c41d78e
Removing intermediate container f946241b7607
Step 2 : RUN apt-get update && apt-get install -y -f --no-install-recommends openjdk-7-jdk bison g++-multilib git gperf libxml2-utils make python-networkx zlib1g-dev:i386 zip curl wget ca-certificates && apt-get clean && rm -rf /var/lib/apt/lists/*
Notes:
Docker needs to know about DNS, else the image will not find files. Important info for people new to Docker
Building the container takes some time but should be finished comparatively quickly. What takes much longer is running the container because that is when the the repo is downloaded and everything is compiled.
Yep, I also assumed it not to be a compiler issue since the build environment ships its own compilers (prebuilts/gcc and prebuilts/clang) which are used when the build system’s output contains “host C” oder “Host C++”.
Here’s the output of “git diff” after “make update-api”:
diff --git a/api/current.txt b/api/current.txt
index 144f292…f97746c 100644
— a/api/current.txt
+++ b/api/current.txt
@@ -17,6 +17,7 @@ package android {
field public static final java.lang.String ACCOUNT_MANAGER = “android.permission.ACCOUNT_MANAGER”;
field public static final java.lang.String ADD_VOICEMAIL = “com.android.voicemail.permission.ADD_VOICEMAIL”;
field public static final java.lang.String AUTHENTICATE_ACCOUNTS = “android.permission.AUTHENTICATE_ACCOUNTS”;
field public static final java.lang.String BACKUP = “android.permission.BACKUP”;
field public static final java.lang.String BATTERY_STATS = “android.permission.BATTERY_STATS”;
field public static final java.lang.String BIND_ACCESSIBILITY_SERVICE = “android.permission.BIND_ACCESSIBILITY_SERVICE”;
field public static final java.lang.String BIND_APPWIDGET = “android.permission.BIND_APPWIDGET”;
@@ -78,6 +79,7 @@ package android {
field public static final java.lang.String INSTALL_SHORTCUT = “com.android.launcher.permission.INSTALL_SHORTCUT”;
field public static final java.lang.String INTERNAL_SYSTEM_WINDOW = “android.permission.INTERNAL_SYSTEM_WINDOW”;
field public static final java.lang.String INTERNET = “android.permission.INTERNET”;
field public static final java.lang.String INVOKE_CARRIER_SETUP = “android.permission.INVOKE_CARRIER_SETUP”;
field public static final java.lang.String KILL_BACKGROUND_PROCESSES = “android.permission.KILL_BACKGROUND_PROCESSES”;
field public static final java.lang.String LOCATION_HARDWARE = “android.permission.LOCATION_HARDWARE”;
field public static final java.lang.String MANAGE_ACCOUNTS = “android.permission.MANAGE_ACCOUNTS”;
@@ -101,6 +103,7 @@ package android {
field public static final deprecated java.lang.String READ_INPUT_STATE = “android.permission.READ_INPUT_STATE”;
field public static final java.lang.String READ_LOGS = “android.permission.READ_LOGS”;
field public static final java.lang.String READ_PHONE_STATE = “android.permission.READ_PHONE_STATE”;
field public static final java.lang.String READ_PRIVILEGED_PHONE_STATE = “android.permission.READ_PRIVILEGED_PHONE_STATE”;
field public static final java.lang.String READ_PROFILE = “android.permission.READ_PROFILE”;
field public static final java.lang.String READ_SMS = “android.permission.READ_SMS”;
field public static final deprecated java.lang.String READ_SOCIAL_STREAM = “android.permission.READ_SOCIAL_STREAM”;
@@ -110,6 +113,7 @@ package android {
field public static final java.lang.String READ_VOICEMAIL = “com.android.voicemail.permission.READ_VOICEMAIL”;
field public static final java.lang.String REBOOT = “android.permission.REBOOT”;
field public static final java.lang.String RECEIVE_BOOT_COMPLETED = “android.permission.RECEIVE_BOOT_COMPLETED”;
field public static final java.lang.String RECEIVE_EMERGENCY_BROADCAST = “android.permission.RECEIVE_EMERGENCY_BROADCAST”;
field public static final java.lang.String RECEIVE_MMS = “android.permission.RECEIVE_MMS”;
field public static final java.lang.String RECEIVE_SMS = “android.permission.RECEIVE_SMS”;
field public static final java.lang.String RECEIVE_WAP_PUSH = “android.permission.RECEIVE_WAP_PUSH”;
An Gentoo uses some technique to manage several Java-versions and different jdks installed on one machine (see answer by mmigdol in the mentioned stackoverflow-link)
I’m sure it does. I thought I could work around a full test by mounting my repo into the docker image, but just to make sure for you I let the computer do a full test run
Update: The “&& sh fp2-sibon-2.0.0-blobs.sh” part needs more love, not your fault. I guess echo in a pipe will be your friend, but I’m not sure if this is even allowed … Oh, and wget could use a “-c” just in case.
I don’t don’t think what you posted is an issue. Is a checking script that gets called by the makefile to ensure the lastet API. I assume. As long as you find images in out/target/product/FP2/*.img you are good. I don’t know anything about the APIs and how they are related to the current code version and how clever this whole setup it. But I’m sure one can read up on this somewhere.
I set the /system/xbin/su permissions to 6774 in system/core/include/private/android_filesystem_config.h and it didn’t work I still get permission denied errors…
EDIT: @lklaus I looked at the log files again, it turns out I do have to install Busybox. But I didn’t understand how to include it into the recovery image, can you explain it to me again?
I compiled the OS and noticed a couple of minor things that might add value to the Wiki. Let me know if you think it would be OK to add.
a) When preparing the build environment on Ubuntu 14.04 LTS, I encountered problems with apt-get install zlib1g-dev:i386. Solved this by installing repo first (on Ubuntu 14.04 repo is included in phablet-tools, sudo apt-get install phablet-tools).
b) The one-line copy statement to copy the libs from the blobs archive seems to be broken - the backslash is not necessary when this is one line only, right?
In addition - would it make sense & add value to add a short description of how to flash the resulting *.img to the phone? Which *.img in which order? Personally I’m a bit overwhelmed by the multitude of files in the out directory… I assume this information could help other rookies as well.
/bootable/recovery/etc/init.rc (after ‘on init’):
export LD_LIBRARY_PATH .:/sbin
[/QUOTE]
Right now I have to figure out how to compile busybox as external add on so I can include it into the recovery image “the right way”. I had a compiled version from early tests with TWRP.
$ sudo apt-get install openjdk-7-jdk bison g++-multilib git gperf \
libxml2-utils make python-networkx zlib1g-dev:i386 zip
Ubuntu 15.10 system setup
sudo apt-get install ....
Debian 8.2 System setup
sudo apt-get install …
Mac
Get docker or use Xcode and brew/macports
I don’t have a FP2 here, so I’m careful about writing things I cannot test. I think @lklaus can help here. And there is also a lot info about it on xda. But you’re right, the info in the ‘flash!’ section is not enough.
In the beginning I did the flashall as described on code.fairphone.com, but I think it is better to only flash what you really need, i.e.
recovery: fastboot flash recovery recovery.img
system: fastboot flash system system.img
In the latter case fastboot flash -w … might be interesting, this wipes the partition and settings, so if the two ROMs are not fully compatible there won’t be any problems.
If you want to use flashall, you need boot.img, recovery.img and system.img as well as the file android-info.txt, if you don’t flash from your environment
(edit: put this in the wiki also)
I’ve encountered the same problem when creating the Docker image. I was able to solve it by adding a dpkg --add-architecture i386 before calling apt-get.
BTW: The Docker image is now on Docker hub. You can get it as simply as
What is wrong with the && sh fp2-sibon-2.0.0-blobs.sh part? Do you mean I should extract fp2-sibon-2.0.0-blobs.tgz to stdout and directly pipe it into sh? Why?
I tried to build on Gentoo. Everything seemed to work at first, but finally I also got the „out/target/common/obj/PACKAGING/checkpublicapi-current-timestamp“ error. Maybe it is caused by the newer version of Make.
To go round any other incompatibilities I go on with jftr’s Docker image now. Thanks for that!
Just started building. I realized some messages about missing unzip command. Is it required or missing in Docker image respectively?
Indeed, it is not available. Does the makefile need it? gunzip is available though. Are these errors or info messages? The build script could for instance first try unzip and – if not available – fall back to gunzip.
I can easily add it if it is necessary.
Edit: Since I’m already at it: Is anything else missing?
I have no clue what it does … I assume it updates the API list. We need someone who will test the images created here ;). Could you update the wiki so that people will understand the difference between a normal build and the one inside docker and how they can get their files?