[patch] Android Shell (mksh) bash_profile replacement - Android General

Android default shell is a bit tricky when you want to do customiztaion. So, i just happen to browsing a bit to its source and do a little patch. This is a bit dangerous coz it'll automatically eval the .shinit in /sdcard/ which we know some apps wight r/w that file, use with caution. Tested on x86, 4.4.2. ASUS Zenfone C.
Patch,
Code:
diff --git a/src/main.c b/src/main.c
index ebbadd9..712d5f9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -38,6 +38,10 @@ __RCSID("$MirOS: src/bin/mksh/main.c,v 1.322 2016/11/11 23:48:30 tg Exp $");
extern char **environ;
+#ifndef FORCE_LOAD
+#define FORCE_LOAD "/sdcard/.shinit"
+#endif
+
#ifndef MKSHRC_PATH
#define MKSHRC_PATH "~/.mkshrc"
#endif
@@ -619,6 +623,7 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
if (cp[0] != '\0')
include(cp, 0, NULL, true);
}
+ include(FORCE_LOAD, 0, NULL, true);
} else {
include(MKSH_SUID_PROFILE, 0, NULL, true);
/* turn off -p if not set explicitly */
Build-step, tweak a bit to compatible with your phone.
Code:
# clone repo
$ git clone https://android.googlesource.com/platform/external/mksh
# setting up standalone-toolchain
$ $NDK_ROOT/build/tools/make_standalone_toolchain.py --api 19 --install-dir toolchain/ --arch x86
$ export CROSS=toolchain/bin/i686-linux-android
$ export CC=${CROSS}-gcc
$ export AS=${CROSS}-as
$ export LD=${CROSS}-ld
$ export AR=${CROSS}-ar
# Apply patch
$ patch src/main.c android.patch
# Build time!
$ ./src/Build.sh
Push and replace mksh to android, dont forget to make a backup for original mksh in case things goes wrong.
This mksh will force load .shinit in /sdcard/ (/sdcard/.shinit). example for my .shinit,
Code:
export PATH=/data/local/bin:$PATH
alias bash='bash --rcfile /sdcard/bashrc'
alias gdb='gdb -q'
alias ll='ls -laH'

Related

floating point arithmetic? - hack job workaround now included

is there a way to do floating point arithmetic in terminal?...or would bc binary need to be included since busybox does not have it? as of now you get a syntax error if using fp numbers in expression..or 0 when using division and result is a floating point.
Code:
# echo $(( 1 + 1 ))
echo $(( 1 + 1 ))
2
# echo $(( 1.0 + 1.0 ))
echo $(( 1.0 + 1.0 ))
arith: syntax error: " 1.0 + 1.0 "
# echo $(( 1 / 2 ))
echo $(( 1 / 2 ))
0
sh/bash has no native support for floating point math, so your solution must involve a binary executable. You can either use bc, or you can write a very simple C program and compile it for this platform....
i.e.,
Code:
//math.c
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char ** argv){
float a = atof(argv[1]);
char op = argv[2][0];
float b = atof(argv[3]);
if (op == '+') printf("%f\n",a+b);
else if (op == '-') printf("%f\n",a-b);
else if (op == 'x') printf("%f\n",a*b);
else if (op == '/') printf("%f\n",a/b);
return 0;
}
$ ./math 1.5 + 2
3.500000
$ ./math 1.5 x 2
3.000000
$ ./math 1.5 - 2
-0.500000
$ ./math 1.5 / 2
0.750000
Oh and FYI, don't forget you can use variables in there, i.e.
$ A=1.5
$ B=2
$ OP=/
$./math $A $OP $B
0.750000
Is this the appropriate forum?
jdstankosky said:
Is this the appropriate forum?
Click to expand...
Click to collapse
Sorry, are you a moderator? :/
And yes, since this is a development matter, I'd say it falls within the DEVELOMPENT section..
lbcoder said:
sh/bash has no native support for floating point math, so your solution must involve a binary executable. You can either use bc, or you can write a very simple C program and compile it for this platform....
i.e.,
Code:
//math.c
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char ** argv){
float a = atof(argv[1]);
char op = argv[2][0];
float b = atof(argv[3]);
if (op == '+') printf("%f\n",a+b);
else if (op == '-') printf("%f\n",a-b);
else if (op == 'x') printf("%f\n",a*b);
else if (op == '/') printf("%f\n",a/b);
return 0;
}
$ ./math 1.5 + 2
3.500000
$ ./math 1.5 x 2
3.000000
$ ./math 1.5 - 2
-0.500000
$ ./math 1.5 / 2
0.750000
Oh and FYI, don't forget you can use variables in there, i.e.
$ A=1.5
$ B=2
$ OP=/
$./math $A $OP $B
0.750000
Click to expand...
Click to collapse
thanks for the info. very helpful.
script workaround
i have constructed a workaround for doing fp math for determining partition sizes.
it's not pretty, but it gets the job done.
basically, it goes like this:
1. check to see if the number passed to the function is an integer
2. if not, i search the string for a "."
3. if the search turns up a "." (and units in GB) i break the number into two whole numbers (the integer portion..before the decimal, and the fraction portion after the decimal).
4. do the appropriate math on the integer section.
5. do the appropriate math on the fraction section, then divide by 10^#of digits after the decimal place.
6. add the two numbers together and voila! a hack job, floating point calculation.
Code:
ValidateSizeArg() {
# check for zero-length arg to protect expr length
[ -z "$1" ] && ShowError "zero-length argument passed to size-validator"
SIZEMB=
ARGLEN=`expr length $1`
SIZELEN=$(($ARGLEN-1))
SIZEARG=`expr substr $1 1 $SIZELEN`
SIZEUNIT=`expr substr $1 $ARGLEN 1`
# check if SIZEARG is an integer
if [ $SIZEARG -eq $SIZEARG 2> /dev/null ] ; then
# look for G
[ "$SIZEUNIT" == "G" ] && SIZEMB=$(($SIZEARG * 1024))
# look for M
[ "$SIZEUNIT" == "M" ] && SIZEMB=$SIZEARG
# no units on arg
[ -z "$SIZEMB" ] && SIZEMB=$1
# check if SIZEARG is a floating point number, GB only
elif [ `expr index "$SIZEARG" .` != 0 ] && [ "$SIZEUNIT" == "G" ] ; then
INT=`echo "$SIZEARG" | cut -d"." -f1`
FRAC=`echo "$SIZEARG" | cut -d"." -f2`
SIGDIGITS=`expr length $FRAC`
[ -z "$INT" ] && INT=0
INTMB=$(($INT * 1024))
FRACMB=$((($FRAC * 1024) / (10**$SIGDIGITS)))
SIZEMB=$(($INTMB + $FRACMB))
# it's not a valid size
else
ShowError "$1 is not a valid size"
fi
# return valid argument in MB
FUNC_RET=$SIZEMB
}
I was a basic/qbasic/gwbasic programmer in my younger days (like 12-14 yrs old)...
I feel ashamed that I have no idea of what this stuff is anymore. Thank God for guys like you.

j4fs driver is now OpenSource

