[Kernel] [MTC20K] [NBD90W] - Nexus 5X Superboot ForceEncrypt Disabled & Init.d - Nexus 5X Android Development

NEXUS 5X Superboot​WARNING: I am not responsible for anything that happens as a result of flashing these modified boot images.
This kernel is based on MTC20K (Marshmellow) & NBD90W (Nougat) stock builds. It features several mods added by me & continues the work of others. Consider it my lil experiment for now.
Features:
System verification disabled
Force encrypt /data disabled
System mode root on boot
Init.d support
Chainfire modified sepolicy
Insecure ADB Version
Allows su binary update
More to come?
Coming Soon:
LostAndroid
Chainfire Liveboot
Device Admin Restore
One click install
Changes made:
ramdisk/sepolicy: replaced using:
Code:
supolicy --save outfile /sdcard/sepolicy
(outputted from rooted N5X in system mode)
ramdisk/fstab.bullhead: changed "forceencrypt" to "encryptable" and removed verification
Code:
/dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,[COLOR="green"]encryptable[/COLOR]=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata
/dev/block/platform/soc.0/f9824900.sdhci/by-name/system /system ext4 ro,barrier=1 wait[COLOR="red"][STRIKE],verify=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata[/STRIKE] [/COLOR]
/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor /vendor ext4 ro,barrier=1 wait[COLOR="red"][STRIKE],verify=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata[/STRIKE][/COLOR]
ramdisk/init.rc: added services daemonsu, superboot, init.d
Code:
##Superboot MOD added by:
##[email protected]
service superboot /system/bin/sh /superboot.sh
class main
user root
group root
oneshot
service daemonsu /sbin/daemonsu --auto-daemon
class late_start
user root
group root
oneshot
on property:ro.daemonsu.persist=1
start daemonsu
on property:ro.supersu.persist=0
stop daemonsu
## Init.d MOD by [email protected]
service userinit /sbin/busybox run-parts /system/etc/init.d
class late_start
user root
group root
oneshot
on property:ro.init.d=1
start userinit
on property:ro.init.d=0
stop userinit
ramdisk/superboot.sh
Code:
#!/sbin/sh
##SUPERBOOT MOD ADDED BY:
##[email protected]
mount /system
mount /data
mount -o rw,remount /system
mount -o rw,remount /system /system
mount -o rw,remount /
mount -o rw,remount / /
if ! -e /system/xbin; then
mkdir /system/xbin
fi
if ! -e /system/daemonsu; then
cat /superboot/su>/system/xbin/daemonsu
cp /superboot/su /system/xbin/daemonsu
fi
if ! -e /system/su; then
cat /superboot/su>/system/xbin/su
cp /superboot/su /system/xbin/su
fi
if ! -e /system/lib64/libsupol.so; then
cat /superboot/libsupol.so /system/lib64/libsupol.so
cp /superboot/libsupol.so /system/lib64/libsupol.so
fi
if ! -e /system/xbin/supolicy; then
cat /superboot/supolicy>/system/xbin/supolicy
cp /superboot/supolicy /sytem/xbin/supolicy
fi
echo 1 > /system/etc/.installed_su_daemon
chmod 6755 /system/xbin/su
chmod 6755 /system/xbin/daemonsu
chmod 644 /system/etc/.installed_su_daemon
chmod 644 /system/lib64/libsupol.so
chmod 755 /system/xbin/supolicy
rm /system/recovery-from-boot.*
sync
mount -o ro,remount /system
mount -o ro,remount /system /system
mount -o ro,remount /
mount -o ro,remount / /
other additions to ramdisk:
Code:
ramdisk/sbin/busybox
ramdisk/sbin/daemonsu
ramdisk/sbin/sh
ramdisk/superboot/libsupol.so
ramdisk/superboot/su
ramdisk/superboot/supolicy
HIGH RISK TESTING
NBD90W
Please participate in poll if using this version to let me and the community know if this works as expected. Does it boot, root, init.d work?
Downloads:
NBD90W
MTC20K
All changes made with the help of Android Image Kitchen by osm0sis
If you like my work and others, show that love with a thumbs up
XDA:DevDB Information
Nexus 5X Superboot Autoroot, Kernel for the LG Nexus 5X
Contributors
Geofferey, c3k, CNBLACK
Kernel Special Features: force encrypt disabled, dm-verity disabled, init.d, superboot
Version Information
Status: Testing
Current Stable Version: MTC20K
Current Beta Version: NBD90W
Created 2016-10-13
Last Updated 2016-10-17

Reserved

Lol is it to early to request nougat xD. Nice build bro.

Haha I will try it tomorrow. I don't know if there is any new security in the boot.img that will affect it. I will make one and upload for you to test, if it works out I will put it up. Might even get it tonight.
edit:
I'm going to upload a Nougat Kernel FOR TESTING, beware!!! Let me know what happens and if it boots or not. I am not on Nougat so I can not test myself.

