Menu:
1. Guide install Ubuntu
2. Download Source and Setup workspace
3. Feature
●Make kernel support EXT2, 3, 4
●Make Overclock, Undervolt kernel, add IO shedule and CPU Gorvernor
●Make kernel support Cifs Manager and DroidVPN( add cifs and tun module to kernel)
●Make kernel support SWAP
4. Finish your work - Compile kernel and pack new boot image
You need linux enviroment to compile kernel.
Suggest: Install Ubuntu 64bit.
Download:http://www.ubuntu.com/download/ubuntu/download
Select Ubuntu 11.10 and 64bit version
Hardware required:
CPU >= 1,5Ghz
Ram >= 2GB
HDD atleast 20GB space left
After complete download Ubuntu. You have 3 choices:
-Install Ubuntu in VMware
-Install Ubuntu like system OS
-Install Ubuntu like a soft in Windows
I recommend the 3rd way.
Extract ISO file with winzip or winra or 7z to a folder.
Go in to that folder run wubi.exe
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Restart to complete install ubuntu.
If you want to uninstall Ubuntu: go to Control Panel and uninstall Ubuntu like other soft in windows.
Ubuntu 11.10 come with a wifi problem. Broadcom chip has no driver. Solution:
-Turn on wifi on S5670
-USB tether
-Now you have internet
-Follow pitures to solve problem
Download S5670 Newest Source release
https://opensource.samsung.com/index.jsp
Link Mediafire
Download Toolchain to compile kernel
https://sourcery.mentor.com/sgpp/lite/arm/portal/package8734/public/arm-none-eabi/arm-2011.03-42-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
After download complete follow pitures
After all workplace should like this
How to open Terminal
Or use combo key: CTRL+ALT+T
Open Terminal copy command below an paste in Terminal
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
Now you need a boot.img that you want to modify kernel. Exp: Boot.img from DXKT4
You need tool to unpack, repack boot.img
http://www.mediafire.com/?zdw766gu35o0fb6
Thank to ketut.kumajaya about his useful tool.
Extract to folder android
In Terminal
Code:
cd /home/[COLOR="red"]your username[/COLOR]/android/boot.img-tools
Now copy boot.img to folder called source_img in boot.img-tools folder above
Open Readme.txt
Follow the guide to extract boot.img
============================================================================================
After extract boot.img done
Code:
cd /home/[COLOR="Red"]your username[/COLOR]/android/GT-S5830_kernel/kernel
Code:
gedit Makefile
A text file open
Ctrl+F type: cross_compile
Find:
Code:
CROSS_COMPILE =../../toolchain/arm-eabi-4.4.3/bin/arm-eabi-
Change to
Code:
CROSS_COMPILE =../arm-2011.03/bin/arm-none-eabi-
Ctrl+S
Close
Code:
cd /home/[COLOR="Red"]your username[/COLOR]/android/boot.img-tools/boot/lib/modules
Code:
strings fsr.ko | grep vermagic
You'll see something like this
Code:
vermagic=2.6.35.7-perf-[COLOR="Red"]CL783107[/COLOR] preempt mod_unload ARMv6
Go to home/android/GT-S5830_kernel/kernel/arch/arm/configs
Find beni_rev01_defconfig open with gedit( double click to file > Display)
Find line
Code:
CONFIG_LOCALVERSION="-perf"
change to
Code:
CONFIG_LOCALVERSION="-perf-[COLOR="Red"]CL783107[/COLOR]"
The RED depends on your boot.img so it's diffirent the one from mine
guide to installing Ubuntu?
---------- Post added at 06:07 PM ---------- Previous post was at 06:06 PM ----------
linux environment can be accessed on windows directly using cygwin.....
GUIDE make kernel SUPPORT EXT2,3,4
Open beni_rev01_defconfig
find line "File systems" edit "# CONFIG_EXT3_FS is not set" to "CONFIG_EXT3_FS=y"
Code:
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_POSIX_ACL is not set
# CONFIG_EXT2_FS_SECURITY is not set
# CONFIG_EXT2_FS_XIP is not set
# CONFIG_EXT3_FS is not set
[COLOR="Blue"]CONFIG_EXT4_FS=y[/COLOR]
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
# CONFIG_EXT4_DEBUG is not set
Save and exit
Go to folder where boot.img extracted
Code:
cd /home/your username/android/boot.img-tools/boot/
Open init.rc with Gedit.
We a going to add mount point so system can mount EXT4 partition. By default, system only mount partition with RFS file system.Add red line to init.rc
Code:
# Mounting of /cache
[COLOR="Red"][B]mount ext4 /dev/block/stl14 /cache wait nosuid nodev noatime nodiratime noauto_da_alloc[/B][/COLOR]
mount rfs /dev/stl14 /cache nosuid nodev check=no
# Mounting of system/userdata is moved to 'on emmc' and 'on nand' sections
# We chown/chmod /data again so because mount is run as root + defaults
[COLOR="red"][B]mount ext4 /dev/block/stl13 /data wait nosuid nodev noatime nodiratime noauto_da_alloc[/B][/COLOR]
mount rfs /dev/stl13 /data nosuid nodev check=no
# Mount /system rw first to give the filesystem a chance to save a checkpoint
[COLOR="red"][B]mount ext4 /dev/block/stl12 /system ro wait noatime nodiratime noauto_da_alloc[/B][/COLOR]
mount rfs /dev/stl12 /system ro check=no
nice guide...
the tutorial was incomplete when i posted, so i thought you're teaching ubuntu installation.
Very usefull indeed
btw can you tell me how to overclock the kernel??
Add OC and Undervolt Feature to kernel
GO to /home/Your username/android/GT-S5830_kernel/kernel/arch/arm/mach-msm/
Open acpuclock.c with Gedit
Find
Code:
static void acpuclk_set_div
and fix it like this
Code:
static void acpuclk_set_div(const struct clkctl_acpu_speed *hunt_s)
{
uint32_t reg_clkctl, reg_clksel, clk_div, src_sel, [B][COLOR="Blue"]a11_div[/COLOR][/B];
reg_clksel = readl(A11S_CLK_SEL_ADDR);
/* AHB_CLK_DIV */
clk_div = (reg_clksel >> 1) & 0x03;
/* CLK_SEL_SRC1NO */
src_sel = reg_clksel & 1;
[B] [COLOR="blue"] a11_div=hunt_s->a11clk_src_div;
if(hunt_s->a11clk_khz>600000) {
a11_div=0;
writel(hunt_s->a11clk_khz/19200, MSM_CLK_CTL_BASE+0x33C);
udelay(50);
}[/COLOR][/B]
/*
* If the new clock divider is higher than the previous, then
* program the divider before switching the clock
*/
........etc.......
Now find this line
Code:
/* 7x27 normal with GSM capable modem - PLL0 and PLL1 swapped */
Add
Code:
{ 1, 652800, ACPU_PLL_2, 2, 1, 200000, 2, [COLOR="Blue"][B]7[/B][/COLOR], 160000 },
{ 1, 768000, ACPU_PLL_2, 2, 2, 160000, 2, [COLOR="Blue"][B]7[/B][/COLOR], 160000 },
{ 1, 800000, ACPU_PLL_2, 2, 0, 200000, 3, [COLOR="Blue"][B]7[/B][/COLOR], 122880 },
after { 1, 600000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 122880 }, and before { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, {0, 0, 0} }
The Blue column is set voltage for cpu. MSM7227 has voltage range from 1.2 to 1.35V as value 1 to 7.
Here is some Frequency if you 'd like to add more
Code:
{ 1, 652800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 691200, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 710400, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 729600, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 748800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 768000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 787200, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 },
{ 1, 800000, ACPU_PLL_0, 4, 0, 206400, 3, 7, 122880 },
{ 1, 806400, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 },
{ 1, 825600, ACPU_PLL_0, 4, 0, 206400, 3, 7, 122880 },
{ 1, 844800, ACPU_PLL_0, 4, 0, 211200, 3, 7, 122880 },
{ 1, 864000, ACPU_PLL_0, 4, 0, 216000, 3, 7, 122880 },
AND another Freq provide by pratyush.creed
Code:
{ 1, 600000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 122880 },
{ 1, 614400, ACPU_PLL_2, 2, 0, 153600, 3, 6, 122880 },
{ 1, 672000, ACPU_PLL_2, 2, 0, 168000, 3, 6, 122880 },
{ 1, 729600, ACPU_PLL_2, 2, 0, 182400, 3, 7, 122880 },
{ 1, 800000, ACPU_PLL_2, 2, 0, 200000, 3, 7, 122880 },
Due to some isues about not set default Freq that make phone run at max Freq as default. Here
Open beni_rev01_defconfig find line
Code:
# CONFIG_MSM_CPU_FREQ_SET_MIN_MAX is not set
change to
Code:
CONFIG_MSM_CPU_FREQ_SET_MIN_MAX=y
And add this below CONFIG_MSM_CPU_FRQ_MIN_MAX
Code:
CONFIG_MSM_CPU_FREQ_MAX=600000
CONFIG_MSM_CPU_FREQ_MIN=245000
Orig Thread for help me solve this out
http://forum.xda-developers.com/showthread.php?t=1348951
----------------------------------------------------------------------------------------------------------------------------------------
Add IO Scheduler and CPU Governor Feature to kernel
Download source :http://www.mediafire.com/?o576hx1ei74ah27
Extract zip file to /home/your username/android/GT-S5830_kernel/
Add options to config file
Go to /home/your username/android/GT-S5830_kernel/kernel/arch/arm/configs/
Open beni_rev01_defconfig find line
Code:
IO Schedulers
Add 2 line below under IO Scheduler
Code:
CONFIG_IOSCHED_VR=y
CONFIG_IOSCHED_SIO=y
Now find line
Code:
CPU Power Management
Code:
CONFIG_CPU_FREQ_GOV_BRAZILIANWAX=y
CONFIG_CPU_FREQ_GOV_HOTPLUG=y
CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
CONFIG_CPU_FREQ_GOV_SCARY=y
CONFIG_CPU_FREQ_GOV_LIONHEART=y
CONFIG_CPU_FREQ_GOV_LAZY=y
CONFIG_CPU_FREQ_GOV_SMOOTHASS=y
CONFIG_CPU_FREQ_GOV_SAVAGEDZEN=y
CONFIG_CPU_FREQ_GOV_INTERACTIVEX=y
CONFIG_CPU_FREQ_GOV_LAGFREE=y
CONFIG_CPU_FREQ_GOV_MINMAX=y
CONFIG_CPU_FREQ_GOV_SMARTASS2=y
add them under CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
Save and exit
Recompile your kernel again.
Thank to wilfredcool007 by rush me and give me info
Maybe u can add about ext4/3/2 support too !!
pratyush.creed said:
Maybe u can add about ext4/3/2 support too !!
Click to expand...
Click to collapse
u just have to edit a few lines in config.
sakindia123 said:
u just have to edit a few lines in config.
Click to expand...
Click to collapse
Yeah, open beni_rev01_defconfig find line "File systems"
Code:
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_POSIX_ACL is not set
# CONFIG_EXT2_FS_SECURITY is not set
# CONFIG_EXT2_FS_XIP is not set
# CONFIG_EXT3_FS is not set
[COLOR="Red"]CONFIG_EXT4_FS=y[/COLOR]
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_FS_POSIX_ACL is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set
About OC, i see there 2 options: add module to kernel or change freq table
Good new for all you
Im success at overclock
check page 1 pls.
zcop said:
Yeah, open beni_rev01_defconfig find line "File systems"
Code:
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_POSIX_ACL is not set
# CONFIG_EXT2_FS_SECURITY is not set
# CONFIG_EXT2_FS_XIP is not set
# CONFIG_EXT3_FS is not set
[COLOR="Red"]CONFIG_EXT4_FS=y[/COLOR]
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_FS_POSIX_ACL is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set
Click to expand...
Click to collapse
so to make it support ext4, I just copy the code above n paste it??
AldoSebastian said:
so to make it support ext4, I just copy the code above n paste it??
Click to expand...
Click to collapse
nope
just change this line
# CONFIG_EXT4_FS is not set
to
CONFIG_EXT4_FS=y
no, you should uncomment it ( del the # symbol)
set value to it
EX: # CONFIG_EXT4_FS is not set >>> CONFIG_EXT4_FS=y
zcop said:
no, you should uncomment it ( del the # symbol)
set value to it
EX: # CONFIG_EXT4_FS is not set >>> CONFIG_EXT4_FS=y
Click to expand...
Click to collapse
Thank's sir...n your thread is really2 helpfull for a noob like me....
*thank's button has been pressed..*
i believe there's a mistake.
Code:
CROSS_COMPILE =../arm-2011.03/bin/arm-none-eabi-
should be
Code:
CROSS_COMPILE =../arm-2011.03/bin/arm-none-linux-gnueabi-
Repack Ramdisk and Compile zImage
Go to /home/android/GT-S5830_kernel/kernel
Double click on make_kernel_GT-S5830.sh> Display
Change
Code:
make cooper_rev03_defconfig
to
Code:
make beni_rev01_defconfig
Save and exit
In Terminal
Code:
cd /home/[COLOR="Red"]your username[/COLOR]/android/GT-S5830_kernel/kernel
Code:
./make_kernel_GT-S5830.sh
take a cup of coffee
(15-20m)
Now you get your kernel. It's zImage
Take zImage from /home/android/GT-S5830_kernel/kernel/arch/arm/boot copy to /home/android/boot.img-tools/unpack
Del old boot.img-zImage
Repack new Ramdisk
Code:
cd /home/[COLOR="Red"]your username[/COLOR]/android/boot.img-tools/
Code:
tools/mkbootfs boot | gzip > unpack/boot.img-ramdisk.gz
Repack boot.img
Code:
cd /home/[COLOR="Red"]your username[/COLOR]/android/boot.img-tools/
Code:
tools/mkbootimg --kernel unpack/zImage --ramdisk unpack/boot.img-ramdisk.gz -o target_img/boot.img --base `cat unpack/boot.img-base`
If you want flash boot.img through download mode
Code:
cd /home/[COLOR="Red"]your username[/COLOR]/android/boot.img-tools/target_img
Code:
tar cvf boot.tar boot.img
Or you can make CWM zip
Now taste your work:
sakindia123 said:
u just have to edit a few lines in config.
Click to expand...
Click to collapse
i know that...bt that dosnt means all do..this guide's fr all !!! the OP is doin a really gud job ... the most required thread here !!
awesome work man !!
hats off
Great tutorial awesome
+10000
Related
If someone has a stock RC30 installed, can you tell me what user id runs adbd and debuggerd?
To be able to debug processes and take screenshots, those processes must running be with some sort of privileged permissions and may be exploitable...
debuggerd runs as root, adbd runs as shell (that's on my official RC30 phone)
Hmm, in that case, it may actually be possible to take a screenshot without root by writing an ADB client in Java to connect to the adb daemon. And, shell also has access to the surface flinger, so it may be possible to do autorotation as well.
Anyways, I'll take a look at debuggerd and see if there anything interesting.
I did find some funny code in debuggerd.c a minute ago. Watch your phone's LED and type this into a root shell:
echo 255 > /sys/class/leds/red/brightness
Yup.
http://forum.xda-developers.com/showthread.php?p=2905504&highlight=backlight#post2905504
Holy ****!!! There may be a root hole in installd:
installd runs as root; it is the daemon that allows you to do the following commands related to installing and uninstalling APKs and managing their DEX files.
Code:
{ "ping", 0, do_ping },
{ "install", 3, do_install },
{ "dexopt", 3, do_dexopt },
{ "movedex", 2, do_move_dex },
{ "rmdex", 1, do_rm_dex },
{ "remove", 1, do_remove },
{ "freecache", 1, do_free_cache },
{ "rmcache", 1, do_rm_cache },
{ "protect", 2, do_protect },
{ "getsize", 3, do_get_size },
{ "rmuserdata", 1, do_rm_user_data },
The install daemon reads these commands from a socket and then executes them.
The interesting command is the "install" command, which maps to the following function:
Code:
static int do_install(char **arg, char reply[REPLY_MAX])
{
return install(arg[0], atoi(arg[1]), atoi(arg[2])); /* pkgname, uid, gid */
}
int install(const char *pkgname, uid_t uid, gid_t gid)
{
char pkgdir[PKG_PATH_MAX];
char libdir[PKG_PATH_MAX];
if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) {
LOGE("invalid uid/gid: %d %d\n", uid, gid);
return -1;
}
if (create_pkg_path(pkgdir, PKG_DIR_PREFIX, pkgname, PKG_DIR_POSTFIX))
return -1;
if (create_pkg_path(libdir, PKG_LIB_PREFIX, pkgname, PKG_LIB_POSTFIX))
return -1;
if (mkdir(pkgdir, 0755) < 0) {
LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
return -errno;
}
if (chown(pkgdir, uid, gid) < 0) {
LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
unlink(pkgdir);
return -errno;
}
if (mkdir(libdir, 0755) < 0) {
LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno));
unlink(pkgdir);
return -errno;
}
if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) {
LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno));
unlink(libdir);
unlink(pkgdir);
return -errno;
}
return 0;
}
The 2nd and 3rd arguments let you specify an ARBITRARY uid that owns that package. I think we can either rebuild adb to always pass in uid 0 and gid 0 (this may not be possible; adb may not have anything to do with the uid/gid selected). Or maybe connect to the socket from an application on the phone, and then marshall the command manually. That would get an APK onto the phone running as root.
Gonna give this a shot right now.
Look at the beginning of the function.
Code:
if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) {
LOGE("invalid uid/gid: %d %d\n", uid, gid);
return -1;
That will disallow installing something with root access. AID_SYSTEM is 1000, the root uid is 0 of course.
But if we could get an app installed as the system user.. that may open up some more possibilities.
Also, I believe the socket that installd listens on is protected. If I remember correctly, it is restricted to the system user.
JesusFreke said:
Look at the beginning of the function.
Code:
if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) {
LOGE("invalid uid/gid: %d %d\n", uid, gid);
return -1;
That will disallow installing something with root access. AID_SYSTEM is 1000, the root uid is 0 of course.
But if we could get an app installed as the system user.. that may open up some more possibilities.
Also, I believe the socket that installd listens on is protected. If I remember correctly, it is restricted to the system user.
Click to expand...
Click to collapse
Ahh goddamnit.
Hello there,
Im trying to create my own file explorer (a very stripped down one) with root privileges just to learn how to code for android. Anyways, i am able to access my /system folder and look in every folder besides the /data folder. There are no subdirectories... its just empty. When i check through ADB or through terminal emulator, i can see al the folders in the /data folder. So what am i doing wrong???
I have this setup for now,
Code:
final Runtime runtime = Runtime.getRuntime();
try {
runtime.exec("su");
}
just go get root access, but i dont even know if thats correct. The app asks for root permissions and i can accept it but i still cant view the /data folder...
I also tried
Code:
runtime.exec("mount -o remount,ro -t yaffs2 /dev/block/mtdblock5 /data");
and
Code:
runtime.exec("mount -o remount,rw -t yaffs2 /dev/block/mtdblock5 /data");
and still nothing...
nephron said:
Hello there,
Im trying to create my own file explorer (a very stripped down one) with root privileges just to learn how to code for android. Anyways, i am able to access my /system folder and look in every folder besides the /data folder. There are no subdirectories... its just empty. When i check through ADB or through terminal emulator, i can see al the folders in the /data folder. So what am i doing wrong???
I have this setup for now,
Code:
final Runtime runtime = Runtime.getRuntime();
try {
runtime.exec("su");
}
just go get root access, but i dont even know if thats correct. The app asks for root permissions and i can accept it but i still cant view the /data folder...
I also tried
Code:
runtime.exec("mount -o remount,ro -t yaffs2 /dev/block/mtdblock5 /data");
and
Code:
runtime.exec("mount -o remount,rw -t yaffs2 /dev/block/mtdblock5 /data");
and still nothing...
Click to expand...
Click to collapse
you don't actually have root
adb shell
Code:
# ls -l
drwxrwx--x 1 system system 2048 Jan 9 22:30 data
drwxr-xr-x 1 root root 2048 Jan 13 10:42 system
data is owned by system, and can only be read by system ( and root )
system is owned by root and can be read by everybody
you executed su
which got you root, but it didn't actually do anything, your app did not inherit root permissions
Firerat said:
you don't actually have root
adb shell
Code:
# ls -l
drwxrwx--x 1 system system 2048 Jan 9 22:30 data
drwxr-xr-x 1 root root 2048 Jan 13 10:42 system
data is owned by system, and can only be read by system ( and root )
system is owned by root and can be read by everybody
you executed su
which got you root, but it didn't actually do anything, your app did not inherit root permissions
Click to expand...
Click to collapse
Hmmmm alright. Well what i can do to make my app inherit root permissions?
edit:
I was able to view the contents of /data by changing the permissions on the folder itself using:
Code:
runRootCommand("chmod 555 /data");
which would make it read-only and
Code:
runRootCommand("chmod 777 /data");
which would make it read/write (i think, maybe 755?)
where runRootCommand is :
Code:
public static boolean runRootCommand(String command) {
Process process = null;
DataOutputStream os = null;
try {
process = Runtime.getRuntime().exec("su");
os = new DataOutputStream(process.getOutputStream());
os.writeBytes(command+"\n");
os.writeBytes("exit\n");
os.flush();
process.waitFor();
} catch (Exception e) {
Log.d("*** DEBUG ***", "Unexpected error - Here is what I know: "+e.getMessage());
return false;
}
finally {
try {
if (os != null) {
os.close();
}
process.destroy();
} catch (Exception e) {
// nothing
}
}
return true;
}
nephron said:
Hmmmm alright. Well what i can do to make my app inherit root permissions?
edit:
I was able to view the contents of /data by changing the permissions on the folder itself using:
Code:
runRootCommand("chmod 555 /data");
which would make it read-only and
Code:
runRootCommand("chmod 777 /data");
which would make it read/write (i think, maybe 755?)
where runRootCommand is :
Code:
public static boolean runRootCommand(String command) {
Process process = null;
DataOutputStream os = null;
try {
process = Runtime.getRuntime().exec("su");
os = new DataOutputStream(process.getOutputStream());
os.writeBytes(command+"\n");
os.writeBytes("exit\n");
os.flush();
process.waitFor();
} catch (Exception e) {
Log.d("*** DEBUG ***", "Unexpected error - Here is what I know: "+e.getMessage());
return false;
}
finally {
try {
if (os != null) {
os.close();
}
process.destroy();
} catch (Exception e) {
// nothing
}
}
return true;
}
Click to expand...
Click to collapse
hmm,
not an app I would recommend to anyone
Firerat said:
hmm,
not an app I would recommend to anyone
Click to expand...
Click to collapse
lol not trying to sell the app. Just trying to learn. Would appreciate the help though...
There are a number of chinese dual sim phones using the chipset MTK6573
Unfortunately the manufacturer has chosen to be very secretive about the kernel and
1) Has not published the source code
2) Has not included the kernel .config file in the compilation
3) Has not compiled ext2, ext3 or ext4 support in the kernel
In an effort to overcome some of those limitations I have gathered the exact same version of the android kernel used in current roms (2.6.35.7) and tried to come up with a configuraration that produces modules (.ko) that can be loaded and used from MTK6573 based devices.
Instructions for compiling the kernel:
Pre-requirements:
a) check with uname -a in your device that the kernel version is 2.6.35.7
b) Download this file with the kernel source and the arm toolchain:
http://www.ziddu.com/download/18628468/androidkernelANDtoolchain.rar.html
1) Unpack the .rar file and extract the toolchain to your home folder
2) Extract the kernel sources somewhere you like
3) Open a bash terminal and cd into the folder containing the kernel source
4 ) make -j8 ARCH=arm menuconfig
That should open a menu and you will be able to modify options, the chosen system is a qualcom MSM as this is the closest thing I could find to the MTK6573
5) Compile with:
make -j8 ARCH=arm CROSS_COMPILE=~/code/distro/kernel/arm-2011.03/bin/arm-none-eabi-
6) to test the ext2.ko module
adb push fs/ext2/ext2.ko /data/local/
adb shell
insmod /data/local/ext2/ko
7) Try to mount an ext2 partition
We are really trying to overcome this situation and all the help is appreciated.
So far all the ext2.ko modules built can be loaded without any error, but as soon as the mount command is issued the phone immediately reboots. I can't even log anything. Any ideas?
EDIT:
Code:
lsmod
pvrsrvkm 151229 29 mtklfb, Live 0xbf000000
mtklfb 11329 0 - Live 0xbf033000
mtk_drvb 8436 0 - Live 0xbf03c000 (P)
lca_core 2706 0 - Live 0xbf044000 (P)
mtk_stp_core 211207 5 mt6620_fm_drv,mtk_stp_bt,mtk_stp_gps,mtk_stp_wmt,mtk_stp_u
art, Live 0xbf04a000 (P)
mtk_stp_uart 20598 1 - Live 0xbf087000 (P)
mtk_hif_sdio 10961 2 wlan,mtk_stp_wmt, Live 0xbf092000
mtk_stp_wmt 88860 6 wlan,mtk_fm_priv,mt6620_fm_drv,mtk_stp_bt,mtk_stp_gps, Live
0xbf09b000 (P)
mtk_stp_gps 37165 0 - Live 0xbf0ba000
mtk_stp_bt 39581 1 - Live 0xbf0c9000
mt6620_fm_drv 99803 1 mtk_fm_priv, Live 0xbf0d8000
mtk_fm_priv 7205 0 - Live 0xbf0f9000 (P)
wlan 255235 2 - Live 0xbf100000 (P)
ext2 44907 0 [permanent], Live 0xbf154000
ccci 195306 18 sec,ccmni, Live 0xbf167000 (P)
ccmni 16270 0 - Live 0xbf1a4000 (P)
mt6573_m4u 62946 0 - Live 0xbf1ae000 (P)
mt6573_mfv_kernel_driver 341502 0 - Live 0xbf1c5000 (P)
sec 52226 0 - Live 0xbf21f000 (P)
xlog 89315 24 - Live 0xbf233000 (P)
As you can see, ext2 module is loaded and cat /proc/filesystems confirms:
Code:
cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev tmpfs
nodev sockfs
nodev pipefs
nodev anon_inodefs
nodev devpts
nodev ramfs
vfat
msdos
yaffs
yaffs2
nodev mqueue
nodev mtd_inodefs
ext2
/sd-ext is created and the mount command that I'm issuing is:
Code:
busybox mount -r -w -t ext2 /dev/block/mmcblk0p2 /sd-ext
I think the memory allocation is using something non-standard, perhaps the kernel for the mtk6516 is similar enough...
http://groups.google.com/group/mt6516-linux/browse_thread/thread/2b6896ce22570932
I tried this, but unsuccessful.
/data/local # insmod ext3.ko
insmod: can't insert 'ext3.ko': invalid module format
/data/local # insmod ext2.ko
insmod: can't insert 'ext2.ko': invalid module format
/data/local # insmod ext4.ko
insmod: can't insert 'ext4.ko': invalid module format
You could provide the modules compiled for us?
The kernel also does not support swap.
Thank you.
kindly post the output of (after trying insmod ext2.ko )
dmesg
and
uname -a
riystetyt said:
I tried this, but unsuccessful.
/data/local # insmod ext3.ko
insmod: can't insert 'ext3.ko': invalid module format
/data/local # insmod ext2.ko
insmod: can't insert 'ext2.ko': invalid module format
/data/local # insmod ext4.ko
insmod: can't insert 'ext4.ko': invalid module format
You could provide the modules compiled for us?
The kernel also does not support swap.
Thank you.
Click to expand...
Click to collapse
Hello, thanks for your quick answer!
Errors for ext2.ko in dmesg:
[30005.453739] ext2: Unknown symbol kmalloc_caches (err 0)
[30005.454575] [17976:insmod] sig 17 to [11249:sh]
uname -a:
/data/local # uname -a
Linux localhost 2.6.35.7 #1 PREEMPT Mon Jan 9 16:05:35 CST 2012 armv6l GNU/Linux
Thanks for your help!
Is this the ext2.ko module you are trying to load?
ls -l /system/lib/modules/ext2.ko
-rw-r--r-- root root 756026 2012-05-02 18:20 ext2.ko
Hello, I get the ext2.ko in your post on eten-users. Works like a charm! I had only about 8MB free and now with your module and Link2sd has 120MB. Thanks!
Glad it helps you.
In truth I don´t know what mediatek were thinking when they released an android kernel with so little nand storage space and no ext2 support.
Hex Freq Value MTK CPU
Code:
0x68t
0xdft
0x41t
0xd8t
0xeat
0xf8t
0x91t
0x7t
0x19t
0x27t
0x64t
0xf1t
0x93t
0xedt
0x21t
0x59t
0x6ft
0x1t
0x83t
0x39t
Could you please post the ext2.ko that works with the 2.6.35.7? The one that riystetyt points.
You can download it from one of my G11i Pro or HD7 ROMs (check my signature).
Great, checking now.
Did you try compiling zram for the mtk6573?
---------- Post added at 04:12 PM ---------- Previous post was at 03:24 PM ----------
By the way, how did you solve the "invalid module format" issue?
Thanks for your replies
build <drivers> error 2
Where i miss?
@casacristo
Any updates on the compressed swap? I can help testing
My phone has the 2.6.35.7 kernel mt6573
I tried to download the .rar from eten-users but the dropbox link is broken.
Thanks...
casacristo?
bump
Why don't you ask him via PM instead of doing bumps? Probably he's busy to look at this thread...
maybe its help?
http://www.pudn.com/downloads391/doc/comm/detail1673271.html
Thanks for the suggestion but tried sending a private sms to casacristo with no luck.
Sadly I also found that if the kernel does not support swap, swap can't be loaded as a module, so we can't compile a swap module.
The page provided has the datasheet which as far as I know has the technical specs of the mt6573 processor, not the kernel, but I hope there is something there that can be used to compile a custom kernel.
---------- Post added at 10:06 AM ---------- Previous post was at 10:01 AM ----------
Hey just found this: what does it mean? the guy who posted this has the source?
================================================================================================
drivers debug
-------------------------------------------------------------------------------------------------------------
board_init
-------------------------------------------------------------------------------------------------------------
/mediatek/platform/mt6573/kernel/core/mt6573_devs.c
所有的驱动名对应的设备名都可以在这里找到!
-------------------------------------------------------------------------------------------------------------
lcd
-------------------------------------------------------------------------------------------------------------
/mediatek/custom/common/uboot/lcm
/mediatek/custom/common/kernel/lcm
CUSTOM_UBOOT_LCM = ili9481_dpi
***********************************************************
LCM_WIDTH = 320
LCM_HEIGHT = 480
CUSTOM_UBOOT_LCM = ili9481_dpi
CUSTOM_KERNEL_LCM = ili9481_dpi
***********************************************************
-------------------------------------------------------------------------------------------------------------
camera
-------------------------------------------------------------------------------------------------------------
kernel
/mediatek/custom/common/kernel/imgsensor/src
kd_imgsensor.h
kd_sensorlist.h
hal
/mediatek/custom/common/hal/imgsensor/
sensorlist.cpp
MTKCameraHardware.cpp
***********************************************************
CUSTOM_HAL_CAMERA = camera
CUSTOM_HAL_IMGSENSOR = gc2015_yuv
CUSTOM_KERNEL_IMGSENSOR = gc2015_yuv
CUSTOM_HAL_MAIN_IMGSENSOR = gc2015_yuv
CUSTOM_KERNEL_MAIN_IMGSENSOR = gc2015_yuv
***********************************************************
-------------------------------------------------------------------------------------------------------------
TouchPanel
-------------------------------------------------------------------------------------------------------------
/mediatek/custom/common/kernel/touchpanel/src/mtk_tpd.c
tpd_driver_add(&tpd_device_driver);
platform_driver_unregister(&tpd_driver);
***********************************************************
CUSTOM_KERNEL_TOUCHPANEL = COMM
# default settings: generic
# candidate settings: generic;eeti_pcap7200
# select the panel used by certain project.
***********************************************************
-------------------------------------------------------------------------------------------------------------
flash
-------------------------------------------------------------------------------------------------------------
CUSTOM_MEMORY_HDR = mediatek/custom/$(PROJECT)/preloader/inc/custom_MemoryDevice.h
CUSTOM_NAND_HDR = mediatek/custom/$(PROJECT)/common/nand_device_list.h
MEMORY_DEVICE_XLS = mediatek/build/tools/emigen/$(MTK_PLATFORM)/MemoryDeviceList_$(MTK_PLATFORM).xls
-------------------------------------------------------------------------------------------------------------
GPIO_config
-------------------------------------------------------------------------------------------------------------
./mediatek/build/makemtk.mk +294
drvgen:
ifneq ($(PROJECT),generic)
$(hide) echo $(SHOWTIME) [email protected]
$(hide) echo -e \\t\\t\\t\\b\\b\\b\\bLOG: $(S_LOG)[email protected]
$(hide) mediatek/source/dct/DrvGen mediatek/custom/$(PROJECT)/kernel/dct/dct/codegen.dws $(DEAL_STDOUT_DRVGEN) && \
$(SHOWRSLT) $$? $(LOG)[email protected] || \
$(SHOWRSLT) $$? $(LOG)[email protected]
endif
*********************************************
mediatek/source/dct/DrvGen
mediatek/custom/$(PROJECT)/kernel/dct/dct/codegen.dws
*********************************************
-------------------------------------------------------------------------------------------------------------
G-sensor
-------------------------------------------------------------------------------------------------------------
int hwmsen_gsensor_add(struct sensor_init_info* obj)
/mediatek/custom/common/kernel/accelerometer/auto/
/mediatek/config/mtk/ProjectConfig.mk:188:MTK_SENSOR_SUPPORT = yes
# Android sensor device
MTK_SENSOR_SUPPORT = yes
CUSTOM_KERNEL_MAGNETOMETER =
#akm8962
#akm8975
#auto for detcet by lilingyun
CUSTOM_KERNEL_ACCELEROMETER = auto
CUSTOM_KERNEL_ALSPS = tmd2771
CUSTOM_KERNEL_BAROMETER =
CUSTOM_KERNEL_GYROSCOPE =
#l3g4200d
#if defined(MTK_AUTO_DETECT_ACCELEROMETER)
/mediatek/source/kernel/drivers/hwmon/hwmsen/Hwmsen_dev.c
********************************************
#auto for detcet by lilingyun
CUSTOM_KERNEL_ACCELEROMETER = auto
*******************************************
-------------------------------------------------------------------------------------------------------------
compass
-------------------------------------------------------------------------------------------------------------
mediatek/custom/common/kernel/magnetometer/akm8962/akm8962.c
mediatek/custom/tm100/kernel/magnetometer/akm8962/cust_mag.c
*********************************************
CUSTOM_KERNEL_MAGNETOMETER =
#akm8962
#akm8975
********************************************
-------------------------------------------------------------------------------------------------------------
ALS/PS 光感 接近传感器
-------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_ALSPS = tmd2771
*********************************************
mediatek/custom/common/kernel/alsps/tmd2771/tmd2771.c
mediatek/custom/common/kernel/alsps/tmd2771/tmd2771.h
mediatek/custom/tm100/kernel/alsps/tmd2771/cust_alsps.c
-------------------------------------------------------------------------------------------------------------
GYRO-sensor motion sensor 陀螺仪
-------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_GYROSCOPE =
#l3g4200d
*********************************************
mediatek/custom/common/kernel/gyroscope/l3g4200d/l3g4200d.c
mediatek/custom/tm100/kernel/gyroscope/l3g4200d/cust_gyro.c
-------------------------------------------------------------------------------------------------------------
BAROMETER-sensor 气压计
-------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_BAROMETER =
#ms5607
*********************************************
mediatek/custom/tm100/kernel/barometer/ms5607/cust_baro.c
mediatek/custom/common/kernel/barometer/ms5607/ms5607.c
------------------------------------------------------------------------------------------------------------
flashlight
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_HAL_FLASHLIGHT = dummy_flashlight
CUSTOM_KERNEL_FLASHLIGHT = dummy_flashlight
*********************************************
mediatek/custom/common/kernel/flashlight/dummy_flashlight/dummy_flashlight.c
mediatek/custom/common/kernel/flashlight/src/kd_flashlightlist.c
------------------------------------------------------------------------------------------------------------
jogball
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_JOGBALL =
*********************************************
mediatek/custom/common/kernel/jogball/
------------------------------------------------------------------------------------------------------------
leds
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_LEDS = mt65xx
*********************************************
mediatek/custom/common/kernel/leds
------------------------------------------------------------------------------------------------------------
matv
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_HAL_MATV =
CUSTOM_KERNEL_MATV =
HAVE_MATV_FEATURE = no
*********************************************
mediatek/custom/common/kernel/matv/mt5193/matv.c
------------------------------------------------------------------------------------------------------------
sound
------------------------------------------------------------------------------------------------------------
*********************************************
MTK_SOUNDRECORDER_APP = yes
CUSTOM_KERNEL_SOUND = speaker
*********************************************
mediatek/custom/common/kernel/sound/inc/yusu_android_speaker.h
mediatek/custom/tm100/kernel/sound/speaker/yusu_android_speaker.c
------------------------------------------------------------------------------------------------------------
USB
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_USB = mt6573
*********************************************
mediatek/custom/common/kernel/usb/src/Makefile
mediatek/custom/mt6573/kernel/usb/src/mtk_usb_custom.c
mediatek/custom/mt6573/kernel/usb/src/mtk_usb_custom.h
mediatek/custom/mt6573/uboot/inc/cust_sdc.h
mediatek/platform/mt6573/kernel/drivers/usb-gadget/
mediatek/platform/mt6573/kernel/drivers/power/
------------------------------------------------------------------------------------------------------------
BT
------------------------------------------------------------------------------------------------------------
*********************************************
MTK_WLAN_CHIP = MT6620
# candidate settings: MT6620
MTK_BT_CHIP = MTK_MT6620
# candidate settings: MTK_MT6611/MTK_MT6612/MTK_MT6616/MTK_MT6620
MTK_WLAN_SUPPORT = yes
MTK_BT_SUPPORT = yes
MTK_WLAN_SUPPORT = yes
MTK_WLANBT_SINGLEANT = no
MTK_BT_30_HS_SUPPORT = yes
####config BT feature###########
# please do not modify these options
MTK_BT_21_SUPPORT = yes
MTK_BT_30_SUPPORT = yes
MTK_BT_40_SUPPORT = yes
MTK_BT_FM_OVER_BT_VIA_CONTROLLER = yes
MTK_BT_PROFILE_OPP = yes
MTK_BT_PROFILE_SIMAP = yes
MTK_BT_PROFILE_PRXM = yes
MTK_BT_PROFILE_PRXR = yes
MTK_BT_PROFILE_HIDH = yes
MTK_BT_PROFILE_FTP = yes
MTK_BT_PROFILE_PBAP = yes
MTK_BT_PROFILE_MANAGER = yes
MTK_BT_PROFILE_BPP = yes
MTK_BT_PROFILE_BIP = yes
MTK_BT_PROFILE_DUN = yes
MTK_BT_PROFILE_PAN = yes
MTK_BT_PROFILE_HFP = yes
MTK_BT_PROFILE_A2DP = yes
MTK_BT_PROFILE_AVRCP = yes
MTK_BT_PROFILE_AVRCP14 = yes
MTK_BT_PROFILE_TIMEC = no
MTK_BT_PROFILE_TIMES = no
MTK_BT_PROFILE_MAPS = no
MTK_BT_PROFILE_MAPC = no
MTK_BT_PROFILE_SPP = yes
####config BT feature end ####
*********************************************
mediatek/custom/common/kernel/btwlanem/btwlanem/btwlanem.c
------------------------------------------------------------------------------------------------------------
EEPROM
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_HAL_EEPROM = dummy_eeprom
CUSTOM_KERNEL_EEPROM = dummy_eeprom
*********************************************
mediatek/custom/common/kernel/eeprom/dummy_eeprom/dummy_eeprom.c
------------------------------------------------------------------------------------------------------------
FM
------------------------------------------------------------------------------------------------------------
*********************************************
MTK_FM_CHIP = MT6620_FM
MTK_FM_SUPPORT = yes
MTK_FM_TX_SUPPORT = yes
MTK_FM_AUDIO = FM_ANALOG_INPUT
#FM_DIGITAL_INPUT
*********************************************
mediatek/custom/common/kernel/fm/mt6620/dummy.c
------------------------------------------------------------------------------------------------------------
voice coil motor driver
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_HAL_LENS = dummy_lens dummy_lens
CUSTOM_KERNEL_LENS = dummy_lens dummy_lens
CUSTOM_HAL_MAIN_LENS = dummy_lens
CUSTOM_HAL_MAIN_BACKUP_LENS =
CUSTOM_HAL_SUB_LENS = dummy_lens
CUSTOM_HAL_SUB_BACKUP_LENS =
CUSTOM_KERNEL_MAIN_LENS = dummy_lens
CUSTOM_KERNEL_MAIN_BACKUP_LENS =
CUSTOM_KERNEL_SUB_LENS = dummy_lens
CUSTOM_KERNEL_SUB_BACKUP_LENS =
*********************************************
mediatek/custom/common/kernel/lens/dummy_lens/dummy_lens.c
------------------------------------------------------------------------------------------------------------
OFN
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_OFN = ofn1090
*********************************************
mediatek/custom/common/kernel/ofn/inc
mediatek/custom/tm100/kernel/ofn/ofn1090/cust_ofn.c
------------------------------------------------------------------------------------------------------------
wifi
-----------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_WIFI =
MTK_SCREEN_OFF_WIFI_OFF = no
MTK_WIFI_P2P_SUPPORT = yes
MTK_WIFI_HOTSPOT_SUPPORT = yes
*********************************************
mediatek/custom/common/kernel/wifi/mt592x/dummy.c
------------------------------------------------------------------------------------------------------------
HEADSET
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_HEADSET = accdet
MTK_HEADSET_ICON_SUPPORT = yes
*********************************************
mediatek/custom/tm100/kernel/headset/accdet/accdet_custom.h
------------------------------------------------------------------------------------------------------------
board 配置与分区信息
------------------------------------------------------------------------------------------------------------
*********************************************
*********************************************
mediatek/custom/tm100/kernel/core/src/board.c
mediatek/custom/tm100/kernel/core/src/partition.c
------------------------------------------------------------------------------------------------------------
PM
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_BATTERY = battery
*********************************************
mediatek/custom/tm100/kernel/battery/battery/cust_battery.h
mediatek/custom/tm100/kernel/battery/battery/custom_fuel_gauge.h
mediatek/platform/mt6573/kernel/drivers/power/mt6573_battery.c
------------------------------------------------------------------------------------------------------------
RTC
------------------------------------------------------------------------------------------------------------
*********************************************
CUSTOM_KERNEL_RTC = rtc
# default settings: rtc
# candidate settings: rtc
# For RTC
*********************************************
mediatek/custom/tm100/kernel/rtc/rtc/rtc-mt6573.h
mediatek/platform/mt6573/kernel/drivers/rtc/mtk_rtc.c
I've found building AOSP and its various offshoots (AOKP, Cyanogenmod, Evervolv, ParanoidAndroid) sometimes a bit frustrating to figure out. Although the source code and tutorials are usually around, I've still had a lot of problem getting code to compile. I put together a little python script to help diagnose particular issues like missing libraries, header files, etc and dump that into readable JSON output. It's still very much a work in progress (WIP), but I figure it may help some people out.
What I plan on adding is comparison of the versions of local binaries with the latest versions, and complaining when things are out of date or just not working.
You can access the code here: https://github.com/shurane/aosp_buildcheck
Or if you trust me, you can run the code directly using this line:
Code:
wget -O - raw.github.com/shurane/aosp_buildcheck/master/aosp_buildcheck | python
This is the output you get, including errors:
Code:
errors:
Command '['/bin/bash', '-c', 'adb version 2>/dev/null']' returned non-zero exit status 127
Command '['/bin/bash', '-c', 'which fastboot']' returned non-zero exit status 1
Command '['/bin/bash', '-c', 'find ${PATH//:/ } -maxdepth 1 -name adb -print -quit 2>/dev/null']' returned non-zero exit status 1
Command '['/bin/bash', '-c', 'find ${PATH//:/ } -maxdepth 1 -name fastboot -print -quit 2>/dev/null']' returned non-zero exit status 1
Command '['/bin/bash', '-c', 'which pngout']' returned non-zero exit status 1
{
"aosp_dir": {
"devices": [
"mini_armv7a_neon-userdebug",
"mini_armv7a-userdebug",
"full_maguro-userdebug",
"cm_quincyatt-eng",
"full_vibrantmtd-eng",
"full_panda-userdebug",
"aokp_maguro-userdebug",
"aokp_toro-userdebug",
"aokp_toroplus-userdebug",
"aokp_crespo-userdebug",
"aokp_crespo4g-userdebug",
"aokp_grouper-userdebug",
"aokp_captivatemtd-userdebug",
"aokp_d2att-userdebug",
"aokp_d2tmo-userdebug",
"aokp_d2usc-userdebug",
"aokp_d2vzw-userdebug",
"aokp_evita-userdebug",
"aokp_fascinatemtd-userdebug",
"aokp_galaxysmtd-userdebug",
"aokp_hercules-userdebug",
"aokp_i9100-userdebug",
"aokp_i9100g-userdebug",
"aokp_i9300-userdebug",
"aokp_n7000-userdebug",
"aokp_p3100-userdebug",
"aokp_p3110-userdebug",
"aokp_p3113-userdebug",
"aokp_p5100-userdebug",
"aokp_p5110-userdebug",
"aokp_p5113-userdebug",
"aokp_quincyatt-userdebug",
"aokp_tf101-userdebug",
"aokp_vibrantmtd-userdebug"
],
"projects": {
"aokp": 89,
"aosp": 230,
"cm": 26
},
"projects_total": 345,
"remotes": [
"<remote fetch=\"https://android.googlesource.com/\" name=\"aosp\"/>",
"<remote fetch=\"https://github.com/\" name=\"aokp\" review=\"gerrit.sudoservers.com\"/>",
"<remote fetch=\"https://github.com/CyanogenMod/\" name=\"cm\" review=\"review.cyanogenmod.com\"/>"
]
},
"libGL.so": "/usr/lib/i386-linux-gnu/libGL.so: symbolic link to `/usr/lib/i386-linux-gnu/mesa/libGL.so.1'",
"linux": {
"lsb_release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 12.04.1 LTS\nRelease:\t12.04\nCodename:\tprecise"
},
"optional": {
"ionice": "ionice from util-linux 2.20.1",
"schedtool": "get/set scheduling policies - v1.3.0, GPL'd, NO WARRANTY"
},
"os": "Linux",
"pngtools": {
"optipng": "OptiPNG 0.6.4: Advanced PNG optimizer.\nUsing libpng version 1.2.46 and zlib version 1.2.3.4",
"pngcrush": "pngcrush 1.7.9, uses libpng 1.2.42 and zlib 1.2.3.3",
"pngout": ""
},
"repo": "repo version v1.12.0\n (from https://gerrit.googlesource.com/git-repo)\nrepo launcher version 1.19\n (from /home/kikin/bin/repo)\ngit version 1.7.9.5\nPython 2.7.3 (default, Aug 1 2012, 05:14:39) \n[GCC 4.6.3]",
"tools": {
"adb": "",
"fastboot": "",
"g++": "g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3",
"gcc": "gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3",
"java": "java version \"1.6.0_38\"\nJava(TM) SE Runtime Environment (build 1.6.0_38-b05)\nJava HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)"
},
"uname": "Linux un 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux"
}
Feel free to complain about any outstanding problems with the script and stuff. I would much rather prefer pull requests over github if you guys have the knowhow to implement features.
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'