Big news for every hacker on Samsung devices! j4fs driver is now OpenSource Enjoy: http://bit.ly/jatK1c
Click to expand...
Click to collapse
http://romkitchen.org/sgs/?s=home
Someone care to explain the benefits, if any, of this? My understanding from what little i read is it will help with kernal development on a decent number of samsung devices.
Edit: as in should i be "super excited", "meh", or "cool beans".
second that question .. does this help us?
Would this driver be the one that controls download mode?
Sent from my GT-I9000 using XDA Premium App
Maybe this?
added: Should have checked supercurio's github
Samsung v1 GT-I9100 sources: [common] param.lfs/j4fs driver (communication with bootloader), now OpenSource, yay!
google :
j4fs...
its a filesystem.... FACT
So my GUESS...
a driver for a filesystem...
like ext4 and fat drivers for handling our other storage..
a new filesystem for us to tweak the crap out of and use..?
though ive been wrong before. that is only a logical conclusion not a factual statement
TRusselo said:
google :
j4fs...
its a filesystem.... FACT
So my GUESS...
a driver for a filesystem...
like ext4 and fat drivers for handling our other storage..
a new filesystem for us to tweak the crap out of and use..?
though ive been wrong before. that is only a logical conclusion not a factual statement
Click to expand...
Click to collapse
Sounds good to me.
Sent from my GT-I9000 using XDA Premium App
TRusselo said:
google :
j4fs...
its a filesystem.... FACT
So my GUESS...
a driver for a filesystem...
like ext4 and fat drivers for handling our other storage..
a new filesystem for us to tweak the crap out of and use..?
though ive been wrong before. that is only a logical conclusion not a factual statement
Click to expand...
Click to collapse
according to the post above you this may be the file system used for the bootloaders on the sgs2 so it would help those folks when hacking.
J4FS porting released
If someone is still interested I've just finished the porting of the J4FS on 3.1.x kernel adding support for normal "block device" (for loopback image mounting).
movitool.ntd.homelinux.org/trac/movitool/wiki/j4fs
Hope this can help...
Ceers
Nitro
And another tool (standalone) to extract j4fs/lfs images (eg. param.lfs).
Note: it only extracts - if you want to modify an image you'll have to use the kernel module from the post above (or a hexeditor and some cleverness).
https://github.com/ius/j4fs_extract
(for Googleability)
whiteguypl said:
http://romkitchen.org/sgs/?s=home
Someone care to explain the benefits, if any, of this? My understanding from what little i read is it will help with kernal development on a decent number of samsung devices.
Edit: as in should i be "super excited", "meh", or "cool beans".
Click to expand...
Click to collapse
dunno for what the driver/partition is used, had troubles (device freeze) with custom kernel an the original module from my GT-I9100 (ICS)
as note: device boots and working without the j4fs module in initramfs...
just for fun a little patch for kernel 3.0.15, just read operation tested.
Code:
Index: jv/llid_kernel.c
===================================================================
--- jv/llid_kernel.c (Revision 2075)
+++ jv/llid_kernel.c (Arbeitskopie)
@@ -95,7 +95,7 @@
set_fs(oldfs);
j4fs_filp->f_flags &= ~O_NONBLOCK;
if (ret < 0) {
- printk(1, "j4fs_filp->read() failed: %d\n", ret);
+ printk(KERN_WARNING "j4fs_filp->read() failed: %d\n", ret);
return J4FS_FAIL;
}
// J4FS for moviNAND merged from ROSSI
@@ -153,7 +153,7 @@
set_fs(oldfs);
j4fs_filp->f_flags &= ~O_NONBLOCK;
if (ret < 0) {
- printk(1, "j4fs_filp->write() failed: %d\n", ret);
+ printk(KERN_WARNING "j4fs_filp->write() failed: %d\n", ret);
return J4FS_FAIL;
}
// J4FS for moviNAND merged from ROSSI
Index: jv/j4fs_kernel.c
===================================================================
--- jv/j4fs_kernel.c (Revision 2075)
+++ jv/j4fs_kernel.c (Arbeitskopie)
@@ -10,7 +10,9 @@
* 2009.03 - Currently managed by SungHwan.yun <[email protected]> @[email protected]
*
*/
-#include <linux/smp_lock.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/smp.h>
#include <linux/time.h>
#include <linux/highuid.h>
#include <linux/pagemap.h>
@@ -53,6 +55,8 @@
#define Page_Uptodate(page) test_bit(PG_uptodate, &(page)->flags)
+#define init_MUTEX(sema) sema_init(sema,1)
+
extern j4fs_device_info device_info;
extern unsigned int j4fs_traceMask;
extern unsigned int j4fs_rw_start;
@@ -234,7 +238,7 @@
T(J4FS_TRACE_FS, ("start j4fs_write_begin\n"));
if(to>PAGE_CACHE_SIZE) {
- T(J4FS_TRACE_ALWAYS,("%s %d: page size overflow(pos,index,offset,len,to)=(%d,%d,%d,%d,%d)\n",__FUNCTION__,__LINE__,pos,index,offset,len,to));
+ T(J4FS_TRACE_ALWAYS,("%s %d: page size overflow(pos,index,offset,len,to)=(%llu,%lu,%d,%d,%d)\n",__FUNCTION__,__LINE__,pos,index,offset,len,to));
j4fs_panic("page size overflow");
return -ENOSPC;
}
@@ -1221,7 +1225,7 @@
struct j4fs_sb_info * sbi;
struct j4fs_super_block * es;
struct inode *root;
- u32 tmp, len,ret;
+ u32 ret;
T(J4FS_TRACE_FS,("%s %d\n",__FUNCTION__,__LINE__));
@@ -1322,11 +1326,11 @@
}
-int j4fs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *j4fs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
{
T(J4FS_TRACE_FS,("%s %d\n",__FUNCTION__,__LINE__));
- return get_sb_bdev(fs_type, flags, dev_name, data, j4fs_fill_super, mnt);
+ return mount_bdev(fs_type, flags, dev_name, data, j4fs_fill_super);
}
struct kmem_cache * j4fs_inode_cachep;
@@ -1386,7 +1390,7 @@
struct file_system_type j4fs_fs_type = {
.owner = THIS_MODULE,
.name = "j4fs",
- .get_sb = j4fs_get_sb,
+ .mount = j4fs_mount,
.kill_sb = kill_block_super,
.fs_flags = FS_REQUIRES_DEV,
};
@@ -1416,9 +1420,16 @@
return -EINVAL;
}
-int j4fs_fsync(struct file *file, struct dentry *dentry, int datasync)
+static int j4fs_fsync(struct file *file, int datasync)
{
- return 0;
+ int rc = 0;
+
+ rc = generic_file_fsync(file, datasync);
+ if (rc)
+ goto out;
+ rc = vfs_fsync(file, datasync);
+out:
+ return rc;
}
int __init init_j4fs_fs(void)
Index: jv/j4fs.h
===================================================================
--- jv/j4fs.h (Revision 2075)
+++ jv/j4fs.h (Arbeitskopie)
@@ -167,6 +167,7 @@
#define J4FS_RECLAIM_RESET_UNUSED_SPACE
#define J4FS_TRANSACTION_LOGGING
+#undef T
#define T(mask, p) do { if ((mask) & (j4fs_traceMask | J4FS_TRACE_ALWAYS)) TOUT(p); } while (0)
#define POR(mask, p, q) do { if (((mask) & (j4fs_PORMask))&&!(--j4fs_PORCount)) {TOUT(p); while(1); }} while (0)
Index: jv/Makefile
===================================================================
--- jv/Makefile (Revision 2075)
+++ jv/Makefile (Arbeitskopie)
@@ -1,31 +1,5 @@
-##############################################################################
-# COPYRIGHT(C) : Samsung Electronics Co.Ltd, 2006-2011 ALL RIGHTS RESERVED
-# 2009.02 - Currently managed by JongMinKim <[email protected]> , SungHwanYun <[email protected]>
-##############################################################################
-# VERSION&DATE : Version 1.00 2009/02
-##############################################################################
+EXTRA_CFLAGS += -Wframe-larger-than=2048 -Wno-error=declaration-after-statement
-MOD_NAME = j4fs
+obj-$(CONFIG_J4FS) += j4fs.o
-ifneq ($(KERNELRELEASE), )
-
-EXTRA_CFLAGS += -I$(PRJROOT)/modules/include -I$(KDIR)/drivers/tfsr/Inc -I$(KDIR)/include -I$(KDIR)/include/linux -I$(KDIR)/include/asm -D__KERNEL
-
-obj-m := $(MOD_NAME).o
-
-$(MOD_NAME)-y := j4fs_kernel.o llid_kernel.o fsd_common.o
-
-else
-
-all:
- @$(MAKE) -C $(KDIR) \
- SUBDIRS=$(CURDIR) modules
-
-clean:
- rm -f *.o *.ko *.mod.c *~ .*.cmd
-
-install:
- @$(MAKE) --no-print-directory -C $(KDIR) \
- SUBDIRS=$(CURDIR) modules_install
-
-endif
+j4fs-objs := j4fs_kernel.o llid_kernel.o fsd_common.o

[Q] Compiling gcc and toolchain for use ON android device