How can I use init.d?
Should I have root permission?
Do I have to create folder "init.d" in /system/etc/ then copy init.d script file there ? just done it?

Just create init.d folder in /etc if it doesn't exist. What version did you use? This kernel automatically roots the phone.

lol My nickname included to contributor!
Okay.. So, SYSTEM-MODE root is work on your modified boot image?

Yup, lol if it wasnt for you i wouldnt have known how.
On the MTC20K it does for sure afaik. The NBD90W nobody has told me. Should in theory tho.

Related

Telstra T-Touch Tab aka Huawei S7 root

Hey guys, just got my hands on one of these suckers, it runs 2.1
Can anyone point me in the right direction to get root?
Im also looking for froyo, however dont expect it soon, manufacturer is working on it.
Sent from my S7 using XDA App
I second davidcampbell! We need froyo here
The root method is the same as the s7.
download z4root from market and root, after wards install busybox by titanium backup and you are set.
The app2sd mod works for this device since it is similar to the sony x10 on 2.1 but is risky because i lost wifi aftewards. So just explore until we get some real developers working on it hopefully cm6.1 port but after huawei realeases the recovery.img and source to mess around with though.
being able to overclock to 1ghz wouldnt hurt either.
S7 Bootloader?
Has anyone figured out how to get into the bootloader for this device?
Havent been able to through any apps \ commands. Just go to a black screen and thats it, and recovery sends you into factory settings for your device
I only know that pressing back key and call\send key when when powering on the device puts it into update mode.
alexisprz said:
The root method is the same as the s7.
download z4root from market and root, after wards install busybox by titanium backup and you are set.
The app2sd mod works for this device since it is similar to the sony x10 on 2.1 but is risky because i lost wifi aftewards. So just explore until we get some real developers working on it hopefully cm6.1 port but after huawei realeases the recovery.img and source to mess around with though.
being able to overclock to 1ghz wouldnt hurt either.
Click to expand...
Click to collapse
Zomg, nice, thank you alexisprz, it's rooting time
I really wish Android had a better term for rooting, it sounds like I'm either breaking it, or trying to cram my man bits into it some how.
Will this affect my ability to use the manufacturers update to froyo in the future?
UPDATE: z4root worked great, I installed busybox no problemo, very happy forum member here
sir i just bought one telstra touch tab can you plz help me to debrand it and unlock it i also have jtag too
pre needs, new rom and rooted with busybox on SD with linux ext2/3 Partition.
download z4root from market and root
copy 3 files to sd
run App-2-sd.sh
File 1 "App-2-sd.sh"
#!/bin/sh
# untitled.sh
#
#
# Created by Andew Blazely on 5/02/11.
# Copyright 2011 SOFTHOUSE. All rights reserved.
#
# un Hash data if you wish but it will slow the S7 down and cause lots of waiting problems
# pre needs, new rom and rooted with busybox on SD with linux ext2/3 Partition.
# mount the file systems
mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
busybox mkdir /system/sd
mount -t ext2 /dev/block/vold/179:2 /system/sd
# archive dirs (easier than copying)
cd /data/
busybox tar -cvf /system/sd/app.tar app
busybox tar -cvf /system/sd/app-private.tar app-private
# busybox tar -cvf /system/sd/data.tar data
busybox tar -cvf /system/sd/dalvik-cache.tar dalvik-cache
# unpack arcives in correct place
cd /system/sd
busybox tar -xvf app.tar
busybox tar -xvf app-private.tar
# busybox tar -xvf data.tar
busybox tar -xvf dalvik-cache.tar
# cleanup
busybox rm *.tar
# copy and set system files
busybox cp /sdcard/install-recovery.sh /system/etc
busybox cp /sdcard/init-sd.sh /system/etc
busybox chmod 755 /system/etc/install-recovery.sh
busybox chmod 755 /system/etc/init-sd.sh
# un Hash whatis needed if you intend NOT to remove SD
#cd /data/app
#busybox rm -rf *
#cd /data/app-private
#busybox rm -rf *
#cd /data/data/
#busybox rm -rf *
#cd /data/dalvik-cache
#busybox rm -rf *
# binding mount of new file structure
mount -o bind /system/sd/app /data/app
mount -o bind /system/sd/app-private /data/app-private
# mount -o bind /system/sd/data /data/data
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache
reboot
File 2 "init-sd.sh"
#!/system/bin/sh
#
MYLOG=/sdcard/install-recovery.log
echo "$(date) Starting install-recovery.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
# un Hash whatis needed if you intend NOT to remove SD
#echo "$(date) Erasing system files..." >> $MYLOG
#cd /data/app
#busybox rm -rf *
#cd /data/app-private
#busybox rm -rf *
#cd /data/data/
#busybox rm -rf *
#cd /data/dalvik-cache
#busybox rm -rf *
#echo "$(date) Erased system files..." >> $MYLOG
mount -t ext2 /dev/block/vold/179:2 /system/sd 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app-private /data/app-private 1>>$MYLOG 2>>$MYLOG
# Hash this out if you haven't moved /data/data
#mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
# Hash this out if you haven't move /data/dalvik-cache
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing install-recovery.sh" >> $MYLOG
File 3 "install-recovery.sh"
#!/system/bin/sh
#
/system/etc/init-sd.sh&
And BOB's your uncle.. this has worked many times for me give it a try

