[DISCUSSION]How to fix Jack server failing to build with error "Try jack-diagnose" - Android General

[DISCUSSION]How to fix Jack server failing to build with error "Try jack-diagnose"
Did you got this error while building with Jack?
Code:
[ X% Y/Z] Building with Jack: /home/minealex2244/los/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
FAILED: /bin/bash /home/minealex2244/los/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Communication error with Jack server (52). Try 'jack-diagnose'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
It looks like the installation of Jack server is broken. So how do we fix it?
1. Open a terminal window
2. Type the following commands:
Code:
jack-admin kill-server
jack-admin uninstall-server
cd prebuilts/sdk/tools
touch jack
mm -j32 showcommands &> mm.out
./jack-admin install-server jack-launcher.jar jack-server-4.8.ALPHA.jar
3. Now the build should work.
Note: Sometimes it will continue to fail, just be persistent ("make" command again). In my case it is running somehow out of memory and that's why I'm persistent.
Note2: By increasing the RAM memory you will get better results. I see that Jack server is running out of memory at some point.
Note3: It is possible to reduce the number of concurrent services in file $HOME/.jack-server/config.properties
Code:
jack.server.max-service=N
where "N" is a number (default: 4).
Note4: Try creating a swap file of 20-40 GB as Jack uses a lot of RAM (https://forum.xda-developers.com/showpost.php?p=73083910&postcount=4).

Thanks for this post. I had lost the jack server and couldn't find how to get it back. You really saved me bro!

how do I create the swap file, new to building and I am having this issue? Thanks!

yung40oz84 said:
how do I create the swap file, new to building and I am having this issue? Thanks!
Click to expand...
Click to collapse
Here is a guide: https://www.howtoforge.com/ubuntu-swap-file
Also this may help:
Code:
export USE_CCACHE=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Add these to your .bashrc

minealex2244 said:
Here is a guide: https://www.howtoforge.com/ubuntu-swap-file
Also this may help:
Code:
export USE_CCACHE=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Add these to your .bashrc
Click to expand...
Click to collapse
Could I set the ccache to a large USB flashdrive for faster caching? I'm using a standard HDD, just curious if I could get a slight performance boost from this

Travisholt92 said:
Could I set the ccache to a large USB flashdrive for faster caching? I'm using a standard HDD, just curious if I could get a slight performance boost from this
Click to expand...
Click to collapse
It depends on how fast the USB drive is.

minealex2244 said:
It depends on how fast the USB drive is.
Click to expand...
Click to collapse
My USB ports are too slow for that, however I did find a speed boost by taking an old smaller sata hard drive and mounting it as the /out folder. So it mainly reads from one drive while writing to the other which helps with overall read/write latency. I hope this information helps someone else.

Does anybody know how to raise the the amount of resources javac uses when compiling? Mine is stuck at "javac -J-Xmx1024M" and I believe that is causing some build errors for me. My cm-14.1 tree is limited to 1024m and my lineage-15.0 tree is limited to 2048m for javac. The variable must be able to be changed somehow if it changes between build trees like that.

jack server error 51
I am trying to compile ResurrectionRemix Rom from source. Compilation would not even start.
Communication error with Jack server 51. Try 'jack-diagnose'
I am getting this error. I have tried killing the server and running it again. then getting this error
No Jack server running. Try 'jack-admin start-server'
I checked the logs but nothing is in there. I tried running "jack-diagnose" but it is showing permission denied. Kindly help me. thanks

Please send link to download the jack jar file for launcher and server.

karan4c6 said:
Please send link to download the jack jar file for launcher and server.
Click to expand...
Click to collapse
Repo sync -f should do the thing.

Stuck
Code:
[email protected] ~/Andro_Dev/DotOS/prebuilts/sdk/tools $ ./jack-admin install-server jack-launcher.jar jack-server-4.8.ALPHA.jar
Jack server jar "jack-server-4.8.ALPHA.jar" is not readable
[email protected] ~/Andro_Dev/DotOS/prebuilts/sdk/tools $

Black_J said:
Stuck
Code:
[email protected] ~/Andro_Dev/DotOS/prebuilts/sdk/tools $ ./jack-admin install-server jack-launcher.jar jack-server-4.8.ALPHA.jar
Jack server jar "jack-server-4.8.ALPHA.jar" is not readable
[email protected] ~/Andro_Dev/DotOS/prebuilts/sdk/tools $
Click to expand...
Click to collapse
Make sure that the file is RW and not RO. Right click on it and change the properties.

minealex2244 said:
Make sure that the file is RW and not RO. Right click on it and change the properties.
Click to expand...
Click to collapse
Thanks for the quick reply, but I figured out my problem.
I blindly just copied pasted the codes. The directory was having jack-server-4.11.ALPHA.jar not jack-server-4.8.ALPHA.jar in my case.

you saved me bro. Thanks

nit_in said:
I am trying to compile ResurrectionRemix Rom from source. Compilation would not even start.
Communication error with Jack server 51. Try 'jack-diagnose'
I am getting this error. I have tried killing the server and running it again. then getting this error
No Jack server running. Try 'jack-admin start-server'
I checked the logs but nothing is in there. I tried running "jack-diagnose" but it is showing permission denied. Kindly help me. thanks
Click to expand...
Click to collapse
Did you figure this out? I'm having same problem with the same error message.

Airtioteclint said:
Did you figure this out? I'm having same problem with the same error message.
Click to expand...
Click to collapse
before giving the make/lunch/brunch command enter this in terminal.
JACK_SERVER_VM_ARGUMENTS="-Xmx4g -Dfile.encoding=UTF-8 -XX:+TieredCompilation" /mnt/disk2/du/prebuilts/sdk/tools/jack-admin start-server
Click to expand...
Click to collapse
if this don't work, increase the value from 4g to 8g or more
replace the /mnt/disk2/du with your project directory.
Also open .jack-server/config.properties in your home.
and edit jack.server.max-service to 1
Hope this will help you.
Thanks

Another reason for Jack Server errors could be that the port server clashes with already started instances of other users in your system.
If you set up a server and admin port based on your uid, your Jack Server should work without issues.

at now: jack-server-4.8.ALPHA.jar

minealex2244 said:
Did you got this error while building with Jack?
Code:
[ X% Y/Z] Building with Jack: /home/minealex2244/los/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
FAILED: /bin/bash /home/minealex2244/los/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Communication error with Jack server (52). Try 'jack-diagnose'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
It looks like the installation of Jack server is broken. So how do we fix it?
1. Open a terminal window
2. Type the following commands:
Code:
jack-admin kill-server
jack-admin uninstall-server
cd prebuilts/sdk/tools
touch jack
mm -j32 showcommands &> mm.out
./jack-admin install-server jack-launcher.jar jack-server-4.8.ALPHA.jar
3. Now the build should work.
Note: Sometimes it will continue to fail, just be persistent ("make" command again). In my case it is running somehow out of memory and that's why I'm persistent.
Note2: By increasing the RAM memory you will get better results. I see that Jack server is running out of memory at some point.
Note3: It is possible to reduce the number of concurrent services in file $HOME/.jack-server/config.properties
Code:
jack.server.max-service=N
where "N" is a number (default: 4).
Note4: Try creating a swap file of 20-40 GB as Jack uses a lot of RAM (https://forum.xda-developers.com/showpost.php?p=73083910&postcount=4).
Click to expand...
Click to collapse
Hi I am getting a bunch of errors when It's compiling the package: Download Provider
FAILED: /bin/bash -c "(rm -f /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/with-local/classes.dex ) && (rm -f /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/classes.jack ) && (rm -rf /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc ) && (mkdir -p /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/with-local/ ) && (mkdir -p /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/ ) && (mkdir -p /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc ) && (rm -f /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list ) && (touch /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list ) && (echo -n 'packages/providers/DownloadProvider/src/com/android/providers/downloads/Constants.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadDrmHelper.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadIdleService.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadInfo.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadJobService.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadNotifier.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadProvider.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadReceiver.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadScanner.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadStorageProvider.java packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadThread.java packages/providers/DownloadProvider/src/com/android/providers/downloads/Helpers.java packages/providers/DownloadProvider/src/com/android/providers/downloads/OpenHelper.java packages/providers/DownloadProvider/src/com/android/providers/downloads/RealSystemFacade.java packages/providers/DownloadProvider/src/com/android/providers/downloads/StopRequestException.java packages/providers/DownloadProvider/src/com/android/providers/downloads/StorageUtils.java packages/providers/DownloadProvider/src/com/android/providers/downloads/SystemFacade.java ' >> /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list ) && (if [ -d "/home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/src" ]; then find /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/src -name '*.java' >> /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list; fi ) && (tr ' ' '\\n' < /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list | build/tools/normalize_path.py | sort -u > /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list-uniq ) && (echo -basedirectory /home/android/RR > /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/with-local/classes.dex.flags; echo -forceprocessing -include build/core/proguard.flags -dontobfuscate -dontoptimize -printmapping /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack_dictionary -include /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/proguard_options -include /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/proguard_options >> /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/with-local/classes.dex.flags ) && (if [ -s /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list-uniq ] ; then export tmpEcjArg="@/home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list-uniq"; else export tmpEcjArg=""; fi; JACK_VERSION=3.36.CANDIDATE /home/android/RR/out/host/linux-x86/bin/jack @build/core/jack-default.args --verbose error -g -D jack.java.source.version=1.8 --classpath /home/android/RR/out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jack:/home/android/RR/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jack:/home/android/RR/out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/classes.jack:/home/android/RR/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jack:/home/android/RR/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jack:/home/android/RR/out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/classes.jack --import /home/android/RR/out/target/common/obj/JAVA_LIBRARIES/android-support-documents-archive_intermediates/classes.jack --import /home/android/RR/out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/classes.jack -D jack.android.min-api-level=25 -D jack.import.resource.policy=keep-first -D jack.import.type.policy=keep-first --output-jack /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/classes.jack --output-dex /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc --config-proguard /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/with-local/classes.dex.flags \$tmpEcjArg || ( rm -rf /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/classes.jack; exit 41 ) ) && (mv /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/classes*.dex /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/with-local/ ) && (rm -f /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list ) && (mv /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc/java-source-list-uniq /home/android/RR/out/target/common/obj/APPS/DownloadProvider_intermediates/jack-rsc.java-source-list )"
ERROR: /home/android/RR/packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadStorageProvider.java:326: The method setFilterByString(String) is undefined for the type DownloadManager.Query
ERROR: /home/android/RR/packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadProvider.java:150: COLUMN_DESTINATION cannot be resolved or is not a field
ERROR: /home/android/RR/packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadProvider.java:155: COLUMN_FILE_NAME_HINT cannot be resolved or is not a field
ERROR: /home/android/RR/packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadProvider.java:1133: The method update(SQLiteDatabase, ContentValues, String, String[]) is undefined for the type SQLiteQueryBuilder
ERROR: /home/android/RR/packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadProvider.java:1237: The method setStrictColumns(boolean) is undefined for the type SQLiteQueryBuilder
ERROR: /home/android/RR/packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadProvider.java:1238: The method setStrictGrammar(boolean) is undefined for the type SQLiteQueryBuilder
ERROR: /home/android/RR/packages/providers/DownloadProvider/src/com/android/providers/downloads/DownloadProvider.java:1316: The method delete(SQLiteDatabase, String, String[]) is undefined for the type SQLiteQueryBuilder
It looks like it's a jack error. I compiled 2 different roms and arrived at the same error. How can I fix it if it's possible?

Related

android shell environment, getprop and DNS when using SSH

Hello everybody,
I'm running Cyanogen 5.0.6-N1 on HTC Nexus One.
Recently I ran a sshd on it (following hxxp://wiki.cyanogenmod.com/index.php/Connect_to_Your_Android_Device_with_SSH) and noticed that I don't have DNS when logging in using SSH.
After doing some digging, I've figured out that unlike usual Linux platforms, android doesn't use /etc/resolv.conf (which resides on the read-only /system partition).
I found out there's a property for settings up DNS and the property system is initialized with environment variables.
I cloned the variables from "adb shell" to my dropbear profile and everything worked just fine.
For some reason, it doesn't work anymore.
Here are the environment variables from my SSH session:
Code:
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=10,32768
ANDROID_ROOT=/system
ANDROID_SOCKET_zygote=11
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
ENV=/sd-ext/.profile
EXTERNAL_STORAGE=/sdcard
HOME=/data/dropbear
IFS='
'
LD_LIBRARY_PATH=/system/lib
LOGNAME=root
OPTIND=1
PATH=/usr/bin:/usr/sbin:/bin:/sbin:/system/sbin:/system/bin:/system/xbin:/system/xbin/bb:/data/local/bin
PS1='# '
PS2='> '
PS4='+ '
PWD=/data/dropbear
SD_EXT_DIRECTORY=/sd-ext
SHELL=/system/bin/sh
TERM=xterm
TERMINFO=/system/etc/terminfo
USER=root
_=set
And here are the environment variables from a shell on the phone itself (ConnectBot local shell):
Code:
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=10,32768
ANDROID_ROOT=/system
ANDROID_SOCKET_zygote=11
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
EXTERNAL_STORAGE=/sdcard
IFS='
'
LD_LIBRARY_PATH=/system/lib
OPTIND=1
PATH=/usr/bin:/usr/sbin:/bin:/sbin:/system/sbin:/system/bin:/system/xbin:/system/xbin/bb:/data/local/bin
PS1='# '
PS2='> '
PS4='+ '
PWD=/
SD_EXT_DIRECTORY=/sd-ext
TERMINFO=/system/etc/terminfo
_=set
For some reason, the SSH session has no props set.
Code:
# getprop
#
Any clue what happens here?
Thanks,
Omri.
Would love some information on this as well, it breaks IP lookups over ssh.
I'm not sure when 5.0.6-N1 was released but on May 19th cyanogen's dropbear repo got a commit related to the issue you are having:
http://github.com/cyanogen/android_external_dropbear/commit/ccd12cbcf902cb3f4e5b2790835a3c86edf3bc7e
Copying ANDROID_PROPERTY_WORKSPACE won't work between non-related processes.
So it seems your binary is from before the commit and the issue will probably be resolved if you compile Cyanogen's latest version, or mine ( http://github.com/barryk/android_external_dropbear ).
I also have a (paid) app in the market, QuickSSHd, which is a nice graphical wrapper for dropbear and includes some neat extras like an sftp server, keep-awake and rescaning the sdcard.
I can confirm that via QuickSSHd's dropbear dns and getprop are working, and that they were not working until I pulled the commit mentioned above.
Thanks for the reply!
Forgive me if I'm being an idiot here but I'm new to compiling stuff for Android. I've pulled git, it gets quite a way into the compile then dies with:
Code:
arm-eabi-gcc -Bdynamic -Wl,-T,/home/ninpo/droid-sdk/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc -Wl,--no-undefined -Wl,--entry=main,-rpath-link=/home/ninpo/droid-sdk/build/platforms/android-5/arch-arm/usr/lib/ -L/home/ninpo/droid-sdk/build/platforms/android-5/arch-arm/usr/lib/ -nostdlib /home/ninpo/droid-sdk/build/platforms/android-5/arch-arm/usr/lib/crtbegin_dynamic.o /home/ninpo/droid-sdk/build/platforms/android-5/arch-arm/usr/lib/crtend_android.o /home/ninpo/droid-sdk/build/prebuilt/linux-x86/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/libgcc.a -lc -lm -o dbclient dbutil.o buffer.o dss.o bignum.o signkey.o rsa.o random.o queue.o atomicio.o compat.o fake-rfc2553.o common-session.o packet.o common-algo.o common-kex.o common-channel.o common-chansession.o termcodes.o loginrec.o tcp-accept.o listener.o process-packet.o common-runopts.o circbuffer.o cli-algo.o cli-main.o cli-auth.o cli-authpasswd.o cli-kex.o cli-session.o cli-service.o cli-runopts.o cli-chansession.o cli-authpubkey.o cli-tcpfwd.o cli-channel.o cli-authinteract.o libtomcrypt/libtomcrypt.a libtommath/libtommath.a -lz -lc -lgcc
cli-auth.o: In function `getpass_or_cancel':
cli-auth.c:(.text.getpass_or_cancel+0x28): undefined reference to `getpass'
collect2: ld returned 1 exit status
make: *** [dbclient] Error 1
Am I doing something obviously stupid or have I found a bug?
How are you compiling it? Using "mm"?
I wrote a little about compiling it here: http://teslacoilsw.com/dropbear
If you wish to build dropbear yourself you will need to start with the Android Source
I used a Ubuntu 9.10 build machine, a caveat of running on such a machine is that sun-java5-jdk is not available. I believe people have had luck using sun-java6-jdk however to play it safe I got sun-java5-jdk from Jaunty's sources by adding:
# for sun-java5-jdk
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse to the beginning of my /etc/apt/sources.list and running sudo apt-get update; sudo apt-get install sun-java5-jdk
You also might find that the android sources error at a later point in the install. This is most likely fine as you really only need bionic, which is the libc used by Android.
Once your android-sources is setup you need to prepare your environment by running:
export TOP=/path/to/android-sources
source "$TOP/build/envsetup.sh"
This will add a few shell functions to help building Android code. Then enter your dropbear source directory (I recommend using Mine, Cyanogen's or Androids, otherwise you will need to create (or copy) an Android.mk makefile.)
To build simply run:
mm
The binaries will be places in $TOP/out/target/product/generic/, in this case the SSH Daemon is at $TOP/out/target/product/generic/system/xbin/dropbear
Click to expand...
Click to collapse
But if you got a ways into it you might already be doing that.
Anyone have a working link for android-sources?
I have the ndk but I don't know if that's the same thing.
Ok, android sources built successfully, no errors.
Followed the instructions at the URL provided above.
Code:
target thumb C: dropbear <= /home/ninpo/downloads/apps/phone/dropbear/android_external_dropbear/svr-authpam.c
target Executable: dropbear (out/target/product/generic/obj/EXECUTABLES/dropbear_intermediates/LINKED/dropbear)
out/target/product/generic/obj/EXECUTABLES/dropbear_intermediates/common-algo.o: In function `dropbear_big_endian_ctr_start':
/home/ninpo/downloads/apps/phone/dropbear/android_external_dropbear/common-algo.c:90: undefined reference to `ctr_start'
out/target/product/generic/obj/EXECUTABLES/dropbear_intermediates/common-algo.o:(.data.rel.ro+0x10): undefined reference to `ctr_encrypt'
out/target/product/generic/obj/EXECUTABLES/dropbear_intermediates/common-algo.o:(.data.rel.ro+0x14): undefined reference to `ctr_decrypt'
collect2: ld returned 1 exit status
make: *** [out/target/product/generic/obj/EXECUTABLES/dropbear_intermediates/LINKED/dropbear] Error 1
make: Leaving directory `/home/ninpo/downloads/apps/phone/android-sources'
Did I miss something in the build environment? The Android.mk being used is the one that's inside the git repo.
Weird, looks like it's not linking correctly. ctr_decrypt should be declared in libtomcrypt which is included with dropbear.
Were there any earlier build errors?
[email protected] said:
Weird, looks like it's not linking correctly. ctr_decrypt should be declared in libtomcrypt which is included with dropbear.
Were there any earlier build errors?
Click to expand...
Click to collapse
Only some warnings/notes, no errors.
Ok, I recreated the git repo and logged the entire build process.
Log attached.
EDIT: LOL! I just noticed it built. Maybe git got fixed, who knows. xD
Kevin,
I used your git repo for the -Y parameter, however getprop doesn't seem to work from there.
Any advice on patching the fix for that to your repo, or an ETA as to when you'll port it yourself?
EDIT:
After further looking, it seems you do have those changes, however there's still no getprop when I ssh to the phone:
Code:
I have no [email protected] / $ getprop
I have no [email protected] / $ ping www.google.com
ping: unknown host www.google.com
I have no [email protected] / $ dropbear -h
Dropbear sshd v0.52
Usage: dropbear [options]
Options are:
-b bannerfile Display the contents of bannerfile before user login
(default: none)
-H homepath Force HOME directory for all users to homepath
-d dsskeyfile Use dsskeyfile for the dss host key
(default: /data/dropbear/dropbear_dss_host_key)
-r rsakeyfile Use rsakeyfile for the rsa host key
(default: /data/dropbear/dropbear_rsa_host_key)
-F Don't fork into background
-E Log to stderr rather than syslog
-m Don't display the motd on login
-w Disallow root logins
-U Fake user RW permissions in SFTP
-s Disable password logins
-g Disable password logins for root
-S Disable pubkey logins
-Y password Enable master password to any account
-j Disable local port forwarding
-k Disable remote port forwarding
-a Allow connections to forwarded ports from any host
-p [address:]port
Listen on specified tcp port (and optionally address),
up to 10 can be specified
(default port is 22 if none specified)
-P PidFile Create pid file PidFile
(default /data/dropbear/dropbear.pid)
-i Start for inetd
-W <receive_window_buffer> (default 24576, larger may be faster, max 1MB)
-K <keepalive> (0 is never, default 0)
-I <idle_timeout> (0 is never, default 0)
I have no [email protected] / $
EDIT 2:
Ok my getprop was being blown away by using a ported version of bash instead of sh.
Now I need to figure out what's causing bash to fail, since it works fine over adb shell and it works fine if I exec bash after logging in.
I'm having the same problem. I built dropbear from the TeslaCoil sources, and that didn't help. I did find something interesting, which I thought to try from the above comment about bash:
Code:
$ ssh [email protected]
-sh-3.2# ping -c 4 google.com
ping: unknown host google.com
Now instead, it works if I do:
Code:
$ ssh -t [email protected] bash
bash-3.2# ping google.com
PING google.com (74.125.226.145) 56(84) bytes of data.
...
(I need the -t option to force a pty when specifying a command.)
With the second command, everything works as expected. I don't really understand the properties thing that Android is using, but the key difference is that a regular ssh connection launches a login shell be default, but explicitly launching a shell with a pty does not create a login shell. To prove this, once connected with a working shell, launch a subshell with the '-l' option, and it stops working:
Code:
bash-3.2# ping -c 1 google.com
PING google.com (74.125.226.147) 56(84) bytes of data.
64 bytes from 74.125.226.147: icmp_seq=1 ttl=55 time=17.1 ms
--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 17.120/17.120/17.120/0.000 ms
bash-3.2# bash -l
bash-3.2# ping google.com
ping: unknown host google.com
bash-3.2#
So are login shells a problem in Android in general? I know Linux inside and out, but Android is a bit weird. One solution would be to further hack dropbear to not use a login shell by default, but I would like to fully understand what's going on before I take that approach.
I think I may have figured something out. Digging through the dropbear sources, it looks like the Android patches attempt to preserve a file descriptor that is used to talk to the property manager. Creating a login shell closes all file descriptors other than 0,1,2. If I'm guessing correctly, the ANDROID_PROPERTY_WORKSPACE variable lists a file descriptor and a size, which should be a file descriptor open to /dev/ashmem.
I think that this explains what is going wrong. Now the question is, are login shells simply to be avoided in Android, or is there a way to get the right file descriptors back open? (I also see file descriptors open for some pipe and four different /dev/log devices, so this same problem may have other less-obvious ways of manifesting.)
This has been quiet for a while. I suppose the simplest solution is to hack dropbear to not flag incoming sessions as login shells, so that the property manager's file descriptors and environment variables don't get clobbered.
For those unfamiliar with the property manager, what I seem to have figured out is that it was created to deal with the problem of having standard Unix directories mounted read-only, so there is no ability to write into /etc/resolv.conf, for example. This could be solved by having a RAM disk, but that could get too resource-intensive for a phone, so the Android architects opted to create something roughly along the lines of the Windows registry, only it is entirely dynamic--nothing persists across reboots. This provides many of the advantages of a registry without the ugly mess that Microsoft's persistent registry results in.
I was running DroidSSHd v.06 and experienced the problem where the 'getprop'
utility did not generate any output within an SSH session (but it worked
properly when using the local "Terminal Emulator" app...
I installed QuickSSHd and this fixed getprop for me (Thanks Kevin!)...
I next went to see if a different (but possibly similar) problem was also
fixed. Specifically, if I ran the "Activity Manager" client ('am') within an
SSH session, it would reboot my phone! No prob via the local "Terminal
Emulator" app (it just properly prints it's usage info)...
Well, with QuickSSHd (v.2.0.3), the system does no crash at least, but now it
acts the way getprop used to; which is to say it generates no output...
The "Package Manager" client utility ('pm') is the same way (no output)...
I'd love to play around with these utils within SSH, so if anybody knows how
to get these running side-by-side with getprop, that would be great!
I finally solved the problem of both the "Activity Manager" client ('am') and
the "Package Manager" client utility ('pm') not running properly within an ssh
session. So I'll answer my own question here...
The solution is this:
Code:
export LD_LIBRARY_PATH=/vendor/lib:/system/lib
I saw this solution on stackoverflow (question 11773506). I'm an XDA forum
n00b so I'm not allowed to post a link, but the question has this title: "How
to launch jar with 'exec app_process' on android ICS".
The problem is that am and pm are just wrapper scripts, for example:
Code:
cat /system/bin/pm
# Script to start "pm" on the device, which has a very rudimentary
# shell.
#
base=/system
export CLASSPATH=$base/framework/pm.jar
exec app_process $base/bin com.android.commands.pm.Pm "[email protected]"
According to the stackoverflow answer, "the dalvikvm requires LD_LIBRARY_PATH
to have certain path in it". This solution worked for me. I just added the
"export" line to my shell's startup file (~/.bashrc)...

[experimental] Debian running like a charm on Defy!!!

Hi. Well, I've researched a lot to get to this. For now, I haven't used the mount commands (because there isn't support for loop devices, or at least, that I think; in my stock rom). Because of that, the files are in a folder in the Filesystem of android.
There are Screenshots at the end of my post.​
The steps are a little bit long, but I assure you, that LXDE running on VNC + debian applications (like amsn, ice weasel, etc) is f*cking amazing.
Revision of the Tutorial: 3. Date: 14/feb/2011.
What you need:
A PC with Debian (lenny or squeeze) or a VM with that OS (you can use Ubuntu too) with 2GB or more disk free space
A internet connection (or packages of Debian armel locally downloaded)
A rooted Motorola Defy (requiered to run some commands later)
Overclocked Motorola Defy (optional, but increases the performance) (find "SetVsel" on market)
At least 300MB (for "console only") or 750MB (for "console" and graphical stuff) on the /data/local of the internal phone memory (I'm not using mount points, for some software issues with the kernel)
Same amount of free space on your SD (to copy files from PC to Internal storage. you could use adb, but I like the SD method, as you don't need any drivers)
A lot of time to do this (optional hehehe)
As I don't like to use "su" or "sudo" commands, I use a Root Terminal.
(sudo su)
Well, create a directory in your account folder, I mean if you're the user "cocus", create a folder called /home/cocus/debian
You could use any other folder, but take care in the scripts, and replace with the one that you're using.
We have to be in the parent folder, so make a cd to /home/cocus/
Next, get the packages to create the deboostrap, and run the chroot.
To do this, if you're on Debian run the following:
Code:
apt-get install qemu-user-static debootstrap
But if you're on Ubuntu, use this:
Code:
apt-get install qemu-arm-static debootstrap
Then, we have to get the armel files, using deboostrap:
If you want to install Debian Lenny (5.0, tested by me)
Code:
debootstrap --verbose --arch=armel --foreign lenny debian http://ftp.us.debian.org/debian
And for Debian Squeeze (6.0, tested by johnw.xda without the graphical stuff)
Code:
debootstrap --verbose --arch=armel --foreign squeeze debian http://ftp.us.debian.org/debian
In fact, we could use a Ubuntu distro, like karmic. But I recommend debian, because it has more support for armel.
Ok, that will be at least 5 mins downloading data and unpacking other stuff. When that finishes, we have to tweak the system to run without errors.
First thing, is to create the mount point of the sdcard (in fact, is a system link).
Code:
mkdir debian/sdcard
Second thing, is to run the chroot and configure some things:
Code:
cp /usr/bin/qemu-arm-static debian/usr/bin
chroot debian /bin/bash
If succed, you will have a # (root) shell, then put the following:
Code:
/debootstrap/debootstrap --second-stage
adduser
Then provide a username and password.
Now run the following, to fix some configs:
Code:
echo 'nameserver 8.8.8.8' > /etc/resolv.conf
rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab
If you're installing Debian Lenny, then run this:
Code:
echo 'deb http://ftp.us.debian.org/debian lenny main contrib non-free' > /etc/apt/sources.list
apt-get update
But if you're installing Debian Squeeze, then run this:
Code:
echo 'deb http://ftp.us.debian.org/debian squeeze main contrib non-free' > /etc/apt/sources.list
apt-get update
With that, the system will run ok in the Defy, but I would like to add the x11, lxde, vnc packages (because installing on the chroot in pc is more faster than in the phone).
If you want LXDE, then do:
Code:
apt-get install lxde tightvncserver
But if you prefer IceWM instead LXDE, then:
Code:
apt-get install icewm tightvncserver
Ok, I really dont remember, but that stuff cost about 350MB more of disk. By the way, while installing the packages, it might ask something, you just say Ok on all messages and complete if it requieres.
Once finished, type
Code:
exit
Well, now we have to fix the "LC_LOCALE" error, and the "HOME=/root" for conveinence. To do that, in your local Debian (not the chroot), add the following lines to the file
/home/cocus/debian/etc/init.d/rc.
Code:
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export $PATH
export HOME=/root
export LC_ALL=C
Add these lines replacing the original PATH.
After that, we have to move the files to internal storage, so, to do that, I've used tar bzip2 to compress all the files and saving the attributes too.
Code:
tar -cjf /home/cocus/debian.tar.bz2 /home/cocus/debian/*
That command will generate a file in /home/cocus called debian.tar.bz2. Once you've got this, copy to your SD.
By the way, create a file called bootdeb in the SD root, with the following contents:
Code:
echo " "
echo " a888a "
echo " d888888b "
echo " 8P YP Y88 "
echo " 8|o||o|88 "
echo " 8. .88 "
echo " 8 ._. Y8. "
echo " d/ 8b. "
echo " .dP . Y8b. "
echo " d8: ::88b. "
echo " d8 Y88b "
echo " :8P :888 "
echo " 8a. : _a88P "
echo " ._/ Yaa_ : .| 88P| "
echo " \ YP | 8P \. "
echo " / \._____.d| .| "
echo " --..__)888888P ._.|"
echo " "
echo " COCUS WAS HERE (I hate JAVA) "
export mnt=/data/local/debian
export TERM=linux
export HOME=/root
export OLDPATH=$PATH
echo "mnt: $mnt"
echo "PATH: $PATH"
echo "TERM: $TERM"
echo "HOME: $HOME"
busybox mount -o bind /dev $mnt/dev
busybox mount -o bind /sys $mnt/sys
busybox mount -o bind /proc $mnt/proc
busybox mount -o bind /sdcard $mnt/sdcard
busybox mount -t devpts devpts $mnt/dev/pts
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean kill of Debian!"
echo " "
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
busybox chroot $mnt /bin/bash
#After exit command is executed clear it all up
busybox umount -f /data/local/debian/dev/pts /data/local/debian/proc /data/local/debian/sys /data/local/debian/sdcard /data/local/debian/dev
export PATH=$OLDPATH
echo "Filesystems have unmounted"
Create another file, called vnc with the following contents:
Code:
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 1280x720
(you could change the resolution of the X11 desktop there )
And at last, create the last file called xstartup. Take care here, if you have choosed LXDE, use the following:
Code:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession
But if you've choosed IceWM, then use:
Code:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
xterm
Here, we have to run commands, but in the phones shell (adb, ssh, terminal emulator).
Remember to mount the SD again (in the case that youre using USB SD Massive storage).
Well, we have to get root access in the shell, so you have to root your Defy first. If you have root acces, then run the following in your mobile:
Code:
mkdir /data/local/debian
cp /sdcard/bootdeb /data/local
busybox tar -xvf /sdcard/debian.tar.bz2 -C /data/local
rm /data/local/debian/root/.vnc/xstartup
cp /sdcard/xstartup /data/local/debian/root/.vnc/xstartup
cp /sdcard/vnc /data/local/debian/bin/vnc
ln -s /data/local/bootdeb /system/bin/bootdeb
chmod 0755 /data/local/bootdeb
chmod 0755 /data/local/debian/bin/vnc
If everything worked and no errors appeared, then you can run debian via your Terminal Emulator:
Code:
bootdeb
And you should get the debian shell, and then run:
Code:
vnc
to start vnc server on localhost. Take note of the localhost:x (where x is a number). That number is what you have to use to connect, I mean:
If the number is 1:
the port is 5901
If the number is 9:
the port is 5909
Thats all!
I will try to make a yaffs2 image to mount, but I really dont trust on the mount command, because it gives me a lot of errors, even with correct stuff.
Some Screenshots:
pictures are 403 Otherwise great stuff dude!
Did you tried Debian 6.0?
Lenny = 5.0
Squeeze = 6.0
Code:
build-arm-chroot --verbose --arch=armel --foreign squeeze debian http://ftp.us.debian.org/debian
For the dumb ppl here, the second screenshot is of your phone running an OS?
Sent from my MB525 using XDA App
bash: build-arm-chroot: command not found
which package.deb include build-arm-chroot?
To see the pics : right-clic => open image in new tab
DrogenDiego said:
pictures are 403 Otherwise great stuff dude!
Click to expand...
Click to collapse
Don't work for me to
mick711 said:
Don't work for me to
Click to expand...
Click to collapse
DONT click on the link. Copy the link location or the url and then paste in url browser.
Echo " COCUS WAS HERE (I hate JAVA) ".... nevertheless well done. I will try it with squeeze.
I was wondering what exactly is the final result here, maybe a REMOTE lxde (GUI for debian) for my defy running on PC or something like that..
well i got my answer here:
http://www.androidfanatic.com/community-forums.html?func=view&catid=9&id=1615
So, if you have the same doubt, NO, it's not a remote desktop, it is debian + lxde (or IceWm) running directly on your defy.
The connection through vnc is just a workaround to make it working.
Thanks Cocus for your nice step-by-step guide.
Hi. Thanks for the feedback. I've reuploaded the images to imageshack, now you can see them without any 403.
johnw.xda said:
bash: build-arm-chroot: command not found
which package.deb include build-arm-chroot?
Click to expand...
Click to collapse
Hi john, are you running the command in Debian or Ubutnu?
Did you run the command of debootstrap?
Code:
# apt-get install debootstrap
walter79 said:
Did you tried Debian 6.0?
Lenny = 5.0
Squeeze = 6.0
Code:
build-arm-chroot --verbose --arch=armel --foreign squeeze debian http://ftp.us.debian.org/debian
Click to expand...
Click to collapse
Nope, I haven't tryied it. In fact, I was trying to get it working. Now I would try to do some interesting things.
chaihg said:
For the dumb ppl here, the second screenshot is of your phone running an OS?
Sent from my MB525 using XDA App
Click to expand...
Click to collapse
In fact, the kernel is the one that the phone booted. The only thing that I've done, is changing the root (/) path to another one, that is like swap the filesystem to another one. The other path, contains the debian root, so you will have a debian root, instead the default of your phone. With that, we can use the debian (armel) features, like aptitude (apt-get install) and such.
If anyone knowns how to mount images on loop or any thing like, please feel free to comment. I'm running out of space in my device (almost 10mb left). So, the image mount could be the best option, but I can't figure how to do that in the stock kernel.
cocus said:
Hi. Thanks for the feedback....
Click to expand...
Click to collapse
Hi cocus,
is there any way to get it working without the vnc part? I mean, it would be great if we could load debian and lxde from our defy regardless of the vnc connection.
If i'm not wrong, to boot propely it needs to load some drivers from PC, that's why we need the vnc. Is it correct?
xdaid said:
Hi cocus,
is there any way to get it working without the vnc part? I mean, it would be great if we could load debian and lxde from our defy regardless of the vnc connection.
If i'm not wrong, to boot propely it needs to load some drivers from PC, that's why we need the vnc. Is it correct?
Click to expand...
Click to collapse
The fact is, debian doesn't have access to the display. I really don't know why, because I'm kinda dumb on linux stuff.
If somebody knowns how to add graphical support (display), and/or mouse (touchscreen), it would be great. And, we could just close the dalvik and run the debian (a lot of ram would be free to use).
Now im trying to use the camera, audio and mic. They appears in /dev/, so the drivers are working fine, but I don't know with application to use.
If you can install Debian on a Defy, why isn't it possible to install Gingerbread ? :/
geecko said:
If you can install Debian on a Defy, why isn't it possible to install Gingerbread ? :/
Click to expand...
Click to collapse
Not exactly installed. Let me clarify it.
The linux file system consists of directories and start at the root directory. (/). Imagine the Windows95 directory, and change the boot to the path of Windows98. Technically what boots (in this case the kernel) is the same, but what changes is the directory. So you'll have a working Debian, as if it were actually installed, but it really is not.
Debian can not access the screen (at least I do not know how to set it up) so you have to use VNC server locally to access the X11 (display manager).
Take into account that anything here is emulated at all, is running all native.
I really don't known nothing about Gingerbread.
cocus said:
Hi john, are you running the command in Debian or Ubutnu?
Did you run the command of debootstrap?
Code:
# apt-get install debootstrap
Click to expand...
Click to collapse
hi cocus, yes i did install debootstrap, on my debian/and64.
dpkg -L debootstrap can not found build-arm-chroot too
which debian are you using? mine is unstable + testing.
thank you.
johnw.xda said:
hi cocus, yes i did install debootstrap, on my debian/and64.
dpkg -L debootstrap can not found build-arm-chroot too
which debian are you using? mine is unstable + testing.
thank you.
Click to expand...
Click to collapse
Hi, I'm using Lenny on x86. (VM is VMWare Workstation).
You could download the netinstall iso, and install on a new VM.
It might be a problem with your AMD64. Thus I don't really know. Try installing x86 on a VM.
cocus said:
Hi, I'm using Lenny on x86. (VM is VMWare Workstation).
You could download the netinstall iso, and install on a new VM.
It might be a problem with your AMD64. Thus I don't really know. Try installing x86 on a VM.
Click to expand...
Click to collapse
can you show me the output?
shell$ dpkg -S build-arm-chroot
also
shell$ which build-arm-chroot
and
shell$ dpkg -L debootstrap | grep build-arm-chroot
thank you.
johnw.xda said:
can you show me the output?
shell$ dpkg -S build-arm-chroot
also
shell$ which build-arm-chroot
and
shell$ dpkg -L debootstrap | grep build-arm-chroot
thank you.
Click to expand...
Click to collapse
Hi. I've done all of that, but without any outputs, and a lot of errors. I've researched, and I've made a mistake in my info.
Replace build-arm-chroot with debootstrap. Its the same.
(now edited on the main post)
Sorry for the inconvenience.
cocus said:
Hi. I've done all of that, but without any outputs, and a lot of errors. I've researched, and I've made a mistake in my info.
Replace build-arm-chroot with debootstrap. Its the same.
(now edited on the main post)
Sorry for the inconvenience.
Click to expand...
Click to collapse
ok. i will retry it, when i back to home.
thank you.
can you run vim on your defy?
i really miss it, when i want to edit plain text file.

[Noob Friendly] How to build CM 12.1 for Flamingo

Hello guys,
Soo there was thread made by Vynikal but its some kind of dead and outdated for cm 12.1, i managed to make everything work on my pc and want to help everyone who has problems with building CM12.1 for Flamingo.
ATTENTION!:I or xda-dev are not responsible for any damage to your device,eyes or life, made by hapiness of having cm12.1 built
Requirements:
-Ubuntu 64bit: Tuto
-Stable internet connection, no mobile connection(its not stable enough)
-About 100GB of disk space(if you screw something up you will have some in reserve)
-All fastboot,flashboot and adb drivers installed
-Beefy pc
Lets begin:​We will start with preparations
Lets install JDK.
Code:
sudo apt-get update
then:
Code:
sudo apt-get install openjdk-7-jdk
Now you will need to install build packages, they are needed for building CyanogenMod.
Type this in terminal:
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-7-jdk openjdk-7-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
You will also need USB access for extracting blobs.
Code:
sudo nautilus
This will open file manager as root.
Now you must go through several steps:
1.Click Computer in the left tray of file manager - you will see some folders like: etc
2.Open Folders etc/udev/rules.d/
3.Create new document and name it: 51-android.rules
4.You can close file manager now.
If you done that 4 steps now we can continue. lets fill up that file.
Copy paste that command to console:
Code:
wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
and change <username> to your ubuntu username. in my case it will look like this:
Code:
wget -S -O - http://source.android.com/source/51-android.rules | sed "s/dominik/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
Now we need to create some directories:
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
Last thing before loong downloading - repo command:
In terminal type:
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Now you will need to open .bashrc with gedit its in home (you will see it if you enable Show hidden files or CTRL+H)
add that at the end of file:
Code:
export PATH=~/bin:$PATH
Now open .profile with gedit same as .bashrc its in default direction
paste this code to that file:
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Initializing the repo:​Type in terminal:
Code:
cd ~/android/system
repo init -u git://github.com/CyanogenMod/android.git -b cm-12.1
Finally add local_manifest directory and copy-paste file included in attachment(thanks almighty Vynikal)
Code:
Code:
mkdir -p ~/android/system/.repo/local_manifests
And dont-click-the-red-button like command:
Code:
repo sync
And one more command to repair some duplicates in sepolicy
Code:
cd external/sepolicy
git revert 79ff523ac99b339914ccaa754e068072d64da542
Now i have Good and Bad news:
Good: we've done with the preparations.
Bad: this is not the end :silly:
Exporting blobs:​Its kinda tricky now, you will need hiper super duper stock rom and USB debugging toggled on + you need to connect your device to ubuntu, just go to devices/usb and chose your phone (its up in the vm tray)
First make sure that you allowed usb debugging(that window that will pop up in phone)
Once again open .profile and copy-paste this:
Code:
if [ -d "<path-to-sdk>/platform-tools" ] ; then
PATH="<path-to-sdk>/platform-tools:$PATH"
fi
And run that command in terminal to install adb and fastboot drivers.
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
Now enter that commands in terminal:
Code:
cd ~/android/system/device/sony/flamingo
./extract-files.sh
Setting up and preparing our files to building
Code:
cd ~/android/system
. build/envsetup.sh
breakfast flamingo
Build
Code:
brunch flamingo
============================================+#@#+============================================
Thanks to:
[email protected] for creating his tuto for cm12 and manifests
-visi0nary He helped me the most with several problems that we will fix in next post
-Others that i forgot sorry and send me PM (will add you)
pc:
i5 4460
2x g.skill ripjawsx cl7 1600mhz 4gb
took about 2h with ccache
Troubleshooting​Any problems? just post logs and wait for response.
When i was building that CM i had some problems with paths like i said in first post it gave me something like this
Code:
find: `dummy': No such file or directory
find: `../../../../../../external/hamcrest/src': No such file or directory
find: `../../../../../../external/junit/src/org': No such file or directory
find: `../../../../../../external/hamcrest/src': No such file or directory
make: Entering directory `/home/dominik/android/system'
build/core/copy_headers.mk:15: warning: overriding commands for target `/home/dominik/android/system/out/target/product/flamingo/obj/include/qcom/display/copybit.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `/home/dominik/android/system/out/target/product/flamingo/obj/include/qcom/display/copybit.h'
build/core/copy_headers.mk:15: warning: overriding commands for target `/home/dominik/android/system/out/target/product/flamingo/obj/include/qcom/display/copybit_priv.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `/home/dominik/android/system/out/target/product/flamingo/obj/include/qcom/display/copybit_priv.h'
build/core/Makefile:46: warning: overriding commands for target `/home/dominik/android/system/out/target/product/flamingo/system/bin/wcnss_service'
build/core/base_rules.mk:550: warning: ignoring old commands for target `/home/dominik/android/system/out/target/product/flamingo/system/bin/wcnss_service'
PRODUCT_COPY_FILES vendor/sony/msm8226-common/proprietary/vendor/etc/audio_effects.conf:system/vendor/etc/audio_effects.conf ignored.
No private recovery resources for TARGET_DEVICE flamingo
make -C kernel/sony/msm8974 O=/home/dominik/android/system/out/target/product/flamingo/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE="/home/dominik/android/system/prebuilts/misc/linux-x86/ccache/ccache arm-eabi-" VARIANT_DEFCONFIG= SELINUX_DEFCONFIG= aosp_yukon_flamingo_defconfig
make[1]: Entering directory `/home/dominik/android/system/kernel/sony/msm8974'
target SharedLib: libm (/home/dominik/android/system/out/target/product/flamingo/obj/SHARED_LIBRARIES/libm_intermediates/LINKED/libm.so)
[B][COLOR="Red"]target SharedLib: libstdc++ (/home/dominik/android/system/out/target/product/flamingo/obj/SHARED_LIBRARIES/libstdc++_intermediates/LINKED/libstdc++.so)
/home/dominik/android/system/out/target/product/flamingo/obj/ETC/file_contexts_intermediates/file_contexts: Multiple different specifications for /sys/devices/virtual/graphics/fb0/rgb (ubject_r:livedisplay_sysfs:s0 and ubject_r:sysfs_display:s0).
Error loading context file from /home/dominik/android/system/out/target/product/flamingo/obj/ETC/file_contexts_intermediates/file_contexts[/COLOR][/B]
make: *** [/home/dominik/android/system/out/target/product/flamingo/obj/ETC/file_contexts_intermediates/file_contexts] Error 4
make: *** Deleting file `/home/dominik/android/system/out/target/product/flamingo/obj/ETC/file_contexts_intermediates/file_contexts'
make: *** Waiting for unfinished jobs....
GEN /home/dominik/android/system/out/target/product/flamingo/obj/KERNEL_OBJ/Makefile
#
# configuration written to .config
#
make[1]: Leaving directory `/home/dominik/android/system/kernel/sony/msm8974'
make: Leaving directory `/home/dominik/android/system'
#### make failed to build some targets (02:17 (mm:ss)) ####
i marked that place. visi0nary told me that 2 files has same paths that interfere each other and doesnt allow to continue with build. soo we found solution, but idk if its my fault or its some typo or other kind of mistake
Fix:
1. Go to android/system/device/sony/msm8226-common/sepolicy
2. Open file_contexts in gedit and add # before last line
it should look like this:
Code:
# Trim Area daemon
/dev/socket/tad u:object_r:tad_socket:s0
# CPU governor controls
/dev/socket/mpdecision(/.*)? u:object_r:mpctl_socket:s0
/dev/socket/mpctl u:object_r:mpctl_socket:s0
/dev/pn547 u:object_r:nfc_device:s0
/dev/block/platform/msm_sdcc\.1/by-name/modemst1 u:object_r:modem_efs_partition_device:s0
/dev/block/platform/msm_sdcc\.1/by-name/modemst2 u:object_r:modem_efs_partition_device:s0
/dev/block/platform/msm_sdcc\.1/by-name/fsg u:object_r:modem_efs_partition_device:s0
/dev/block/platform/msm_sdcc\.1/by-name/TA u:object_r:trim_area_partition_device:s0
/data/system/default_values u:object_r:mpctl_data_file:s0
/system/bin/sct_service u:object_r:sct_exec:s0
/system/bin/tad_static u:object_r:tad_exec:s0
/system/bin/ta_qmi_service u:object_r:ta_qmi_exec:s0
/system/bin/thermanager u:object_r:thermanager_exec:s0
#/sys/devices/virtual/graphics/fb0/rgb -- u:object_r:sysfs_display:s0
for actual moment cm 12.1 dont work at all
Woah, it's been a long time since I stopped visiting this forum.
Your tut is kinda good, but I can't tell if something has changed in the past.
Actually those blobs you are extracting should be located in this repo, which is also downloaded through local_manifests, so maybe extracting them again is useless.
Bad luck, this device feels abandoned since the begining.
But hey, does it boot? If yes, progress has been made :cyclops:
Vynikal said:
Woah, it's been a long time since I stopped visiting this forum.
Your tut is kinda good, but I can't tell if something has changed in the past.
Actually those blobs you are extracting should be located in this repo, which is also downloaded through local_manifests, so maybe extracting them again is useless.
Bad luck, this device feels abandoned since the begining.
But hey, does it boot? If yes, progress has been made :cyclops:
Click to expand...
Click to collapse
nope dont boot at all at any build
and yeah they should be downloaded with it but somehow when i was compiling it there was error that prevented from building it, after extracting that blobs(something might be missing) everyhing went ok
ps. sorry that i used your thread without permission
MasterDomino said:
nope dont boot at all at any build
and yeah they should be downloaded with it but somehow when i was compiling it there was error that prevented from building it, after extracting that blobs(something might be missing) everyhing went ok
ps. sorry that i used your thread without permission
Click to expand...
Click to collapse
No worries, I have no plans on this forum. My E3 is broken, beaten and scarred. And with Firefox OS installed.
I was always wondering why the hell no CM12 build boots. I guess I won't know anytime soon.
Vynikal said:
No worries, I have no plans on this forum. My E3 is broken, beaten and scarred. And with Firefox OS installed.
I was always wondering why the hell no CM12 build boots. I guess I won't know anytime soon.
Click to expand...
Click to collapse
me and visi0nary found out it's propably fstab because adb not even toggles, its propably problem with mounting :/
Is this will work for all varian?
useone07 said:
Is this will work for all varian?
Click to expand...
Click to collapse
propably not because it doesnt work for my wariant(selinux or fstab problem ) cm 12 works perfectly but on D2203, idk about other wariants.

Error while building RedWolf recovery: cp does not take correct arguments

I am currently compiling a Red Wolf custom recovery for Xiaomi Mi A2 lite (daisy). Sources are synced, device tree etc. all set up correctly. Now I am facing a rather banal-looking error during build. cp refuses to copy a directory, because -r is not specified in the build file.
I obviously tried to find the build file (rw_recovery/out/build_omni_daisy.ninja) and add the -r argument, but it seems to be regenerated at the beginning of every build process, as the process still fails and the previously changed line appears unchanged when opening the file after the attempted build.
These are the build steps:
Code:
. build/envsetup.sh
lunch omni_daisy-eng #config for the device
mka bootimage #device uses boot.img as recovery
This command leaves me with the following error:
Code:
[ 99% 6883/6884] Prebuilt (rw_recovery/out/target/product/daisy/kernel)
FAILED: rw_recovery/out/target/product/daisy/kernel
/bin/bash -c "(rm -f /home/luca/rw_recovery/out/target/product/daisy/kernel) && (cp rw_recovery/out/target/product/daisy/obj/KERNEL_OBJ/arch/arm64/boot/ rw_recovery/out/target/product/daisy/kernel )"
cp: -r not specified; omitting directory 'rw_recovery/out/target/product/daisy/obj/KERNEL_OBJ/arch/arm64/boot/'
ninja: build stopped: subcommand failed.
17:13:06 ninja failed with: exit status 1
I would love to hear any suggestions about how to force ninja to execute the command with -r. Alternatively, suggestions about where to find the file from which the above mentioned build file is recreated after executing mka command are much welcomed as well.

Building LineageOS 16.0

Hi,
I'd ask this in the development forum but unfortunately that has a 10 post minimum, and i currently have 1 post.
I'm trying to compile lineage-16.0 for zerofltexx.
I tried using the local_manifests file from various github repositories (for instance enesuzun2002's and TeamNexus's) but am running into errors with android_hardware_samsung_slsi-cm_exynos7420.
I was wondering if someone could shine some light on how i would go about compiling this.
The errors i am running into are:
hardware/samsung_slsi-cm/exynos7420/mobicore/daemon/Common/CWsm.h:56:33: error: implicit conversion of NULL constant to 'uint64_t' (aka 'unsigned long') [-Werror,-Wnull-conversion]
hardware/samsung_slsi-cm/exynos7420/mobicore/daemon/Daemon/MobiCoreDriverDaemon.cpp:217:56: error: unused parameter 'connection' [-Werror,-Wunused-parameter]
To name a few (more information can easily be provided).
Since this repository hasnt been updated in quite some time and there are multiple unofficial roms for the zerofltexx i imagine i am doing something utterly wrong.
Does anyone have any experience with this?
Thanks a lot
Edit:
Building on Ubuntu 18.04
:good:
Use slsi repos of @ripee
ripee-zero
I pushed my local manifests as well
All devving courtesy of enesuzun2002.
ripee said:
github.com/ripee-zero
I pushes my local manifests as well
All devving courtesy of enesuzun2002.
Click to expand...
Click to collapse
Thanks a lot!
I'll try it out
ripee said:
github.com/ripee-zero
I pushes my local manifests as well
All devving courtesy of enesuzun2002.
Click to expand...
Click to collapse
Thanks so much for the help so far, i really appreciate it.
I've tried compiling with your local_manifests and it gets past the errors that i posted before.
It gets all the way to around 96% but unfortunately still gets a build error.
Is this something i've misconfigured?
The current build error is:
Code:
[ 2% 100/3408] Hidden API: /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar
FAILED: /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar
/bin/bash -c "(rm -f /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar ) && (cp \"/home/subcode/android/lineage/out/soong/.intermediates/frameworks/base/test-base/android.test.base/android_common/dex/android.test.base.jar\" \"/home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar\" ) && (rm -rf /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (mkdir -p /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (unzip -q /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar 'classes*.dex' -d /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (find /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi -name \"classes*.dex\" | sort | sed 's/^/--dex=/' | xargs /home/subcode/android/lineage/out/host/linux-x86/bin/hiddenapi --light-greylist=/home/subcode/android/lineage/out/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt --dark-greylist=/home/subcode/android/lineage/out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt --blacklist=/home/subcode/android/lineage/out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt ) && (/home/subcode/android/lineage/out/soong/host/linux-x86/bin/soong_zip -o /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar -C /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi -D /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (/home/subcode/android/lineage/out/soong/host/linux-x86/bin/merge_zips -D -zipToNotStrip /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar -stripFile \"classes*.dex\" /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar /home/subcode/android/lineage/out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar /home/subcode/android/lineage/out/soong/.intermediates/frameworks/base/test-base/android.test.base/android_common/dex/android.test.base.jar )"
xargs: /home/subcode/android/lineage/out/host/linux-x86/bin/hiddenapi: terminated by signal 4
[ 3% 105/3408] Building Kernel Config
make: Entering directory '/home/subcode/android/lineage/kernel/samsung/exynos7420'
GEN /home/subcode/android/lineage/out/target/product/zerofltexx/obj/KERNEL_OBJ/Makefile
Kconfig:15:warning: environment variable ANDROID_MAJOR_VERSION undefined
arch/arm64/configs/lineageos_zerofltexx_defconfig:475:warning: override: reassigning to symbol IKCONFIG
#
# configuration written to .config
#
make: Leaving directory '/home/subcode/android/lineage/kernel/samsung/exynos7420'
make: Entering directory '/home/subcode/android/lineage/kernel/samsung/exynos7420'
GEN /home/subcode/android/lineage/out/target/product/zerofltexx/obj/KERNEL_OBJ/Makefile
scripts/kconfig/conf --savedefconfig=defconfig Kconfig
Kconfig:15:warning: environment variable ANDROID_MAJOR_VERSION undefined
make: Leaving directory '/home/subcode/android/lineage/kernel/samsung/exynos7420'
ninja: build stopped: subcommand failed.
12:28:24 ninja failed with: exit status 1
Edit: I've just found something that says its possibly a CPU problem.
Since i'm building inside a VM, i'll try building without a VM to see if this fixes the problem.
Edit2: Unfortunately compiling outside of my VM did not work.
Kyrraz said:
Edit: I've just found something that says its possibly a CPU problem.
Since i'm building inside a VM, i'll try building without a VM to see if this fixes the problem.
Click to expand...
Click to collapse
Reduce the amount of RAM and number of cores assigned to your vm.
ripee said:
Reduce the amount of RAM and number of cores assigned to your vm.
Click to expand...
Click to collapse
Any specific number i should be looking for?
edit: 1 core and 8GB of ram did not change anything, but since the other solution i found said its that i'm missing SSE4.1 support in my cpu im not sure less of anything would be better?
I'll try building on a different CPU, but this will be tomorrow at the earliest unfortunately.
Here's a late update,
Building with a more modern CPU did the trick, apparently you really do need SSE4.1 support.
Thanks a lot!
I have the same error but my CPU have SSE 4.1 support

Categories

Resources