Hello all. I have built the android-ndk-r9d toolchain on my Ubuntu machine, and it will compile a few things like nmap and perl just fine with some tweaking (I forgot the links but there are projects that give the options to use when compiling these). But I haven't seen any successful compilations of more recent versions of gcc with bionic.
I did some digging around in spartacus' terminal-ide project, the point of which is to have java, vim, gcc for use on the device itself, I found that gcc was version 4.4.0. I have tried to reach him via email to see what ./configure settings he used, but to no response.
Has anyone else attempted this, to build android gcc in versions more recent than 4.4.0 for compiling software on the device? What configure settings have you tried, and how much have you modified the gcc source code itself? Or is everyone content to build other projects using their regular Linux box?
My device in question is a nexus 5, which has more than enough CPU power to do this, to quell any concerns people will have to that end.
Well, I had a day free yesterday and tried everything again, and I believe I hit the same stopping point error after correcting several others. Only this time, I made an actual script and patchfiles to handle everything to make this more organized. Again has anyone attempted to do this?
First, the script.
Code:
#!/bin/bash
HOME_DIR=/home/jmanley
GCC_BUILD_DIR=$HOME_DIR/gcc-android-build
HOST=arm-linux-androideabi
CFLAGS='-Wall -O -mandroid -mbionic'
LIBCFLAGS='-O2 -mandroid -mbionic'
LIBCPPFLAGS='-O2 -mandroid -mbionic'
LIBCXXFLAGS='-O2 -mandroid -mbionic -fno-implicit-templates'
PREFIX=/data
TOOLCHAIN_DIR=$HOME_DIR/arm-linux-androideabi-4.8
SYSROOT=$TOOLCHAIN_DIR/sysroot
GCC_VERSION=4.9.0
MPFR_VERSION=3.1.2
GMP_VERSION=6.0.0a
RENAMED_GMP_VERSION=6.0.0
MPC_VERSION=1.0.2
LDFLAGS='-lc -ldl -lgcc -lm -static'
LIBS='-lc -ldl -lgcc -lm -lsupc++ -lgnustl_shared -lgmp'
CC=arm-linux-androideabi-gcc
CXX=arm-linux-androideabi-g++
LD=arm-linux-androideabi-ld
RANLIB=arm-linux-androideabi-ranlib
AR=arm-linux-androideabi-ar
STRIP=arm-linux-androideabi-strip
PATH=$TOOLCHAIN_DIR/bin:$PATH
cd $HOME_DIR
mkdir $GCC_BUILD_DIR
tar -jxf gcc-$GCC_VERSION.tar.bz2
cd $HOME_DIR/gcc-$GCC_VERSION
tar -jxf ../gmp-$GMP_VERSION.tar.bz2
mv gmp-$RENAMED_GMP_VERSION gmp
tar -jxf ../mpfr-$MPFR_VERSION.tar.bz2
mv mpfr-$MPFR_VERSION mpfr
tar -zxf ../mpc-$MPC_VERSION.tar.gz
mv mpc-$MPC_VERSION mpc
patch -Np0 -i $HOME_DIR/getpagesize-gcc.patch
patch -Np0 -i $HOME_DIR/mpfr-impl.patch
patch -Np0 -i $HOME_DIR/libcpp-files.patch
patch -Np0 -i $HOME_DIR/libcpp-macro.patch
cd $GCC_BUILD_DIR
../gcc-$GCC_VERSION/configure \
--prefix=$PREFIX --host=$HOST --disable-option-checking --disable-ld \
--enable-shared --enable-languages=c \
--disable-bootstrap -disable-gold --disable-fortran --disable-libssp \
--disable-libquadmath --disable-libquadmath-support --disable-libada \
--disable-multilib --disable-libgomp --disable-cloog --disable-werror \
--with-sysroot=$SYSROOT --disable-nls --disable-long-long
make
sudo make install
Second, the actual error in question.
Code:
../../../gcc-4.9.0/gmp/mpz/powm_ui.c:162: error: undefined reference to '__gmpn_invert_limb'
divrem_1.c:228: error: undefined reference to '__gmpn_invert_limb'
divrem_1.c:149: error: undefined reference to '__gmpn_invert_limb'
divrem_2.c:91: error: undefined reference to '__gmpn_invert_limb'
collect2: error: ld returned 1 exit status
make[2]: *** [cc1] Error 1
make[2]: Leaving directory `/home/jmanley/gcc-android-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/jmanley/gcc-android-build'
make: *** [all] Error 2
Now, some of the patchfiles I made to fix previous errors. Is any of this recommended?
Code:
*** libiberty/getpagesize.c 2005-03-27 07:31:13.000000000 -0800
--- getpagesize.c 2014-07-13 14:59:40.270231633 -0700
***************
*** 60,71 ****
# endif /* PAGESIZE */
#endif /* GNU_OUR_PAGESIZE */
- int
- getpagesize (void)
- {
- return (GNU_OUR_PAGESIZE);
- }
-
#else /* VMS */
#if 0 /* older distributions of gcc-vms are missing <syidef.h> */
--- 60,65 ----
Code:
*** libcpp/files.c 2014-01-02 14:24:45.000000000 -0800
--- files.c 2014-07-13 19:09:23.685783988 -0700
***************
*** 716,726 ****
cpp_error (pfile, CPP_DL_WARNING,
"%s is shorter than expected", file->path);
file->buffer = _cpp_convert_input (pfile,
CPP_OPTION (pfile, input_charset),
buf, size + 16, total,
&file->buffer_start,
! &file->st.st_size);
file->buffer_valid = true;
return true;
--- 716,728 ----
cpp_error (pfile, CPP_DL_WARNING,
"%s is shorter than expected", file->path);
+ off_t ot = (off_t) file->st.st_size;
file->buffer = _cpp_convert_input (pfile,
CPP_OPTION (pfile, input_charset),
buf, size + 16, total,
&file->buffer_start,
! &ot);
! file->st.st_size = ot;
file->buffer_valid = true;
return true;
Code:
*** libcpp/macro.c 2014-02-18 22:05:55.000000000 -0800
--- macro.c 2014-07-13 19:55:27.751477291 -0700
***************
*** 250,256 ****
struct tm *tb = NULL;
struct stat *st = _cpp_get_file_stat (file);
if (st)
! tb = localtime (&st->st_mtime);
if (tb)
{
char *str = asctime (tb);
--- 250,260 ----
struct tm *tb = NULL;
struct stat *st = _cpp_get_file_stat (file);
if (st)
! {
! time_t tt = (time_t) st->st_mtime;
! tb = localtime (&tt);
! st->st_mtime = tt;
! }
if (tb)
{
char *str = asctime (tb);
Code:
*** mpfr/src/mpfr-impl.h 2013-03-13 08:37:36.000000000 -0700
--- mpfr-impl.h 2014-07-13 18:44:36.599599742 -0700
***************
*** 1135,1142 ****
#include <locale.h>
/* Warning! In case of signed char, the value of MPFR_DECIMAL_POINT may
be negative (the ISO C99 does not seem to forbid negative values). */
! #define MPFR_DECIMAL_POINT (localeconv()->decimal_point[0])
! #define MPFR_THOUSANDS_SEPARATOR (localeconv()->thousands_sep[0])
#else
#define MPFR_DECIMAL_POINT ((char) '.')
#define MPFR_THOUSANDS_SEPARATOR ('\0')
--- 1135,1142 ----
#include <locale.h>
/* Warning! In case of signed char, the value of MPFR_DECIMAL_POINT may
be negative (the ISO C99 does not seem to forbid negative values). */
! #define MPFR_DECIMAL_POINT ((char) '.')
! #define MPFR_THOUSANDS_SEPARATOR ('\0')
#else
#define MPFR_DECIMAL_POINT ((char) '.')
#define MPFR_THOUSANDS_SEPARATOR ('\0')

Patched kernel CVE-2016-5195 (aka "Dirtycow")

For those of you wanting to patch your device asap, you can download my patched kernel. This is built from the latest Samsung standard sources with a couple of minor config changes, namely the ability to change SELinux enforcing mode as boot and runtime, removal of DM_VERITY and KNOX_KAP and a couple of IPv6 / QoS items (netfilter targets, qdiscs). The full config diff is below.
If you want to use this kernel you will need to create your own bootimage. On your device
Code:
# dd if=/dev/block/platform/15540000.dwmmc0/by-name/BOOT of=/sdcard/boot.img
Unpack the boot image (you can use this tool. In the unpacked folder, replace the boot.img-zImage with the new zImage from the zip file you downloaded. Recreate the bootimage with the mkbootimg tool (all the command line args you need to supply will be in the files that the unpackbootimg command created - just plug these values back in).
Now you can adb push the new boot.img back to your device and flash it using the reverse operation
Code:
# dd if=/sdcard/boot.img of=/dev/block/platform/15540000.dwmmc0/by-name/BOOT
If you want to compile your own kernel, here's the patch. In the kernel source dir, do
Code:
$ git init
$ git add .
$ git commit -m "initial"
$ git apply CVE-2016-5195.patch
CVE-2016-5195.patch:
Code:
From 4ecebb23a13c366b5d46cd0a76f14e6c81dd2da7 Mon Sep 17 00:00:00 2001
From: DL <[email protected]>
Date: Tue, 25 Oct 2016 19:36:32 +0700
Subject: [PATCH] Dirtycow Patch - CVE-2016-5195
---
include/linux/mm.h | 1 +
mm/memory.c | 28 ++++++++++++++++++++++++----
2 files changed, 25 insertions(+), 4 deletions(-)
mode change 100755 => 100644 include/linux/mm.h
mode change 100755 => 100644 mm/memory.c
diff --git a/include/linux/mm.h b/include/linux/mm.h
old mode 100755
new mode 100644
index 93b01bb..979e4c7
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1711,6 +1711,7 @@ static inline struct page *follow_page(struct vm_area_struct *vma,
#define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */
#define FOLL_NUMA 0x200 /* force NUMA hinting page fault */
#define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */
+#define FOLL_COW 0x4000 /* internal GUP flag */
typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
void *data);
diff --git a/mm/memory.c b/mm/memory.c
old mode 100755
new mode 100644
index bcde4a1..5331526
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1497,6 +1497,16 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
}
EXPORT_SYMBOL_GPL(zap_vma_ptes);
+/*
+ * FOLL_FORCE can write to even unwritable pte's, but only
+ * after we've gone through a COW cycle and they are dirty.
+ */
+static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
+{
+ return pte_write(pte) ||
+ ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
+}
+
/**
* follow_page_mask - look up a page descriptor from a user-virtual address
* @vma: vm_area_struct mapping @address
@@ -1604,7 +1614,7 @@ split_fallthrough:
}
if ((flags & FOLL_NUMA) && pte_numa(pte))
goto no_page;
- if ((flags & FOLL_WRITE) && !pte_write(pte))
+ if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags))
goto unlock;
page = vm_normal_page(vma, address, pte);
@@ -1911,7 +1921,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
*/
if ((ret & VM_FAULT_WRITE) &&
!(vma->vm_flags & VM_WRITE))
- foll_flags &= ~FOLL_WRITE;
+ foll_flags |= FOLL_COW;
cond_resched();
}
@@ -3913,8 +3923,18 @@ retry:
if (unlikely(pmd_none(*pmd)) &&
unlikely(__pte_alloc(mm, vma, pmd, address)))
return VM_FAULT_OOM;
- /* if an huge pmd materialized from under us just retry later */
- if (unlikely(pmd_trans_huge(*pmd)))
+ /*
+ * If a huge pmd materialized under us just retry later. Use
+ * pmd_trans_unstable() instead of pmd_trans_huge() to ensure the pmd
+ * didn't become pmd_trans_huge under us and then back to pmd_none, as
+ * a result of MADV_DONTNEED running immediately after a huge pmd fault
+ * in a different thread of this mm, in turn leading to a misleading
+ * pmd_trans_huge() retval. All we have to ensure is that it is a
+ * regular pmd that we can walk with pte_offset_map() and we can do that
+ * through an atomic read in C, which is what pmd_trans_unstable()
+ * provides.
+ */
+ if (unlikely(pmd_trans_unstable(pmd)))
return 0;
/*
* A regular pmd is established and it can't morph into a huge pmd
--
1.8.3.1
diff -Naur arch/arm/configs/trelte_00_defconfig .config
Code:
--- arch/arm/configs/trelte_00_defconfig 2016-03-01 17:00:22.000000000 +0700
+++ .config 2016-10-18 19:21:17.000000000 +0700
@@ -102,7 +102,8 @@
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_BOOST is not set
# CONFIG_RCU_NOCB_CPU is not set
-# CONFIG_IKCONFIG is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=19
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
@@ -391,7 +392,7 @@
CONFIG_RKP_DBLMAP_PROT=y
CONFIG_HYP_RKP=y
CONFIG_TIMA_RKP_30=y
-CONFIG_KNOX_KAP=y
+# CONFIG_KNOX_KAP is not set
CONFIG_TIMA_RKP_L1_TABLES=y
# CONFIG_TIMA_RKP_L2_TABLES is not set
# CONFIG_TIMA_RKP_DEBUG is not set
@@ -741,9 +742,23 @@
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_INET_UDP_DIAG is not set
-# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_ADVANCED=y
+# CONFIG_TCP_CONG_BIC is not set
CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_CONG_WESTWOOD=y
+# CONFIG_TCP_CONG_HTCP is not set
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_DEFAULT_CUBIC is not set
+CONFIG_DEFAULT_WESTWOOD=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="westwood"
# CONFIG_TCP_MD5SIG is not set
CONFIG_IPV6=y
CONFIG_IPV6_PRIVACY=y
@@ -839,7 +854,7 @@
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
# CONFIG_NETFILTER_XT_TARGET_CT is not set
# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
-# CONFIG_NETFILTER_XT_TARGET_HL is not set
+CONFIG_NETFILTER_XT_TARGET_HL=y
# CONFIG_NETFILTER_XT_TARGET_HMARK is not set
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_LOG=y
@@ -948,16 +963,16 @@
CONFIG_NF_DEFRAG_IPV6=y
CONFIG_NF_CONNTRACK_IPV6=y
CONFIG_IP6_NF_IPTABLES=y
-# CONFIG_IP6_NF_MATCH_AH is not set
-# CONFIG_IP6_NF_MATCH_EUI64 is not set
-# CONFIG_IP6_NF_MATCH_FRAG is not set
-# CONFIG_IP6_NF_MATCH_OPTS is not set
-# CONFIG_IP6_NF_MATCH_HL is not set
-# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
-# CONFIG_IP6_NF_MATCH_MH is not set
-# CONFIG_IP6_NF_MATCH_RPFILTER is not set
-# CONFIG_IP6_NF_MATCH_RT is not set
-# CONFIG_IP6_NF_TARGET_HL is not set
+CONFIG_IP6_NF_MATCH_AH=y
+CONFIG_IP6_NF_MATCH_EUI64=y
+CONFIG_IP6_NF_MATCH_FRAG=y
+CONFIG_IP6_NF_MATCH_OPTS=y
+CONFIG_IP6_NF_MATCH_HL=y
+CONFIG_IP6_NF_MATCH_IPV6HEADER=y
+CONFIG_IP6_NF_MATCH_MH=y
+CONFIG_IP6_NF_MATCH_RPFILTER=y
+CONFIG_IP6_NF_MATCH_RT=y
+CONFIG_IP6_NF_TARGET_HL=y
CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_TARGET_REJECT_SKERR=y
@@ -987,39 +1002,39 @@
#
# Queueing/Scheduling
#
-# CONFIG_NET_SCH_CBQ is not set
+CONFIG_NET_SCH_CBQ=y
CONFIG_NET_SCH_HTB=y
-# CONFIG_NET_SCH_HFSC is not set
-# CONFIG_NET_SCH_PRIO is not set
+CONFIG_NET_SCH_HFSC=y
+CONFIG_NET_SCH_PRIO=y
# CONFIG_NET_SCH_MULTIQ is not set
# CONFIG_NET_SCH_RED is not set
# CONFIG_NET_SCH_SFB is not set
-# CONFIG_NET_SCH_SFQ is not set
+CONFIG_NET_SCH_SFQ=y
# CONFIG_NET_SCH_TEQL is not set
# CONFIG_NET_SCH_TBF is not set
# CONFIG_NET_SCH_GRED is not set
-# CONFIG_NET_SCH_DSMARK is not set
+CONFIG_NET_SCH_DSMARK=y
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_SCH_DRR is not set
# CONFIG_NET_SCH_MQPRIO is not set
# CONFIG_NET_SCH_CHOKE is not set
# CONFIG_NET_SCH_QFQ is not set
# CONFIG_NET_SCH_CODEL is not set
-# CONFIG_NET_SCH_FQ_CODEL is not set
-# CONFIG_NET_SCH_INGRESS is not set
+CONFIG_NET_SCH_FQ_CODEL=y
+CONFIG_NET_SCH_INGRESS=y
# CONFIG_NET_SCH_PLUG is not set
#
# Classification
#
CONFIG_NET_CLS=y
-# CONFIG_NET_CLS_BASIC is not set
+CONFIG_NET_CLS_BASIC=y
# CONFIG_NET_CLS_TCINDEX is not set
# CONFIG_NET_CLS_ROUTE4 is not set
-# CONFIG_NET_CLS_FW is not set
+CONFIG_NET_CLS_FW=y
CONFIG_NET_CLS_U32=y
# CONFIG_CLS_U32_PERF is not set
-# CONFIG_CLS_U32_MARK is not set
+CONFIG_CLS_U32_MARK=y
# CONFIG_NET_CLS_RSVP is not set
# CONFIG_NET_CLS_RSVP6 is not set
# CONFIG_NET_CLS_FLOW is not set
@@ -1036,7 +1051,7 @@
CONFIG_NET_ACT_GACT=y
# CONFIG_GACT_PROB is not set
CONFIG_NET_ACT_MIRRED=y
-# CONFIG_NET_ACT_IPT is not set
+CONFIG_NET_ACT_IPT=y
# CONFIG_NET_ACT_NAT is not set
# CONFIG_NET_ACT_PEDIT is not set
# CONFIG_NET_ACT_SIMP is not set
@@ -1438,7 +1453,6 @@
# CONFIG_BCACHE is not set
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
-CONFIG_DM_BUFIO=y
CONFIG_DM_CRYPT=y
# CONFIG_DM_SNAPSHOT is not set
# CONFIG_DM_THIN_PROVISIONING is not set
@@ -1450,7 +1464,7 @@
# CONFIG_DM_DELAY is not set
# CONFIG_DM_UEVENT is not set
# CONFIG_DM_FLAKEY is not set
-CONFIG_DM_VERITY=y
+# CONFIG_DM_VERITY is not set
# CONFIG_TARGET_CORE is not set
# CONFIG_FUSION is not set
@@ -1467,7 +1481,7 @@
# CONFIG_EQUALIZER is not set
# CONFIG_NET_FC is not set
CONFIG_MII=y
-# CONFIG_IFB is not set
+CONFIG_IFB=y
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
@@ -4524,8 +4538,9 @@
# CONFIG_SECURITY_PATH is not set
CONFIG_LSM_MMAP_MIN_ADDR=4096
CONFIG_SECURITY_SELINUX=y
-# CONFIG_SECURITY_SELINUX_BOOTPARAM is not set
-# CONFIG_SECURITY_SELINUX_DISABLE is not set
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
+CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
Well done. Working good so far.
What sources did you use?
dicksteele said:
Well done. Working good so far.
What sources did you use?
Click to expand...
Click to collapse
He said" This is built from the latest Samsung standard source"
zealjibia said:
He said" This is built from the latest Samsung standard source"
Click to expand...
Click to collapse
I understand that. N910CXXU2DPI7 appears to be the latest. Which is why my question was simply, which one did he use, to verify that was it.
dicksteele said:
I understand that. N910CXXU2DPI7 appears to be the latest. Which is why my question was simply, which one did he use, to verify that was it.
Click to expand...
Click to collapse
Yes, correct. I used the latest vanilla Samsung sources N910CXXU2DPI7. You can download them directly from Samsung. I've supplied the patch and the config diff, so everyone can precisely replicate the linked binary kernel version if they wish.
dl12345 said:
Yes, correct. I used the latest vanilla Samsung sources N910CXXU2DPI7. You can download them directly from Samsung. I've supplied the patch and the config diff, so everyone can precisely replicate the linked binary kernel version if they wish.
Click to expand...
Click to collapse
Excellent thanks. I've downloaded and getting compile errors. But I've been on travel for the past couple of weeks and my brains is not completely functioning.
dicksteele said:
Excellent thanks. I've downloaded and getting compile errors. But I've been on travel for the past couple of weeks and my brains is not completely functioning.
Click to expand...
Click to collapse
If it helps to know, I use the android ndk 13 toolchain. Here are two files that I use, the first to setup the environment, the second to build the kernel. My NDK is installed in /opt/android/android-ndk-r13
/opt/android/setvars.sh
Code:
#!/bin/bash
NDKARCH="arm-linux-androideabi"
NDKARCHVER="4.9"
NDKVER="r13"
NDKBASE="/opt/android/android-ndk"
NDK="${NDKBASE}-${NDKVER}"
export NDKBIN="${NDK}/toolchains/${NDKARCH}-${NDKARCHVER}/prebuilt/linux-x86_64/bin"
export CROSS_COMPILE="${NDKARCH}-"
export ARCH=arm
export SUBARCH=arm
RE=".*${NDK}.*[:]*"
if [[ ! ${PATH} =~ ${RE} ]] ; then
export PATH="$PATH:${NDKBIN}"
elif [[ ${PATH} =~ ${RE} ]]; then
export PATH=$(echo $PATH | awk -F':' \
"{ \
i = 1; \
for (i = 1; i <= NF; i++) { \
if (\$i !~ /android-ndk/) printf \"%s\", \$i; \
else printf \"%s\", \"${NDKBIN}\"; \
if ( i < NF) printf \":\"; \
}; \
}")
fi
echo CROSS_COMPILE=$CROSS_COMPILE
echo PATH=$PATH
/opt/android/note4/src/kernel/build_kernel.sh
Code:
#!/bin/bash
. /opt/android/setvars.sh
export KBUILD_BUILD_USER=dl12345
export KBUILD_BUILD_HOST=xda
set -x
make -j16 ARCH=arm KBUILD_USER=$KBUILD_BUILD_USER KBUILD_BUILD_HOST=$KBUILD_BUILD_HOST $1
make ARCH=arm exynos5433-tre_eur_open_16.dtb
dl12345 said:
If it helps to know, I use the android ndk 13 toolchain. Here are two files that I use, the first to setup the environment, the second to build the kernel. My NDK is installed in /opt/android/android-ndk-r13
/opt/android/setvars.sh
Code:
#!/bin/bash
NDKARCH="arm-linux-androideabi"
NDKARCHVER="4.9"
NDKVER="r13"
NDKBASE="/opt/android/android-ndk"
NDK="${NDKBASE}-${NDKVER}"
export NDKBIN="${NDK}/toolchains/${NDKARCH}-${NDKARCHVER}/prebuilt/linux-x86_64/bin"
export CROSS_COMPILE="${NDKARCH}-"
export ARCH=arm
export SUBARCH=arm
RE=".*${NDK}.*[:]*"
if [[ ! ${PATH} =~ ${RE} ]] ; then
export PATH="$PATH:${NDKBIN}"
elif [[ ${PATH} =~ ${RE} ]]; then
export PATH=$(echo $PATH | awk -F':' \
"{ \
i = 1; \
for (i = 1; i <= NF; i++) { \
if (\$i !~ /android-ndk/) printf \"%s\", \$i; \
else printf \"%s\", \"${NDKBIN}\"; \
if ( i < NF) printf \":\"; \
}; \
}")
fi
echo CROSS_COMPILE=$CROSS_COMPILE
echo PATH=$PATH
/opt/android/note4/src/kernel/build_kernel.sh
Code:
#!/bin/bash
. /opt/android/setvars.sh
export KBUILD_BUILD_USER=dl12345
export KBUILD_BUILD_HOST=xda
set -x
make -j16 ARCH=arm KBUILD_USER=$KBUILD_BUILD_USER KBUILD_BUILD_HOST=$KBUILD_BUILD_HOST $1
make ARCH=arm exynos5433-tre_eur_open_16.dtb
Click to expand...
Click to collapse
This helps thanks a ton. I've really never attempted to compile a kernel for android. That's my last frontier.
I've done Linux over 10 years ago, I've just been content with using others.
They've all been great, but the only thing that was missing was the Revoke USB debugging authorizations on most of the custom ones.
I'd have to flash back to stock if ADB lost its mind and wouldn't recognize the phone.
Good stuff, great work. Much appreciation. Hope you stick around !
If you want to use ADB on this kernel and you're booting with SELinux in enforcing mode, you'll need to first run a terminal and execute
Code:
$ su
# setenforce 0
If you don't do this, ADB will appear not to work or even recognize the device.
When you're done, just setenforce 1 again. Of course, depending on how your ramdisk is setup, this may not be necessary but it's worth knowing if you run into apparent problems with ADB.
dl12345 said:
If you want to use ADB on this kernel and you're booting with SELinux in enforcing mode, you'll need to first run a terminal and execute
Code:
$ su
# setenforce 0
If you don't do this, ADB will appear not to work or even recognize the device.
When you're done, just setenforce 1 again. Of course, depending on how your ramdisk is setup, this may not be necessary but it's worth knowing if you run into apparent problems with ADB.
Click to expand...
Click to collapse
ADB usually works fine. After reflashing and moving to a new machine ADBKeys is usually hosed.
So Revoke USB debugging authorizations is not under Developer Options to reset under some kernels, but it is under stock and it was after I applied yours. Which was cool.
It doesn't happen a lot just enough to be annoying.
This is nice.. @dl12345 I suggest make a flashable kernel..
Im not seeing any updated kernel right now specially for n910c device,.. no more kernel devs
radz_ said:
This is nice.. @dl12345 I suggest make a flashable kernel..
Im not seeing any updated kernel right now specially for n910c device,.. no more kernel devs
Click to expand...
Click to collapse
[KERNEL][PI7 v1.5][6.0.1][TW] talexop - Note4 N910C Permissive
N910C_PI7_6.0.1_talexop_v1.5.zip
Came out Nov 2
Hoping sources will be out soon
The thing with a flashable kernel is that everyone has a different ramdisk, so making something that fits all sizes is tricky. I figured it better to just let people use their existing ramdisk and so they won't notice any real change, regardless of the ROM they're using.
dl12345 said:
The thing with a flashable kernel is that everyone has a different ramdisk, so making something that fits all sizes is tricky. I figured it better to just let people use their existing ramdisk and so they won't notice any real change, regardless of the ROM they're using.
Click to expand...
Click to collapse
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw
radz_ said:
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw
Click to expand...
Click to collapse
Flashed the talexop kernel, then the system mode supersu. Both worked fine together
radz_ said:
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw
Click to expand...
Click to collapse
Yes, CONFIG_DM_VERITY is disabled on this kernel as is CONFIG_KNOX_KAP. I run this kernel in enforcing mode (you can switch SELinux on or off with a boot command line parameter, or with the setenforce command).
dicksteele said:
Flashed the talexop kernel, then the system mode supersu. Both worked fine together
Click to expand...
Click to collapse
Oh nice... thanks for the confirmation mate.
For now I went back to stock, talexop kernel has wifi issue.. hoping for a fix soon..
radz_ said:
Oh nice... thanks for the confirmation mate.
For now I went back to stock, talexop kernel has wifi issue.. hoping for a fix soon..
Click to expand...
Click to collapse
I compiled a kernel and mine is doing the same thing. But I think I found the fix. I hope. Kernel's running good I think.
But it's my first one ever and I'm still tickering with things.
It will be 70-80% stock. IF I release it it won't be until the end of the month at least.
dicksteele said:
I compiled a kernel and mine is doing the same thing. But I think I found the fix. I hope. Kernel's running good I think.
But it's my first one ever and I'm still tickering with things.
It will be 70-80% stock. IF I release it it won't be until the end of the month at least.
Click to expand...
Click to collapse
These are all ramdisk related problems, and one of the reasons I just posted a link to a kernel rather than full boot image.
This wifi issue is a known problem caused by using secure_storage with a custom kernel or ROM. Your default.prop in your ramdisk should turn off securestorage
Code:
ro.securestorage.support=false
I'd also suggest the following edits in default.prop which are related to adb. Just search them here on XDA. There's lots of info
Code:
ro.secure=0
persist.service.adb.enable=1
persist.service.debuggable=1
ro.debuggable=1
ro.adb.secure=0
persist.sys.usb.config=mtp,adb
dl12345 said:
Yes, CONFIG_DM_VERITY is disabled on this kernel as is CONFIG_KNOX_KAP. I run this kernel in enforcing mode (you can switch SELinux on or off with a boot command line parameter, or with the setenforce command).
Click to expand...
Click to collapse
I do not think you can change to enforcing... It is only permissive. Are you sure it changed?
---------- Post added at 10:47 ---------- Previous post was at 10:45 ----------
dl12345 said:
These are all ramdisk related problems, and one of the reasons I just posted a link to a kernel rather than full boot image.
This wifi issue is a known problem caused by using secure_storage with a custom kernel or ROM. Your default.prop in your ramdisk should turn off securestorage
Code:
ro.securestorage.support=false
I'd also suggest the following edits in default.prop which are related to adb. Just search them here on XDA. There's lots of info
Code:
ro.secure=0
persist.service.adb.enable=1
persist.service.debuggable=1
ro.debuggable=1
ro.adb.secure=0
persist.sys.usb.config=mtp,adb
Click to expand...
Click to collapse
Bump

Build Aosp Extended on Ubuntu 18.04 (Bionic Beaver)

Build AOSP on ubuntu 18.04 Bionic Beaver
1. I suggest using screen when build so install it
sudo apt-get install screen
2. Add this line to /etc/apt/sources.list
deb http://cz.archive.ubuntu.com/ubuntu trusty main
3. Update repository list
sudo apt-get update
4. Install dependencies for building
mkdir -p ~/bin
wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin
chmod +x ~/bin/repo
sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python
5. Setup git
git config --global user.name "your name"
git config --global user.email "your email"
6. Add repo path and enable ccache
nano ~/.bashrc
Add these lines to the bottom of bashrc
export PATH=~/bin:$PATH
export USE_CCACHE=1
export LC_ALL=C
Then to enable these use command
source ~/.bashrc
7. Make working directory
mkdir ~/android
cd ~/android
8. Initialise repo source (In this example we will use AospExtended Oreo )
repo init -u git://github.com/AospExtended/manifest.git -b 8.1.x
9. Sync repository (this could take a while depending on your internet connection, replace x with number of cores available remember to leave some free for system processes)
repo sync -c -jx --force-sync --no-clone-bundle --no-tags
10. Configure how much drive space ccache can use (I recommend 25-30gb)
prebuilts/misc/linux-x86/ccache/ccache -M 25G
11. Configure how much ram Jacks server can use (I recommend at least 8gb but the more resources you use the faster it will build)
export ANDROID_JACK_VM_ARGS="-Xmx8g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
12. Download device specific trees
Kernel tree
Device tree
Device Common Tree
Vendor Tree
these are specific to each device so you need ones that match your device
13. Build Initialise
. build/envsetup.sh
lunch aosp_devicename-userdebug
An example for Xiaomi Mi Max 2 codename (oxygen)
lunch aosp_oxygen-userdebug
14. Then to start building (replace x with available cores again the more cores made available the quicker it will compile)
make aex -jx
eva0034 said:
Build AOSP on ubuntu 18.04 Bionic Beaver
1. I suggest using screen when build so install it
sudo apt-get install screen
2. Add this line to /etc/apt/sources.list
deb http://cz.archive.ubuntu.com/ubuntu trusty main
3. Update repository list
sudo apt-get update
4. Install dependencies for building
mkdir -p ~/bin
wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin
chmod +x ~/bin/repo
sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python
5. Setup git
git config --global user.name "your name"
git config --global user.email "your email"
6. Add repo path and enable ccache
nano ~/.bashrc
Add these lines to the bottom of bashrc
export PATH=~/bin:$PATH
export USE_CCACHE=1
Then to enable these use command
source ~/.bashrc
7. Make working directory
mkdir ~/android
cd ~/android
8. Initialise repo source (In this example we will use AospExtended Oreo )
repo init -u git://github.com/AospExtended/manifest.git -b 8.1.x
9. Sync repository (this could take a while depending on your internet connection, replace x with number of cores available remember to leave some free for system processes)
repo sync -c -jx --force-sync --no-clone-bundle --no-tags
10. Configure how much drive space ccache can use (I recommend 25-30gb)
prebuilts/misc/linux-x86/ccache/ccache -M 25G
11. Configure how much ram Jacks server can use (I recommend at least 8gb but the more resources you use the faster it will build)
export ANDROID_JACK_VM_ARGS="-Xmx8g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
12. Download device specific trees
Kernel tree
Device tree
Device Common Tree
Vendor Tree
these are specific to each device so you need ones that match your device
13. Build Initialise
. build/envsetup.sh
lunch aosp_devicename-userdebug
An example for Xiaomi Mi Max 2 codename (oxygen)
lunch aosp_oxygen-userdebug
14. Then to start building (replace x with available cores again the more cores made available the quicker it will compile)
make aex -jx
Click to expand...
Click to collapse
If you wish to use with another rom this guide add
Code:
sudo apt install selinux
.
If you get an error mentioning STATIC_LIBRARIES/libedify_intermediates/lexer.cpp make sure to also add
"export LC_ALL=C"
in your ~/.bashrc file.
@eva0034 I followed this guide but instead i replaced repo init 8.1.x with 7.1.1 because my device only has nougat support. I get stuck in repository sync at 99% every time. When I abort it shows failure to fetch snapdragon camera.
I posted on aex telegram and they advised me to delete snapdragon camera in repo/manifest xml.
I can't find this folder or file anywhere. Any idea?
undeclared identifiers n7100 build
what do i need to do to fix the errors below?
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:489:17: error: use of undeclared identifier 'GRALLOC_USAGE_YUV_ADDR'
if (usage & GRALLOC_USAGE_YUV_ADDR) {
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:494:87: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s vaddr[0]=%x vaddr[1]=%x vaddr[2]=%x", __func__, vaddr[0], vaddr[1], vaddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:494:97: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s vaddr[0]=%x vaddr[1]=%x vaddr[2]=%x", __func__, vaddr[0], vaddr[1], vaddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:494:107: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s vaddr[0]=%x vaddr[1]=%x vaddr[2]=%x", __func__, vaddr[0], vaddr[1], vaddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:454:49: warning: unused parameter 'module' [-Wunused-parameter]
static int gralloc_lock(gralloc_module_t const* module, buffer_handle_t handle,
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:505:51: warning: unused parameter 'module' [-Wunused-parameter]
static int gralloc_unlock(gralloc_module_t const* module, buffer_handle_t handle)
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:585:89: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s paddr[0]=0x%x paddr[1]=0x%x paddr[2]=0x%x", __func__, paddr[0], paddr[1], paddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:585:99: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s paddr[0]=0x%x paddr[1]=0x%x paddr[2]=0x%x", __func__, paddr[0], paddr[1], paddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:585:109: warning: format specifies type 'unsigned int' but the argument has type 'void *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s paddr[0]=0x%x paddr[1]=0x%x paddr[2]=0x%x", __func__, paddr[0], paddr[1], paddr[2]);
~~ ^~~~~~~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:580:52: warning: unused parameter 'module' [-Wunused-parameter]
static int gralloc_getphys(gralloc_module_t const* module, buffer_handle_t handle, void** paddr)
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:593:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
open: gralloc_device_open
^~~~~
.open =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:598:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
base:
^~~~~
.base =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:600:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
common:
^~~~~~~
.common =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:602:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
tag: HARDWARE_MODULE_TAG,
^~~~
.tag =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:603:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
version_major: 1,
^~~~~~~~~~~~~~
.module_api_version =
hardware/libhardware/include/hardware/hardware.h:114:23: note: expanded from macro 'version_major'
#define version_major module_api_version
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:604:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
version_minor: 0,
^~~~~~~~~~~~~~
.hal_api_version =
hardware/libhardware/include/hardware/hardware.h:132:23: note: expanded from macro 'version_minor'
#define version_minor hal_api_version
^
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:605:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
id: GRALLOC_HARDWARE_MODULE_ID,
^~~
.id =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:606:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
name: "Graphics Memory Allocator Module",
^~~~~
.name =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:607:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
author: "ARM Ltd.",
^~~~~~~
.author =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:608:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
methods: &gralloc_module_methods,
^~~~~~~~
.methods =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:609:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
dso: NULL,
^~~~
.dso =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:610:13: warning: use of GNU old-style field designator extension [-Wgnu-designator]
reserved : {0,},
^~~~~~~~~~
.reserved =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:612:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
registerBuffer: gralloc_register_buffer,
^~~~~~~~~~~~~~~
.registerBuffer =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:613:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
unregisterBuffer: gralloc_unregister_buffer,
^~~~~~~~~~~~~~~~~
.unregisterBuffer =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:614:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
lock: gralloc_lock,
^~~~~
.lock =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:615:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
unlock: gralloc_unlock,
^~~~~~~
.unlock =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:616:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
getphys: gralloc_getphys,
^~~~~~~~
.getphys =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:617:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
perform: NULL,
^~~~~~~~
.perform =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:618:9: warning: use of GNU old-style field designator extension [-Wgnu-designator]
lock_ycbcr: NULL,
^~~~~~~~~~~
.lock_ycbcr =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:620:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
framebuffer: NULL,
^~~~~~~~~~~~
.framebuffer =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:621:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
flags: 0,
^~~~~~
.flags =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:622:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
numBuffers: 0,
^~~~~~~~~~~
.numBuffers =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:623:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
bufferMask: 0,
^~~~~~~~~~~
.bufferMask =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:624:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
lock: PTHREAD_MUTEX_INITIALIZER,
^~~~~
.lock =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:625:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
currentBuffer: NULL,
^~~~~~~~~~~~~~
.currentBuffer =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:626:5: warning: use of GNU old-style field designator extension [-Wgnu-designator]
ion_client: -1,
^~~~~~~~~~~
.ion_client =
hardware/samsung/exynos4/hal/libgralloc_ump/gralloc_module.cpp:616:9: error: field designator 'getphys' does not refer to any field in type 'gralloc_module_t'
getphys: gralloc_getphys,
^
42 warnings and 2 errors generated.
[ 0% 20/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/NOTICE_FILES/src/system/lib/liblights_helper.a.txt
Notice file: hardware/samsung/liblights/NOTICE -- /home/shaun/Desktop/android/out/target/product/n7100/obj/NOTICE_FILES/src/system/lib/liblights_helper.a.txt
[ 0% 21/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/lights.smdk4x12_intermediates/link_type
Check module type: /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/lights.smdk4x12_intermediates/link_type
[ 0% 22/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/alloc_device.o
FAILED: /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/alloc_device.o
/bin/bash -c "(echo "target thumb C++: gralloc.exynos4 <= hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp" ) && (mkdir -p /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/ ) && (PWD=/proc/self/cwd prebuilts/misc/linux-x86/ccache/ccache prebuilts/clang/host/linux-x86/clang-4053586/bin/clang++ -I device/samsung/smdk4412-common/include -I device/samsung/n7100/include -I bionic/libc/include -I hardware/samsung/exynos4/hal/libgralloc_ump/../include -I hardware/samsung/exynos4/hal/libgralloc_ump -I /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates -I /home/shaun/Desktop/android/out/target/product/n7100/gen/SHARED_LIBRARIES/gralloc.exynos4_intermediates -I libnativehelper/include_deprecated \$(cat /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/import_includes) -I system/core/include -I system/media/audio/include -I hardware/libhardware/include -I hardware/libhardware_legacy/include -I hardware/ril/include -I libnativehelper/include -I frameworks/native/include -I frameworks/native/opengl/include -I frameworks/av/include -isystem /home/shaun/Desktop/android/out/target/product/n7100/obj/include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -c -fno-exceptions -Wno-multichar -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -DNDEBUG -g -Wstrict-aliasing=2 -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -fdebug-prefix-map=\$PWD/= -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc -msoft-float -mfloat-abi=softfp -mfpu=neon -march=armv7-a -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -fvisibility-inlines-hidden -std=gnu++14 -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -fno-rtti -DLOG_TAG=\"gralloc\" -DSAMSUNG_EXYNOS -DSAMSUNG_EXYNOS_CACHE_UMP -DUSE_PARTIAL_FLUSH -DSAMSUNG_EXYNOS4x12 -fPIC -D_USING_LIBCXX -DANDROID_STRICT -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -MD -MF /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/alloc_device.d -o /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/gralloc.exynos4_intermediates/alloc_device.o hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp )"
target thumb C++: gralloc.exynos4 <= hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp
In file included from hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:30:
bionic/libc/include/string.h:164:1: warning: empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat]
struct __bionic_zero_size_is_okay_t {};
^
In file included from hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:41:
hardware/samsung/exynos4/hal/libgralloc_ump/../include/gralloc_priv.h:169:5: warning: field 'ion_client' will be initialized after field 'yaddr' [-Wreorder]
ion_client(0),
^
hardware/samsung/exynos4/hal/libgralloc_ump/../include/gralloc_priv.h:198:5: warning: field 'ion_client' will be initialized after field 'yaddr' [-Wreorder]
ion_client(0),
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:118:17: error: use of undeclared identifier 'GRALLOC_USAGE_HW_FIMC1'; did you mean 'GRALLOC_USAGE_HW_FB'?
if (usage & GRALLOC_USAGE_HW_FIMC1) {
^~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_HW_FB
hardware/libhardware/include/hardware/gralloc.h:96:5: note: 'GRALLOC_USAGE_HW_FB' declared here
GRALLOC_USAGE_HW_FB = 0x00001000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:196:37: error: use of undeclared identifier 'GRALLOC_USAGE_HWC_HWOVERLAY'
if ( (usage < 0 || usage & (GRALLOC_USAGE_HWC_HWOVERLAY | GRALLOC_USAGE_HW_FIMC1)) &&
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:196:67: error: use of undeclared identifier 'GRALLOC_USAGE_HW_FIMC1'; did you mean 'GRALLOC_USAGE_HW_FB'?
if ( (usage < 0 || usage & (GRALLOC_USAGE_HWC_HWOVERLAY | GRALLOC_USAGE_HW_FIMC1)) &&
^~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_HW_FB
hardware/libhardware/include/hardware/gralloc.h:96:5: note: 'GRALLOC_USAGE_HW_FB' declared here
GRALLOC_USAGE_HW_FB = 0x00001000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:199:25: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (usage & GRALLOC_USAGE_PRIVATE_NONECACHE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:208:25: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (usage & GRALLOC_USAGE_PRIVATE_NONECACHE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:234:86: warning: format specifies type 'unsigned int' but the argument has type 'private_handle_t *' [-Wformat]
ALOGD_IF(debug_level > 0, "%s hnd=%x paddr=%x yaddr=%x offset=%x", __func__, hnd, current_address, gReservedMemSize, buffer_offset);
~~ ^~~
system/core/liblog/include/log/log_main.h:206:62: note: expanded from macro 'ALOGD_IF'
((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:306:67: note: expanded from macro 'ALOG'
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:70:69: note: expanded from macro 'LOG_PRI'
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
^~~~~~~~~~~
system/core/liblog/include/log/log_main.h:61:34: note: expanded from macro 'android_printLog'
__android_log_print(prio, tag, __VA_ARGS__)
^~~~~~~~~~~
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:238:17: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
if (usage & GRALLOC_USAGE_HW_ION) {
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:248:34: error: use of undeclared identifier 'GRALLOC_USAGE_HWC_HWOVERLAY'
if (usage < 0 || usage & GRALLOC_USAGE_HWC_HWOVERLAY )
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:259:21: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (usage & GRALLOC_USAGE_PRIVATE_NONECACHE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:275:21: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (usage & GRALLOC_USAGE_PRIVATE_NONECACHE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:507:29: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
if (!(l_usage & GRALLOC_USAGE_HW_ION)) {
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:508:28: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
l_usage |= GRALLOC_USAGE_HW_ION; // Exynos HWC wants ION-friendly memory allocation
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:512:29: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
if (!(l_usage & GRALLOC_USAGE_PRIVATE_NONECACHE)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:513:28: error: use of undeclared identifier 'GRALLOC_USAGE_PRIVATE_NONECACHE'; did you mean 'GRALLOC_USAGE_PRIVATE_MASK'?
l_usage |= GRALLOC_USAGE_PRIVATE_NONECACHE; // Exynos HWC wants ION-friendly memory allocation
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GRALLOC_USAGE_PRIVATE_MASK
hardware/libhardware/include/hardware/gralloc.h:144:5: note: 'GRALLOC_USAGE_PRIVATE_MASK' declared here
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:525:24: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
l_usage |= GRALLOC_USAGE_HW_ION;
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:553:27: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
if (l_usage & GRALLOC_USAGE_HW_ION)
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:570:27: error: use of undeclared identifier 'GRALLOC_USAGE_HW_ION'
if (l_usage & GRALLOC_USAGE_HW_ION)
^
hardware/samsung/exynos4/hal/libgralloc_ump/alloc_device.cpp:664:62: warning: unused parameter 'name' [-Wunused-parameter]
int alloc_device_open(hw_module_t const* module, const char* name, hw_device_t** device)
^
5 warnings and 16 errors generated.
[ 0% 23/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/STATIC_LIBRARIES/liblights_helper_intermediates/lights_helper.o
target thumb C: liblights_helper <= hardware/samsung/liblights/lights_helper.c
[ 0% 24/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/SHARED_LIBRARIES/lights.smdk4x12_intermediates/lights.o
target thumb C: lights.smdk4x12 <= hardware/samsung/liblights/lights.c
[ 0% 25/63617] build setup-jack-server
Ensuring Jack server is installed and started
Jack server already installed in "/home/shaun/.jack-server"
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Xmx8g -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/shaun/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
[ 0% 26/63617] build /home/shaun/Desktop/android/out/target/product/n7100/obj/KERNEL_OBJ/.config
Building Kernel Config
make: Entering directory '/home/shaun/Desktop/android/kernel/samsung/smdk4412'
GEN /home/shaun/Desktop/android/out/target/product/n7100/obj/KERNEL_OBJ/Makefile
arch/arm/mach-exynos/Kconfig:875:warning: choice value used outside its choice group
arch/arm/mach-exynos/Kconfig:877:warning: defaults for choice values not supported
warning: (SEC_MODEM_M0_C2C && SEC_MODEM_M0 && SEC_MODEM_U1 && SEC_MODEM_IRON && SEC_MODEM_T0_TD_DUAL) selects LINK_DEVICE_HSIC which has unmet direct dependencies (MISC_DEVICES && MACH_U1 && SEC_MODEM)
warning: (SEC_MODEM_M0_C2C && SEC_MODEM_M0 && SEC_MODEM_IRON && SEC_MODEM_T0_TD_DUAL) selects UMTS_MODEM_XMM6262 which has unmet direct dependencies (MISC_DEVICES && MACH_U1 && SEC_MODEM)
warning: (ARM) selects SECCOMP_FILTER which has unmet direct dependencies (HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET)
warning: (ARM) selects SECCOMP_FILTER which has unmet direct dependencies (HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET)
warning: (SEC_MODEM_M0_C2C && SEC_MODEM_M0 && SEC_MODEM_U1 && SEC_MODEM_IRON && SEC_MODEM_T0_TD_DUAL) selects LINK_DEVICE_HSIC which has unmet direct dependencies (MISC_DEVICES && MACH_U1 && SEC_MODEM)
warning: (SEC_MODEM_M0_C2C && SEC_MODEM_M0 && SEC_MODEM_IRON && SEC_MODEM_T0_TD_DUAL) selects UMTS_MODEM_XMM6262 which has unmet direct dependencies (MISC_DEVICES && MACH_U1 && SEC_MODEM)
#
Can someone tell me what step am i missing. I didn't get a shot of the vendor, it was done on another screen but it was from the Muppets git lge same branch. Thanks.
Samia Palos said:
If you wish to use with another rom this guide add
Code:
sudo apt install selinux
.
Click to expand...
Click to collapse
this caused to my machine to hang at ubuntu screen at reboot. I entered recovery mode and used sudo apt-get remove selinux but it still hangs.
any idea?
Airtioteclint said:
this caused to my machine to hang at ubuntu screen at reboot. I entered recovery mode and used sudo apt-get remove selinux but it still hangs.
any idea?
Click to expand...
Click to collapse
Don't actually install SELinux. You can build other ROMs just fine without it. (I have only really tried Lineage and Dirty Unicorns though.
Hey there eva0034. I appreciate you writing this up for people!
I attempted using this method for the Galaxy S6 (zerofltexx) but ran in to this hurdle when attempting to lunch.
Code:
[SIZE="3"][COLOR="seagreen"][email protected]:~/android$ lunch aosp_zerofltexx-userdebug[/COLOR]
vendor/aosp/config/bootanimation.mk:28: Target bootanimation res is undefined, using generic bootanimation
Looking for dependencies
Traceback (most recent call last):
File "build/tools/roomservice.py", line 368, in <module>
main()
File "build/tools/roomservice.py", line 312, in main
fetch_dependencies(repo_path)
File "build/tools/roomservice.py", line 225, in fetch_dependencies
dependencies = json.load(dep_f)
File "/usr/lib/python2.7/json/__init__.py", line 291, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 7 column 5 (char 123)[/SIZE]
These are the trees that I am using:
Code:
[SIZE="3"][COLOR="seagreen"][email protected]:~/android$ git clone https://github.com/TeamNexus/android_device_samsung_zerofltexx.git -b nx-8.1 device/samsung/zerofltexx[/COLOR]
Cloning into 'device/samsung/zerofltexx'...
remote: Counting objects: 389, done.
remote: Total 389 (delta 0), reused 0 (delta 0), pack-reused 389
Receiving objects: 100% (389/389), 8.31 MiB | 4.02 MiB/s, done.
Resolving deltas: 100% (220/220), done.
[COLOR="seagreen"][email protected]:~/android$ git clone https://github.com/TeamNexus/android_device_samsung_zero-common.git -b nx-8.1 device/samsung/zero-common[/COLOR]
Cloning into 'device/samsung/zero-common'...
remote: Counting objects: 11826, done.
remote: Compressing objects: 100% (92/92), done.
remote: Total 11826 (delta 58), reused 94 (delta 51), pack-reused 11683
Receiving objects: 100% (11826/11826), 21.12 MiB | 6.67 MiB/s, done.
Resolving deltas: 100% (7040/7040), done.
[COLOR="seagreen"][email protected]:~/android$ git clone https://github.com/TeamNexus/android_kernel_samsung_exynos7420.git -b nx-8.1 kernel/samsung/exynos7420[/COLOR]
Cloning into 'kernel/samsung/exynos7420'...
remote: Counting objects: 5141645, done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 5141645 (delta 20), reused 19 (delta 10), pack-reused 5141592
Receiving objects: 100% (5141645/5141645), 1.24 GiB | 9.76 MiB/s, done.
Resolving deltas: 100% (4260989/4260989), done.
Checking out files: 100% (48940/48940), done.
[COLOR="seagreen"][email protected]:~/android$ git clone https://github.com/TeamNexus/android_vendor_samsung_zero-common.git -b nx-8.1 vendor/samsung/zero-common[/COLOR]
Cloning into 'vendor/samsung/zero-common'...
remote: Counting objects: 2106, done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 2106 (delta 27), reused 48 (delta 14), pack-reused 2031
Receiving objects: 100% (2106/2106), 116.09 MiB | 9.64 MiB/s, done.
Resolving deltas: 100% (1151/1151), done.
Checking out files: 100% (486/486), done.
[/SIZE]
And this is what it looks like when I run the envsetup.sh:
Code:
[SIZE="3"][COLOR="SeaGreen"][email protected]:~/android$ . build/envsetup.sh[/COLOR]
including device/samsung/zerofltexx/vendorsetup.sh
including vendor/aosp/vendorsetup.sh
including sdk/bash_completion/adb.bash[/SIZE]
Wondering if you or anybody else has any ideas as to how to solve this? Do I have to add something to "aex_manifest.xml" in local_manifests perhaps? Thank you to anybody who may be able to help. Am new to this
Edit: Got past the above issues by using a roomservice.xml file and get to around 6% of actual compiling but it throws an error when it gets to building the kernel. I give up for now... too hard for my tiny brain
not doing anything after "make aex -j2"
It just show it at the bottom of the command line and does nothing
Thanks
Shmart1 said:
It just show it at the bottom of the command line and does nothing
Click to expand...
Click to collapse
Maybe if you typed the proper command it might work
Finally to build:
. build/envsetup.sh
lunch aosp_device_codename-userdebug
mka aex -jx
Can someone tell me how to install vendor tree and kernel? i use A605K device, and i researched a bit.
but i still don't know how to install kernel tree and vendor tree. i know device tree and common tree can be installed by put device name folder in sourcefolder/devices folder, and how can i build vendor tree and kernel tree?
tmvkrpxl0 said:
Can someone tell me how to install vendor tree and kernel? i use A605K device, and i researched a bit.
but i still don't know how to install kernel tree and vendor tree. i know device tree and common tree can be installed by put device name folder in sourcefolder/devices folder, and how can i build vendor tree and kernel tree?
Click to expand...
Click to collapse
Since there is no current developer for your device, you are going to have to do create all the trees and kernel all by yourself..
Where the android source code is stored in ubuntu 18.10?
---------- Post added at 08:03 PM ---------- Previous post was at 07:37 PM ----------
aoleary said:
Since there is no current developer for your device, you are going to have to do create all the trees and kernel all by yourself..
Click to expand...
Click to collapse
Can someone tell me where the android source code is stored in ubuntu 18.10?
Vladut123 said:
Where the android source code is stored in ubuntu 18.10?
---------- Post added at 08:03 PM ---------- Previous post was at 07:37 PM ----------
Can someone tell me where the android source code is stored in ubuntu 18.10?
Click to expand...
Click to collapse
You have to press Ctrl+H to see the repo folder
Sent from my [device_name] using XDA-Developers Legacy app
eva0034 said:
Build AOSP on ubuntu 18.04 Bionic Beaver
12. Download device specific trees
Kernel tree
Device tree
Device Common Tree
Vendor Tree
these are specific to each device so you need ones that match your device
Click to expand...
Click to collapse
can you tell more about these steps. For example, where I should download Kernel tree, to which directory? Or where I should download device tree and other components that you mention?
https://github.com/kegang0619/androi...msung_j5y17lte
https://github.com/kegang0619/androi...nos7870-common
Vendor tree:= https://github.com/kegang0619/android_vendor_samsung
Kernel Source:= https://github.com/kegang0619/FlareKernel_AOSP_V2
ROM Source:= https://github.com/AospExtended/plat...rameworks_base
Haste or Dogbin URL:=
https://del.dog/hixepifazo.rb
List Of Things You Have Tried To Do To Try And Resolve This Error:=
I'm building an AEX Oreo ROM. Here are the repositories I cloned https://github.com/kegang0619?tab=repositories
FAILED: TARGET_KERNEL_BINARIES
After a few searches, I thought that must be declared in the BoardConfig.mk of the device tree. But I couldn't figure out.
Any help would be appreciated.
What's the use of screen package?
I did the following but when i do make aex -j$(nproc) it gives this error
ninja: error: unknown target 'aex', did you mean 'dex'?

Categories

Resources