[ACS][Kernel][How-To] Make your own Plus Kernel **Updated 9/18**

Even though I put this in the Epic forum, this will work on any zImage based android kernel as far as I am aware.. from Eclair to Gingerbread, maybe previous, maybe in the future..
I will post my tweaks here (please give credit), and even my ext4 modules (again please give credit, to both me and Rodderik, as he helped with one of them) for Gingerbread.
First off, you will need either a linux based computer, a remote linux box, or a virtual machine.. I don't think cygwin will be enough. I'm not going to go through the steps of setting that up because it's out of the scope of this How-to, maybe in another post.
Second, you need some scripts to decompile the initramfs from the kernel, or you can do it manually with grep or a hex editor ( I don't recommend ), I'll provide the scripts I use, which I procured from supercurio's project voodoo github then modified to work a little better with zImages that have 2 signatures (happens sometimes) like EH06...
http://chris41g.devphone.org/voodoo.tar.gz
in voodoo/config.sh you will need to set your compiler path.
also read the readme.txt it will pretty much describe how it all works, and remember all the gingebread leaks only work with gzip compression when repacking.
to unpack the initramfs
Code:
./extracter.sh -s "/path/to/original/zImage" -d "/path/where/you/want/initramfs/"
and after a few minutes your initramfs will be wherever you told it to go with -d.
now the initramfs is pretty much the meat and potatoes when repacking a kernel.
adding EXT4
this is a pretty popular request...
to do this you need just a few things, the correct modules, and the correct mount options. both of which i will provide.
the modules for Gingerbread are called ext4.ko and mbcache.ko and need to added to lib/modules in the initramfs - link http://chris41g.devphone.org/gbext4modules.tar.gz
then the following lines need to be added to init.rc lpm.rc and recovery.rc
Code:
insmod /lib/modules/mbcache.ko
insmod /lib/modules/ext4.ko
right around the lines that look like
Code:
insmod /lib/modules/fsr.ko
insmod /lib/modules/fsr_stl.ko
insmod /lib/modules/rfs_glue.ko
insmod /lib/modules/rfs_fat.ko
to the same files look for:
Code:
mount rfs /dev/block/stl9 /system check=no
and under it add
Code:
mount ext4 /dev/block/stl9 /system noatime nodiratime errors=continue
now in init.rc and recovery.rc look for
Code:
mount rfs /dev/block/stl10 /data nosuid nodev crypt check=no
and under it add
Code:
mount ext4 /dev/block/stl10 /data nosuid nodev crypt noatime nodiratime
and look for
Code:
mount rfs /dev/block/stl11 /cache nosuid nodev check=no
and under it add
Code:
mount ext4 /dev/block/stl11 /cache nosuid nodev noatime nodiratime errors=continue nobh data=writeback barrier=0 noauto_da_alloc
now usually there will be some stuff you need to comment out.. which means adding # to the beginning of the line..
i always comment this out because it can mess with my tweaks later on and its useless
Code:
mount rfs /dev/block/stl9 /system ro remount
i also comment out or delete left over stuff for other phones that samsung has a habit of leaving in our init.rc... lazy people..
How to Root a Kernel Re-Pack:
This may seem basic, and to some it is, but I'm going to cover it anyway. Also it has changed in gingerbread, as you can't suid anything in /sbin, and that is the beginning of your PATH.
First we need some files.
su binary Stable - http://forum.xda-developers.com/showthread.php?t=682828 Beta - http://chris41g.devphone.org/su3.tar.gz
Superuser.apk Beta - http://chris41g.devphone.org/Superuser.apk
busybox binary (this one is dependent on whether you have purple cwm built in or not, since we havent got that far ill assume you dont) busybox 1.20.0 compiled by me http://chris41g.devphone.org/busybox
copy those files into /sbin in the initramfs, also do a
Code:
ln -s busybox sh
from the sbin directory in your initramfs on your linux box to make a symlink from sh to busybox
then goto the initramfs root
and do
Code:
ln -s sbin bin
to make a symlink from sbin to bin, it's probably not necessary but i always do it for consistency.
now go into /sbin and make a new sh script called whatever you want.
Code:
#!/system/bin/sh
# Remount filesystems RW
busybox mount -o remount,rw /
busybox mount -o remount,rw /system
#install busybox links
busybox cp /sbin/busybox /system/bin/busybox
/system/bin/busybox rm /sbin/busybox
busybox --install -s /system/bin
busybox --install -s /system/xbin
#establish root
busybox cp -f /sbin/su /system/bin/su
chmod 6755 /system/bin/su
busybox rm /sbin/su
busybox ln -s /system/bin/su /system/xbin/su
#check if Superuser.apk exist if not install but also delete bloat to make room
if [ ! -f "/system/app/Superuser.apk" ] && [ ! -f "/data/app/Superuser.apk" ] && [[ ! -f "/data/app/com.noshufou.android.su"* ]]; then
if [ -f "/system/app/Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk" ]; then
busybox rm /system/app/Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk
fi
if [ -f "/system/app/Asphalt5_DEMO_SAMSUNG_D700_Sprint_ML_330.apk" ]; then
busybox rm /system/app/Asphalt5_DEMO_SAMSUNG_D700_Sprint_ML_330.apk
fi
if [ -f "/system/app/FreeHDGameDemos.apk" ]; then
busybox rm /system/app/FreeHDGameDemos.apk
fi
busybox cp /sbin/Superuser.apk /system/app/Superuser.apk
fi
sync
# Fix screwy ownerships
for blip in conf default.prop fota.rc init init.goldfish.rc init.rc init.smdkc110.rc lib lpm.rc modules recovery.rc res sbin bin
do
chown root.shell /$blip
chown root.shell /$blip/*
done
chown root.shell /lib/modules/*
chown root.shell /res/images/*
#setup proper passwd and group files for 3rd party root access
# Thanks DevinXtreme
if [ ! -f "/system/etc/passwd" ]; then
echo "root::0:0:root:/data/local:/system/bin/sh" > /system/etc/passwd
chmod 0666 /system/etc/passwd
fi
if [ ! -f "/system/etc/group" ]; then
echo "root::0:" > /system/etc/group
chmod 0666 /system/etc/group
fi
# fix busybox DNS while system is read-write
if [ ! -f "/system/etc/resolv.conf" ]; then
echo "nameserver 8.8.8.8" >> /system/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /system/etc/resolv.conf
fi
sync
# patch to prevent certain malware apps
if [ -f "/system/bin/profile" ]; then
busybox rm /system/bin/profile
fi
touch /system/bin/profile
chmod 644 /system/bin/profile
# remount read only and continue
busybox mount -o remount,ro /
busybox mount -o remount,ro /system
Now you need to make a change in your init.rc file to call this new script..
add this to your init.rc in the services section, around where the factory bootanimation service is loaded.
Code:
# Custom Script Configuration
service userscript /system/bin/sh /sbin/[whateveryounamedyour].sh
user root
group system
critical
oneshot
now you have rooted your own repack...
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Adding init.d support...
this is pretty easy, didn't want to add another post..
Let's open up /sbin/[whateveryounamedyour].sh
right after installing Superuser.apk, lets add this section...
Code:
if [ -d /system/etc/init.d ]
then
logwrapper busybox run-parts /system/etc/init.d
fi
sync
There ya go, thats it, you're done..
-----------------------------------------------------------------------------------------------------------------------------------------------
Ok, since I'm on a roll haha lets go with bootanimations... they are different on Gingerbread..
this is all done in the init.rc so lets open that up in your text editor, I recommend Geany btw..
First off in GB I had to disable stock animations to make it not look like trash, because they won't always start at the same time.. but it's your option.. ymmv
Code:
service samsungani /system/bin/samsungani
user graphics
group graphics
disabled
oneshot
Comment that section if you want to disable the stock animations... you can leave it and custom animations will still work if you want, but fair warning, its weird...
Code:
service bootanim /system/bin/bootanimation
user graphics
group graphics
critical
oneshot
Add that section to enable custom animations..
I never have but just incase you want to, you can comment this section out to disable boot sounds..
Code:
service playsound /system/bin/playsound
user media
group system
disabled
oneshot
one more thing, the new binary works, but it doesn't know when to stop playing....
add this line to the very end of the init.rc
Code:
on property:sys.boot_completed=1
stop bootanim
Thanks to tanimn for help on that one...
Now remember, before gingerbread, custom animations were bootanimation.zip, but now they are sanim.zip you can leave it that way, or for the users sake you can crack open the [whateveryounamedyour].sh and make a workaround.
add this line to [whateveryounamedyour].sh before you remount the partitions at the end.
Code:
busybox ln -s /system/media/bootanimation.zip /system/media/sanim.zip
basically what that does is create a symlink from the users bootanimation.zip to sanim.zip, so when the bootanimation binary looks for sanim.zip its redirected to bootanimation.zip.. so the user can put bootanimation.zip in the directory transparently without having to rename...
More to come, and I'm still taking request for additions to this how to....
awesome! thanks for the post... maybe I can start putting that programming class I had last semester to good use...
Joey
holy crap...I needed this about a month ago. thanks for putting it all in one place!! and jw....why do we need the mbcache.ko? ext4 worked fine without it, in a kernel I did.
sent from my uncyanogen modded epic 4g. with the key skips.
You know I don't even know what a plus kernel does but I use it for the old school android boot animation
Sent from my SPH-D700 using xda premium
ahh nice! cant wait for the others!
I really wanted this thank for the info!
Sent from my SPH-D700 using xda premium
Anyone ... what does the plus kernel do ?
Sent from my SPH-D700 using xda premium
Digglez said:
Anyone ... what does the plus kernel do ?
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
Its basically a stock kernel with mods.
Sent from my SPH-D700 using xda premium
Any mods besides the boot animation
Sent from my SPH-D700 using xda premium
Digglez said:
Any mods besides the boot animation
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
So far, adding ext4 modules is the only mod he's shown how to do. He'll be updating his thread with more mods soon.
Sent from my SPH-D700 using xda premium
Digglez said:
Any mods besides the boot animation
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
You can include boot animation...he just hasn't shown how to do it yet like ceelos said
Like I said in the first post, I will take request, within reason...
chris41g said:
Like I said in the first post, I will take request, within reason...
Click to expand...
Click to collapse
Any way you can show us how to bake mods into the kernel? Like say, superuser, so we make pre-rooted kernels
Sent from my SPH-D700 using xda premium
Ceelos09 said:
Any way you can show us how to bake mods into the kernel? Like say, superuser, so we make pre-rooted kernels
Sent from my SPH-D700 using xda premium
Click to expand...
Click to collapse
Updated just now with rooting, init.d support, and bootanimations..
Could you add how to do a cwm redirector? I've searched everywhere and can't find how.
that will be one of the upcoming topics..
chris41g said:
Updated just now with rooting, init.d support, and bootanimations..
Click to expand...
Click to collapse
Thanks Chris!
Sent from my SPH-D700 using xda premium
Hope your not doing this because you plan on leaving ! D;
But once again thanks for the info ill read it daily to make sure I understand it all!
Sent from my SPH-D700
I don't plan on going anywhere... but I also don't plan on being the only one repacking kernels forever either =]
chris41g said:
that will be one of the upcoming topics..
Click to expand...
Click to collapse
Awesome
chris41g said:
I don't plan on going anywhere... but I also don't plan on being the only one repacking kernels forever either =]
Click to expand...
Click to collapse
Hopefully soon we won't have to repack them, just recompile

[TWEAK] [ROOT] mDNIe screen sharpness tweak

If in file "sys/class/mdnie/scenario" in first byte replace 0 to 1 or 2 or 3 or 4 screen sharpness is increasing (1 more sharp.........4 less sharp.).
my taste
I have tryed 2 and 3. My taste is 3 perfect
is this safe
zeyadhan said:
is this safe
Click to expand...
Click to collapse
Absolutely. I like 3.
alexhc18 said:
Absolutely. I like 3.
Click to expand...
Click to collapse
yeah 3 is nice.But it resets to zero every time I change wallpaper.
any way to make it permanent .
alexhc18 said:
If in file "sys/class/mdnie/scenario" in first byte replace 0 to 1 or 2 or 3 or 4 screen sharpness is increasing (1 more sharp.........4 less sharp.).
Click to expand...
Click to collapse
For some reason, I can never get this to work. When I try to make the changes by navigating to sys/class/mdnie, there's another folder/shortcut that takes me to another minor folder. In there, I see the scenario file and quite a few others. It even has text and no single digit (like my note 2 did) further more, any changes I make to the scenario file never stick. Maybe the T-Mobile US version is different?
When I reboot will the value reset itself? And do I need reboot after changing the value? I'm confused hmm.
RE: OK I figured out the thing that I asked. (I had no time to try those when I asked.)
1) No need to reboot after editing.
2) After reboot you have to re-do it.
Sent from my SM-N900 using XDA Premium HD app
3 looks bad ass. Use root explorer. Its what I used and changed the value easily.
so 0 value is the most sharpness ?
right ?
Sent from my SM-N900 using XDA Premium 4 mobile app
Is there anyway to make it permanent? Rather than redoing anytime when power off or reset. .w
garykcliu said:
Is there anyway to make it permanent? Rather than redoing anytime when power off or reset. .w
Click to expand...
Click to collapse
Make init.d support on mobile and create file "00mdnie" in folder "etc/init.d" with this inside:
#!/system/bin/sh
echo 3 > /sys/class/mdnie/mdnie/scenario
busybox mount -o remount,rw -t auto /system;
busybox chmod -R 777 /system/etc/init.d;
busybox mount -o remount,ro -t auto /system;
Or type in "terminal emulator" : echo 3 > /sys/class/mdnie/mdnie/scenario
Apps camera and gallery resets this to default 0
alexhc18 said:
Make init.d support on mobile and create file "00mdnie" in folder "etc/init.d" with this inside:
#!/system/bin/sh
echo 3 > /sys/class/mdnie/mdnie/scenario
busybox mount -o remount,rw -t auto /system;
busybox chmod -R 777 /system/etc/init.d;
busybox mount -o remount,ro -t auto /system;
Or type in "terminal emulator" : echo 3 > /sys/class/mdnie/mdnie/scenario
Apps camera and gallery resets this to default 0
Click to expand...
Click to collapse
I just followed your guide but still cannot make it work as well.
Perhaps it is too technical for me but anyway thanks so much for your assistance.
By the way, is it possible to make a flashable zip so that we can flash on CWM?
Thank you
garykcliu said:
I just followed your guide but still cannot make it work as well.
Perhaps it is too technical for me but anyway thanks so much for your assistance.
By the way, is it possible to make a flashable zip so that we can flash on CWM?
Thank you
Click to expand...
Click to collapse
First you need busybox. Install this by Stericson: https://play.google.com/store/apps/details?id=stericson.busybox
reboot after installing. Open busybox, use "normal install" method to "system/bin", don't use "smart install".
Then CWM install this:
View attachment zip_init.zip by Ryuinferno
alexhc18 said:
Make init.d support on mobile and create file "00mdnie" in folder "etc/init.d" with this inside:
#!/system/bin/sh
echo 3 > /sys/class/mdnie/mdnie/scenario
busybox mount -o remount,rw -t auto /system;
busybox chmod -R 777 /system/etc/init.d;
busybox mount -o remount,ro -t auto /system;
Or type in "terminal emulator" : echo 3 > /sys/class/mdnie/mdnie/scenario
Apps camera and gallery resets this to default 0
Click to expand...
Click to collapse
#!/system/bin/sh
#Replace the number down here with what you want
VAL=`3`
#init.d commands (optional)
busybox mount -o remount,rw -t auto /system;
busybox chmod -R 777 /system/etc/init.d;
busybox mount -o remount,ro -t auto /system;
#auto check commands
while [ 1 ]
do
VAL1=`cat /sys/class/mdnie/mdnie/scenario`
if [ "$VAL1" != "$VAL" ]
then
echo "$VAL" > /sys/class/mdnie/mdnie/scenario
fi
sleep 1
done
iba21 said:
#!/system/bin/sh
#Replace the number down here with what you want
VAL=`3`
#init.d commands (optional)
busybox mount -o remount,rw -t auto /system;
busybox chmod -R 777 /system/etc/init.d;
busybox mount -o remount,ro -t auto /system;
#auto check commands
while [ 1 ]
do
VAL1=`cat /sys/class/mdnie/mdnie/scenario`
if [ "$VAL1" != "$VAL" ]
then
echo "$VAL" > /sys/class/mdnie/mdnie/scenario
fi
sleep 1
done
Click to expand...
Click to collapse
Unfortunately no matter how hard I tried, I still cannot get it worked.
I have no other alternative but to give up.
Anyway thanks so much for your advice.
You need a rom witch has the init.d script.. or busybox and create the init.d folder + putting the correct permissions
And sure.. you have to create a script witch contains that code
iba21 said:
You need a rom witch has the init.d script.. or busybox and create the init.d folder + putting the correct permissions
And sure.. you have to create a script witch contains that code
Click to expand...
Click to collapse
This is what I have done...I have enabled the init.d support and then go into the etc/init.d folder to create a file '00mdnie' without extension which contains the codes:
------
#!/system/bin/sh
echo 3 > /sys/class/mdnie/mdnie/scenario
busybox mount -o remount,rw -t auto /system;
busybox chmod -R 777 /system/etc/init.d;
busybox mount -o remount,ro -t auto /system;
------
However every time when I shut down or reboot the N900 and then it will automatically reset to 0 and could you please advise when went wrong with the procedures that I am doing.
Thank you so much.
You have to put what i wrote.. all codes
tried that in CM11 4.4.2, manual setting scenario works but its uncomfortable to change it everytime it resets. pasting your code into init.d makes no difference... any ideas? i love sharpness tweaks but don't want to change kernel now so....
Script init.d
00mdnie
Code:
#!/system/bin/sh
# By @criskelo - CriskeloRoms
# Mod By @alexhc18
chmod 777 /sys/class/mdnie/mdnie/scenario
echo 1 > /sys/class/mdnie/mdnie/scenario
chmod 555 /sys/class/mdnie/mdnie/scenario
This prevents the gallery or camera changes the value to 0
:good:
Edit:
chmod 555 /sys/class/mdnie/mdnie/scenario
Read only and execution
Do not write
Edit:
ATTACHED FILES
All in one
Only install by CWM
ADD in your rom
screen sharpness 1
Support-Init.d

Entware (Optware replacement) for android

I want to introduce a new android project - Entware. It can be considered as an Optware replacement.
Entware (arm version for cortex-a9 or higher) was first done for routers
_cannot post url ((((
Later it was tested on NASes
_cannot post url ((((
It is based on another project Qnapware, that is based on Entware (mipsel version).
Today I've tested Entware.arm on android (routed RK3188 TV stick) and it works.
I'm rather new to android. So my instuctions given below may not always be correct. I was installing Entware.arm connecting to android host using SshDroid.
1. I need a writeble /opt folder. I've done the following
Code:
/system/bin/mount -o rw,remount /
mkdir /opt
/system/bin/mount -o ro,remount /
I have a ext2 formated external sd card (symlinks are needed). I have made a directory and mount binded it to opt
Code:
mkdir /mnt/external_sd/entware.arm
mount -o bind /mnt/external_sd/entware.arm /opt
I do not know why android does not have shell in /bin
So let's make one
Code:
/system/bin/mount -o rw,remount /
mkdir /bin
ln -s /system/bin/sh /bin/sh
/system/bin/mount -o ro,remount /
Now I'll need a local root profile with the content to execute global Entware profile:
Code:
[email protected]:/data/data/berserker.android.apps.sshdroid/home # pwd
/data/data/berserker.android.apps.sshdroid/home
[email protected]:/data/data/berserker.android.apps.sshdroid/home # cat .profile
#!/system/bin/sh
. /opt/etc/profile
The preparation is finished. Now let install Entware
Code:
wget h__p_//qnapware.zyxmon.org/binaries-armv7/installer/entware_install_arm.sh
chmod +x ./entware_install_arm.sh
./entware_install_arm.sh
After the installation - logout and login again (to execute /opt/etc/profile) and install packages
Code:
opkg install mc
If something in my instructions does not fit android philosophy - please inform me.
Addition:
To make Entware changes permanent we needs startup script. Something like
Code:
#!/system/bin/sh
sleep 3
/system/bin/mount -o rw,remount /
sleep 1
/system/bin/chmod 777 /mnt/external_sd
/system/bin/mkdir /opt
/system/bin/mkdir /bin
ln -s /system/bin/sh /bin/sh
/system/bin/mount -o ro,remount /
sleep 3
/system/bin/mount -t ext2 -o rw /dev/block/mmcblk0p1 /mnt/external_sd
/system/bin/mount -o bind /mnt/external_sd/entware.arm /opt
sleep 2
/opt/etc/init.d/rc.unslung start
This script creates /bin /opt folders creates symlink /bin/sh, binds /opt to Entware folder location and starts Entware services.
zyxmon said:
I want to introduce a new android project - Entware. It can be considered as an Optware replacement.
Entware (arm version for cortex-a9 or higher) was first done for routers
_cannot post url ((((
Later it was tested on NASes
_cannot post url ((((
It is based on another project Qnapware, that is based on Entware (mipsel version).
Today I've tested Entware.arm on android (routed RK3188 TV stick) and it works.
I'm rather new to android. So my instuctions given below may not always be correct. I was installing Entware.arm connecting to android host using SshDroid.
1. I need a writeble /opt folder. I've done the following
Code:
/system/bin/mount -o rw,remount /
mkdir /opt
/system/bin/mount -o ro,remount /
I have and ext2 formated external sd card (symlinks are needed). I have made a directory and moun binded it to opt
Code:
mkdir /mnt/external_sd/entware.arm
mount -o bind /mnt/external_sd/entware.arm /opt
I do not know why android does not have shell in /bin
So let's make one
Code:
/system/bin/mount -o rw,remount /
mkdir /bin
ln -s /system/bin/sh /bin/sh
/system/bin/mount -o ro,remount /
Now I'll need a local root profile with the content to execute gloabal Entware profile:
Code:
[email protected]:/data/data/berserker.android.apps.sshdroid/home # pwd
/data/data/berserker.android.apps.sshdroid/home
[email protected]:/data/data/berserker.android.apps.sshdroid/home # cat .profile
#!/system/bin/sh
. /opt/etc/profile
The preparation is finished. Now install Entware
Code:
wget h__p_//qnapware.zyxmon.org/binaries-armv7/installer/entware_install_arm.sh
chmod +x ./entware_install_arm.sh
./entware_install_arm.sh
After the installation - logout and login again (to execute /opt/etc/profile) and install packages
Code:
opkg install mc
If something in my instructions does not fit android philosophy - please inform me.
Addition:
To make Entware changes permanent on needs sturtup script. Something like
Code:
#!/system/bin/sh
sleep 3
/system/bin/mount -o rw,remount /
sleep 1
/system/bin/chmod 777 /mnt/external_sd
/system/bin/mkdir /opt
/system/bin/mkdir /bin
ln -s /system/bin/sh /bin/sh
/system/bin/mount -o ro,remount /
sleep 3
/system/bin/mount -t ext2 -o rw /dev/block/mmcblk0p1 /mnt/external_sd
/system/bin/mount -o bind /mnt/external_sd/entware.arm /opt
sleep 2
/opt/etc/init.d/rc.unslung start
This script creates /bin /opt folders creates symlink /bin/sh, binds /opt to Entware folder location and starts Entware services.
Click to expand...
Click to collapse
Interesting.
Is this for smart phones???
GokulNC said:
Interesting.
Is this for smart phones???
Click to expand...
Click to collapse
Entware will work on armv7l/cortex-a9 or compatible CPU. It does not matter, weather it is smart phone, tablet, router or NAS.
Working well on this end, except for the fact that it has no concept of Android users and groups. For example, ls -l from busybox returns things like user "1000" group "1000", and bash with a PS1 including \u returns "I have no name!". Thoughts?

Lollipop 5.1.1 won't use the bind mounted folders

Can anyone please explain what the <censorship> Lollipop is doing with the mount points? I made this simple test script to move the dalvik-cache folder into the "sd-ext", a secondary partition in the SD card in ext4 format:
Code:
#!/system/bin/sh
#
# Stop Android from booting
#
stop
#
#
SDEXT=/dev/block/mmcblk1p2
if [ ! -e /data/dalvik-cache ]; then
mkdir /data/dalvik-cache
chmod 771 /data/dalvik-cache
chown 0.0 /data/dalvik-cache
fi
mount -o rw,remount / && mkdir /sd-ext
mount -w -t ext4 $SDEXT /sd-ext && chmod 775 /sd-ext
mkdir /sd-ext/dalvik-cache
chmod 771 /sd-ext/dalvik-cache && chown 0.0 /sd-ext/dalvik-cache
busybox mount /sd-ext/dalvik-cache /data/dalvik-cache
mount -o ro,remount /
#
# Finished. restart Android
#
start
The problem here is that no matter if /data/dalvik-cache is mounted in /sd-ext/dalvik-cache (and it is) Android/zygote or whoever is in charge still manages to put the dalvik caches in the original /data/dalvik-cache folder. I added the stop/start commands to stop the zygote and its relatives from running. The script is started from /system/su.d as from SuperSU documentation. Which means at the moment the su daemon starts.
I mean this is a much simpler test version of a script I made for GB and worked through KK (with no need to ad the stop/start commands either). What's going on? What am I missing?
Miche1asso said:
Can anyone please explain what the <censorship> Lollipop is doing with the mount points? I made this simple test script to move the dalvik-cache folder into the "sd-ext", a secondary partition in the SD card in ext4 format:
Code:
#!/system/bin/sh
#
# Stop Android from booting
#
stop
#
#
SDEXT=/dev/block/mmcblk1p2
if [ ! -e /data/dalvik-cache ]; then
mkdir /data/dalvik-cache
chmod 771 /data/dalvik-cache
chown 0.0 /data/dalvik-cache
fi
mount -o rw,remount / && mkdir /sd-ext
mount -w -t ext4 $SDEXT /sd-ext && chmod 775 /sd-ext
mkdir /sd-ext/dalvik-cache
chmod 771 /sd-ext/dalvik-cache && chown 0.0 /sd-ext/dalvik-cache
busybox mount [color=red]--bind[/color] /sd-ext/dalvik-cache /data/dalvik-cache
mount -o ro,remount /
#
# Finished. restart Android
#
start
The problem here is that no matter if /data/dalvik-cache is mounted in /sd-ext/dalvik-cache (and it is) Android/zygote or whoever is in charge still manages to put the dalvik caches in the original /data/dalvik-cache folder. I added the stop/start commands to stop the zygote and its relatives from running. The script is started from /system/su.d as from SuperSU documentation. Which means at the moment the su daemon starts.
I mean this is a much simpler test version of a script I made for GB and worked through KK (with no need to ad the stop/start commands either). What's going on? What am I missing?
Click to expand...
Click to collapse
--bind missing?
Have you tried instead modifying boot.img to run it directly? --- add in a busybox and replace the dalvik creation with a redirect to a .sh...
HypoTurtle said:
--bind missing?
Have you tried instead modifying boot.img to run it directly? --- add in a busybox and replace the dalvik creation with a redirect to a .sh...
Click to expand...
Click to collapse
Well, I used "busymox mount" because it automatically detects that being two directories they get mounted as a bind. Or so i supposed. Still i doubled checked, now. Same thing.
Not sure what you mean about redirecting to a .sh. Anyway, I also tried (the old) mounts2sd for testing. Same thing. it's like if something in Android gets hold of /data and its subdirectory and mounting over it doesn't matter. This with zygote dead. It's driving me mad.
Well, I believe it is related to selinux and the mount namespaces. I disabled the option in SuperSU to have individual name spaces and something different did happen: the whole ART crashed, rebooting the phone (not just Android, I think even the kernel restarts).
As they usually say.. let's forget about it. Link2SD doesn't help much either, since it must keep the system dalvik caches (more than 500GB) in the internal memory.

Categories

Resources