Start service using an init.d script - Upgrading, Modifying and Unlocking

Hello all!
How can I turn some commands from init.rc and ueventd.rc files under boot.img into bash scripts put in init.d folder?
Reason: I have a device with TV, but most ROMs are made for its brother model without TV. Trying to port TV after installing any of these ROM, I've already found all libs, apk and framework files needed for it to work. But I still need to flash stock ROM kernel, which is not always the best choice or even possible depending on the ROM I'm using (e.g. AOSP based).
These are the commands contained in ueventd.rc:
Code:
#latin Mobile TV
/dev/isdbt 0660 system system
And these are the commands contained in init.d:
Code:
#++latin_mm:lkj for MobileTV [ISDBT]
mkdir /data/one-seg 0775 system system
chown system system /data/one-seg
chmod 0775 /data/one-seg
#--latin_mm:lkj for MobileTV [ISDBT]
#++latin_mm:lkj for MobileTV [ISDBT]
service mobileTV /system/bin/broadcastProcessObserver_ltn
class main
user system
group system audio camera graphics inet net_bt net_bt_admin net_raw sdcard_rw
service nexplayer /system/bin/nexprocess_ltn
class main
user system
group system audio camera graphics inet net_bt net_bt_admin net_raw sdcard_rw
#--latin_mm:lkj for MobileTV [ISDBT]

Up

Related

OPENVPN under android 2.2

HOW TO MAKE A OPENVPN CONNECTION
(you must use latest kernel - since 2010-08-18 it is integrated (tun module must be integrated in kernel mdules)
-> system/lib/modules/tun.ko)
kernel: htc-msm-linux-20100818_135751-package.tar or newer needed (because there the tun module is included)
1.) install of "openvpn" binary.
we do this manually
a) download openvpn.zip and copy the file: "openvpn" to directory "/sdcard/openvpn"
b) then set the execute writes via:
chmod +x /system/bin/openvpn
2.) some special settings - i do it via a start script -> /sdcard/conf/froyo.user.conf
(see there for the custom_shells part ...)
Code:
# custom shell commands, these commands run last
custom_shells{
#openvpn (ifconfig and route is needed)
mkdir /system/xbin/bb
ln -s /bin/busybox /system/xbin/ifconfig
ln -s /bin/busybox /system/xbin/bb/ifconfig
ln -s /system/bin/route /system/xbin/route
ln -s /system/bin/route /system/xbin/bb/route
#modprobe
modprobe tun
}
3.) copy your openvpn config files to directory /sdcard/openvpn
( my config file looks like: (for the client))
Code:
dev tap
dev-node /dev/tun
proto tcp-client
tls-client
#your server ip + port
remote 123.123.123.123 443
tls-auth /sdcard/openvpn/srv3.xxx.com_ta.key 1
ca /sdcard/openvpn/srv3.xxx.com_ca.crt
cert /sdcard/openvpn/srv3.xxx.com_rlt3.crt
key /sdcard/openvpn/srv3.xxx.com_rlt3.key
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
pull
redirect-gateway
comp-lzo
verb 3
status /sdcard/openvpn/srv3.xxx.com_rlt3_status.log
log-append /sdcard/openvpn/srv3.xxx.com_rlt3.log
only for your info (my server config)
Code:
port 443
dev tap0
proto tcp-server
mode server
tls-server
tls-auth /etc/openvpn/srv3.xxx.com_ta.key 0
ca /etc/openvpn/srv3.xxx.com_ca.crt
cert /etc/openvpn/srv3.xxx.com.crt
key /etc/openvpn/srv3.xxx.com.key
dh /etc/openvpn/srv3.xxx.com_dh1024.pem
crl-verify /etc/openvpn/srv3.xxx.com_crl.pem
client-config-dir client-config
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
keepalive 10 60
ping-timer-rem
persist-key
persist-tun
push "ping 10"
push "ping-restart 60"
push "ping-timer-rem"
mute 50
comp-lzo
status-version 2
status /var/log/openvpn/srv3.xxx.com_openvpn-status.log
log /var/log/openvpn/srv3.xxx.com_openvpn.log
verb 3
ifconfig 192.168.23.1 255.255.255.0
ifconfig-pool 192.168.23.2 192.168.23.9
push "route 192.168.23.0 255.255.255.0"
push "dhcp-option DNS 192.168.23.1"
push "dhcp-option DOMAIN vpn.xxx.com"
#Turn this on, if you want that all traffic goes over VPN
#push "route-gateway 192.168.23.1"
#push "redirect-gateway"
client-to-client
#using multiple cn's (no limited to single access via one cert files)
duplicate-cn
4.) install of "openvpn settings" from market place
then start app: "openvpn settings"
then configure there:
-> Load tun kernel adapter -> OFF
-> TUN modules settings: (not needed)
-> load module using -> modprobe (not needed)
-> path to tun module -> tun (not needed)
-> Path to configuration -> /sdcard/openvpn
-> Path to openvpn binary -> /sdcard/openvpn/openvpn
5.) Then you should see your config file and you can click it to start.
That's it
EDIT on 23.08.2010 + 30.08.2010
good article!
pride2 said:
good article!
Click to expand...
Click to collapse
maybe it should not iunder HTC HD, but anyhow ... if someone need it, he will find it -> search function is your friend
pride2 said:
good article!
Click to expand...
Click to collapse
Yeah it is a quite good article...
But there is one thing I don't understand... Or two...
Firstly... Why we have to link "route" and "ifconfig" twice?
Secondly... Why we have to link "/system/xbin/route" to "/system/xbin/route"?
In my opinion this will cause something like a loop which makes the command not executable... Could that be right?
Many regards
Crusoe86 said:
Yeah it is a quite good article...
But there is one thing I don't understand... Or two...
Firstly... Why we have to link "route" and "ifconfig" twice?
Secondly... Why we have to link "/system/xbin/route" to "/system/xbin/route"?
In my opinion this will cause something like a loop which makes the command not executable... Could that be right?
Many regards
Click to expand...
Click to collapse
the route is used by hardcoded path "/system/xbin/bb" from static "openvpn"
so, i was not sure if it is system/xbin or /system/xbin/bb, so i prefer to make both lnk's.
but addtional - i madea mistake, it is changed on first posting.
the mistakes are:
1.) openvpn-installer doesn't install conrrectly -> so, i did it manually
now.work
2.) ln was wrong: now the correct lnk's are:
ln -s /bin/busybox /system/xbin/ifconfig
ln -s /bin/busybox /system/xbin/bb/ifconfig
ln -s /system/bin/route /system/xbin/route
ln -s /system/bin/route /system/xbin/bb/route
cu camel
I have the leaked 2.2 stock Froyo on my Incredible.
I get this after it authenticates:
FATAL: Cannot allocate TUN/TAP dev dynamically
Any ideas? I'm guessing it doesn't have the tun driver.
PokerMunkee said:
I have the leaked 2.2 stock Froyo on my Incredible.
I get this after it authenticates:
FATAL: Cannot allocate TUN/TAP dev dynamically
Any ideas? I'm guessing it doesn't have the tun driver.
Click to expand...
Click to collapse
EDIT:
please check my first posting (updated ...)
also as i can see - often the problem is to install the openvpn as executable, and also to "modprobe tun".
therefoore you can also add to your /sdcard/conf/froyo.user.conf like me:
(see there for the custom_shells part ...)
# custom shell commands, these commands run last
custom_shells{
#openvpn (ifconfig and route is needed)
mkdir /system/xbin/bb
ln -s /bin/busybox /system/xbin/ifconfig
ln -s /bin/busybox /system/xbin/bb/ifconfig
ln -s /system/bin/route /system/xbin/route
ln -s /system/bin/route /system/xbin/bb/route
#modprobe
modprobe tun
#map the executable openvpn file to /system/xbin or bin
mount --bind /sdcard/openvpn/openvpn /system/xbin/openvpn
}
############
sure maybe some links are not needed - not sure what you have set ..
and of course - you can make it more cleaner as me ... but it is working fine enough for me.
cu camel

[Tweak] Boost RAM Management - get more free RAM! // [23.03.2011] Fixed Permissions.

Memory Tweak - get more free RAM to use for apps and less lag.
// This was first intended for other ROM chefs, so they can include this tweak in their ROMs. I'm aware that there are apps which can do this. But it's the idea to have it included automatically, so you don't have to annoy your users
However, this is also for normal users. Those just flash the CWM Package thunderteaser made here. Thanks for this.
I made a script which boosts the RAM Management significantly.
You can use this in any ROM - those values have been created from my mind and were being tested for several days in heavy use.
IMHO, it's the perfect combination of RAM Management.
HOW TO IMPLEMENT IT INTO YOUR ROM
Just make a new bash script and place the following code into it.
NOTE: bash files created on Windows don't work. Create them with a UNIX like Linux (Ubuntu, Fedora, whatever) or Mac OS X.
Place the script in /system/etc/init.d so it gets automatically executed at every startup. You have to make this because init.rc (in root dir /) gets executed first and will also set the RAM Management (minfree) on his own.
UPDATE - 20.03.2011
Supercurio said, there is support for init.d in his Voodoo injected kernel for JV1 Gingerbread.
This means, the script is fully working and the Gingerbread JV1 memory leaks are fixed when using those values.
This also means, my current ROM v10.0 Beta 3 already has the Memory Hack integrated.
Code:
#!/system/bin/sh
# DarkyROM 2011 - Joël Staub (darkyy)
# This will stabilize the memory leaks in Gingerbread and other ROMs.
# Adjusting Memory Settings
# The values in MB: 10, 16, 24, 68, 76, 92
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "Modifying minfree parameters"
echo "2560,4096,6144,17408,19456,23552" > /sys/module/lowmemorykiller/parameters/minfree
else
echo "minfree not found"
fi
Permissions
You may want to adjust the permissions of the script when it's on your phone.
You can do it with ADB.
First, connect to your phone.
Code:
adb shell
Get root access.
Code:
su
Set the permissions.
Code:
chmod 777 /system/etc/init.d/ramtweak
Code:
chown root:root /system/etc/init.d/ramtweak
When you're a ROM chef, you can include those permissions either with update(r)-script or with a bash file.
Thanks to zacharias.maladroit for the hint with the permissions.
- darkyy.
Darkyy said:
Ignore the # You're not allowed to use this script without giving proper credits. - EVERYONE IS WELCOME TO IMPLEMENT THIS INTO HIS / HER ROM - I don't need credits.
Click to expand...
Click to collapse
If you don't mean it, take it out
Ok this looks awesome but for the most part of the members can u make a proper tutorial ? I really don't understand how to implement your hack, how to create a bash script init.d ?
sorry for my noobiness
And when you say in every ROM, did you also mean every custom kernel ?
chambo622 said:
If you don't mean it, take it out
Click to expand...
Click to collapse
I will, sorry for this crap
I'm a bit too tired...
touness69 said:
Ok this looks awesome but for the most part of the members can u make a proper tutorial ? I really don't understand how to implement your hack, how to create a bash script init.d ?
sorry for my noobiness
And when you say in every ROM, did you also mean every custom kernel ?
Click to expand...
Click to collapse
You just make a new file on your COMPUTER.
Or it would even work on your SGS (but I'm writing now for the Computer).
Example:
Let's say, you're on Windows - create a NEW text file and remove the .txt extension (you need to have this option activated in the explorer settings).
You can leave it to no extension or just make it end on .sh
You got a file called randomname.sh now.
Now to make it easy, just copy this file to the C: drive in NO subfolder.
Now just ADB push this file to your SGS into:
Code:
adb push /randomname.sh /system/etc/init.d
Or just copy the .sh file to your SGS via USB Storage mount and copy it to the directory with Root Explorer or Super Manager.
Yes, this should work with every kernel (Android 2.2.1) here.
Thanks for doing this testing to find good settings. Forgive me if I'm misinformed, but is there anything particularly innovative about new minfree settings? I do appreciate your testing and finding ones that work well for you.
have a good rest, Darkyy !
thanks for this script
so you noticed improved interactivity with "apps and less lag" ?
gotta try this with CM7
FYI:
the defaults of the CM7 kernel are:
Code:
cat /sys/module/lowmemorykiller/parameters/minfree
2048,3072,4096,6144,7168,8192
edit2:
make sure that you get the right permissions for the file on the phone afterwards
say:
Code:
chmod 750 /system/etc/init.d/99rambooster
chown root:shell /system/etc/init.d/99rambooster
thanks for explanation ! I have done what you say and rebooted my phone after that. I renamed the file to init.d after placing it into the /system/etc/ directory and setted the défault permissions for this file rwxrwxrwx (or something like that)
But how I find if I have the hack succesfuly installed ?
chambo622 said:
Thanks for doing this testing to find good settings. Forgive me if I'm misinformed, but is there anything particularly innovative about new minfree settings? I do appreciate your testing and finding ones that work well for you.
Click to expand...
Click to collapse
Not innovative - this is nothing new.
It's just that many ROM devs aren't aware of this and I thought I could share my script.
zacharias.maladroit said:
have a good rest, Darkyy !
thanks for this script
so you noticed improved interactivity with "apps and less lag" ?
gotta try this with CM7
FYI:
the defaults of the CM7 kernel are:
Code:
cat /sys/module/lowmemorykiller/parameters/minfree
2048,3072,4096,6144,7168,8192
edit2:
make sure that you get the right permissions for the file on the phone afterwards
say:
Code:
chmod 750 /system/etc/init.d/99rambooster
chown root:shell /system/etc/init.d/99rambooster
Click to expand...
Click to collapse
Strange permissions...
This would be rwx r-x --- [Owner, Group, Other]
EDIT:
Ouch, CM7 really has 2048,3072,4096,6144,7168,8192?
That's really not the best value... looks close like JV1 RAM Management at first glance...
I'm gonna check that later.
Darkyy said:
Not innovative - this is nothing new.
It's just that many ROM devs aren't aware of this and I thought I could share my script.
Strange permissions...
This would be rwx r-x --- [Owner, Group, Other]
EDIT:
Ouch, CM7 really has 2048,3072,4096,6144,7168,8192?
That's really not the best value... looks close like JV1 RAM Management at first glance...
I'm gonna check that later.
Click to expand...
Click to collapse
yes,
and those are really the permissions
ls -l
-rwxr-x--- 1 root shell 365 Aug 1 2008 00banner
-rwxr-x--- 1 root shell 27 Aug 1 2008 01sysctl
-rwxr-x--- 1 root shell 229 Aug 1 2008 03firstboot
-rwxr-x--- 1 root shell 201 Aug 1 2008 04modules
-rwxr-x--- 1 root shell 1452 Aug 1 2008 05mountsd
-rwxr-x--- 1 root shell 272 Aug 1 2008 06mountdl
-rwxr-x--- 1 root shell 925 Aug 1 2008 20userinit
-rwxr-x--- 1 root shell 2533 Mar 19 02:20 89system_tweak
-rwxr-x--- 1 root shell 2848 Aug 1 2008 90screenstate_scaling
Click to expand...
Click to collapse
good thing you came up with these improved values,
I'm gonna include these in the next revision of my script / kernel
thanks again
Thanks Darkyy! Once again, you kicketh ass!
I am gonna give this a try.
Nice, some info on min free settings:
http://www.androidcentral.com/fine-tuning-minfree-settings-improving-androids-multi-tasking
while we're at it:
you could include lots of stuff from the
tweak script for the Galaxy Spica
in your next revision of ROM
I'm using some of those
and planning to continually add more after having tested them
DocRambone said:
Nice, some info on min free settings:
http://www.androidcentral.com/fine-tuning-minfree-settings-improving-androids-multi-tasking
Click to expand...
Click to collapse
Thanks Doc, will add it tomorrow in the OP.
zacharias.maladroit said:
while we're at it:
you could include lots of stuff from the
tweak script for the Galaxy Spica
in your next revision of ROM
I'm using some of those
and planning to continually add more after having tested them
Click to expand...
Click to collapse
Nice, but most things are specially for the low-end device Spica.
I'll sure look into it
Thank you
Gah this is such a retarded suggestion. Darky your SGS ROM is really nice and I'm currently running it, but please think about things like this before you post them.
The SGS has, comparatively, RAM out the wazoo. Why do we want more of it sitting idle and unused? RAM is there to be used, not sit there looking unused and pretty like a virgin at an eastern european slave auction in a free -m command. Twatting about with this setting on behalf of the Android Low Memory Killer is essentially like telling the ROM you have less RAM than you actually do since it will always endeavour to keep that much RAM -free- as in -unused- by the GUI itself as well as Android apps.
Darkyy said:
Memory Tweak - get more free RAM to use for apps and less lag.
I made a script which boosts the RAM Management significantly.
You can use this in any ROM - those values have been created from my mind and were being tested for several days in heavy use.
IMHO, it's the perfect combination of RAM Management.
HOW TO IMPLEMENT IT INTO YOUR ROM
Just make a new bash script and place the following code into it.
Place the script in /system/etc/init.d so it gets automatically executed at every startup. You have to make this because init.rc (in root dir /) gets executed first and will also set the RAM Management (minfree) on his own.
This doesn't work on JV1 now because we don't have the kernel sources to implement init.d support.
Code:
#!/system/bin/sh
# DarkyROM 2011 - Joël Staub (darkyy)
# This will stabilize the memory leaks in Gingerbread and other ROMs.
# Adjusting Memory Settings
# Old Hack (you can ignore this, it's just another method of doing it)
#if [ -e /sdcard/darky_tweak/init.rc ]; then
# echo "Copying init.rc to /"
# cp /sdcard/darky_tweak/init.rc /
# else
# echo "No init.rc found"
#fi
# New Method [15.03.2011]
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "Modifying minfree parameters"
echo "2560,4096,6144,17408,19456,23552" > /sys/module/lowmemorykiller/parameters/minfree
else
echo "minfree not found"
fi
- darkyy.
Click to expand...
Click to collapse
How to do it. any video to show us. ??
touness69 said:
thanks for explanation ! I have done what you say and rebooted my phone after that. I renamed the file to init.d after placing it into the /system/etc/ directory and setted the défault permissions for this file rwxrwxrwx (or something like that)
But how I find if I have the hack succesfuly installed ?
Click to expand...
Click to collapse
He said to place it inside init.d not call it init.d. Are you honestly this illiterate?
shaldi said:
How to do it. any video to show us. ??
Click to expand...
Click to collapse
How to create a text file and place it where he says to place it? Are you honestly this illiterate?
Darkyy said:
You just make a new file on your COMPUTER.
Or it would even work on your SGS (but I'm writing now for the Computer).
Example:
Let's say, you're on Windows - create a NEW text file and remove the .txt extension (you need to have this option activated in the explorer settings).
You can leave it to no extension or just make it end on .sh
You got a file called randomname.sh now.
Now to make it easy, just copy this file to the C: drive in NO subfolder.
Now just ADB push this file to your SGS into:
Code:
adb push /randomname.sh /system/etc/init.d
Or just copy the .sh file to your SGS via USB Storage mount and copy it to the directory with Root Explorer or Super Manager.
Yes, this should work with every kernel (Android 2.2.1) here.
Click to expand...
Click to collapse
Darkyy, so I just copy the codes, paste in notepad then save as [anygivenname.sh] then paste into system/ect/init.d using root explorer and reboot my galaxy s?
Darky is this included in your rom? if not is it going to be?
bernard134 said:
Darkyy, so I just copy the codes, paste in notepad then save as [anygivenname.sh] then paste into system/ect/init.d using root explorer and reboot my galaxy s?
Click to expand...
Click to collapse
guys
seriously: read what comes after the 1st ,2nd and 3rd post - or the first 1-3 (or 5 sites) if it's a larger topic
you'll see that you need to change the permissions & owner
you do that via logging in via adb, becoming root (su)
and navigating to /system/etc/init.d/
or do it explicitly from the folder where you are - like I posted
0) prepare file on windows / linux / mac
Code:
#!/system/bin/sh
# DarkyROM 2011 - Joël Staub (darkyy)
# This will stabilize the memory leaks in Gingerbread and other ROMs.
# Adjusting Memory Settings
# Old Hack (you can ignore this, it's just another method of doing it)
#if [ -e /sdcard/darky_tweak/init.rc ]; then
# echo "Copying init.rc to /"
# cp /sdcard/darky_tweak/init.rc /
# else
# echo "No init.rc found"
#fi
# New Method [15.03.2011]
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "Modifying minfree parameters"
echo "2560,4096,6144,17408,19456,23552" > /sys/module/lowmemorykiller/parameters/minfree
else
echo "minfree not found"
fi
e.g. save as:
99rambooster
1) dl & install Android SDK
http://www.talkandroid.com/android-sdk-install-guide/
2) connect phone
navigate to tools folder (or from Linux: launch from terminal via command)
3) put it on the phone
Code:
adb push 99rambooster /sdcard/
4) log in to phone & become root
Code:
adb shell
(now in phone)
Code:
su
5) copy it to init.d folder [you eventually need to remount /system rw]
Code:
cp /sdcard/99rambooster /system/etc/init.d/
6) adjust permissions:
Code:
chmod 750 /system/etc/init.d/99rambooster
chown root:shell /system/etc/init.d/99rambooster

Metasploit console on ADB without chroot, working!

Well I've been working on getting the Kali Linux toolkit to run on Android without a chroot and I did it, just gotta mount all the subfiletree's or whatever to where they belong in Androids root dir ,"/" (NOT "/root") and set up the paths in the enviroment a it seems to be working.
I spent way more time researching and planning out exactly how I was going to exicute this, it still has some kinks as some of the filesystems clash or have files of the same name but with slightly moified content, I guess I gotta dig through all those and patch em up so it all flows together, I just ran on the presumtion that it was all compiled for arm and I think it all runs on the android kernel when you chroot into an img file. I basically just mounted the kali.img file and instead of chrooting into that I went backwords and moved everything into Androids root.
Im working on a script with sanity checks and error collection and all that, I am still learning bash, linux, kernel, android, all like a summer cram session so please forgive me if I dont know or it takes time to share something I think is even slightly worthy for ya'll.
Anyways for those interested here is a bit of the tail end of what all this research has become, I think metasploit uses ruby, so if msf is working I guess that is too... here it is
Code:
localhost etc # ls
CHANGELOG-CM.txt gps.conf ppp
CHANGES.txt hosts recovery-resource.dat
NOTICE.html.gz init.d security
apns-conf.xml init.goldfish.sh snd_soc_msm
audio_effects.conf init.qcom.efs.sync.sh ssh
audio_policy.conf init.qcom.mdm_links.sh system_fonts.xml
bash init.qcom.modem_links.sh terminfo
bluetooth init.qcom.post_boot.sh thermald-8064.conf
boot_fixup init.qcom.thermal_conf.sh thermald-8930.conf
build-manifest.xml media_codecs.xml thermald-8960.conf
dbus.conf media_profiles.xml thermald.conf
dhcpcd mkshrc vold.fstab
event-log-tags nano wifi
fallback_fonts.xml nfcee_access.xml
firmware permissions
localhost / # mount --rbind $subset/etc /etc
localhost / # which apt-get
/usr/bin/apt-get
localhost / # which mfsconsole
localhost / # which msfconsole
/usr/bin/msfconsole
localhost / # msfconsole
IIIIII dTb.dTb _.---._
II 4' v 'B .'"".'/|\`.""'.
II 6. .P : .' / | \ `. :
II 'T;. .;P' '.' / | \ `.'
II 'T; ;P' `. / | \ .'
IIIIII 'YvP' `-.__|__.-'
I love shells --egypt
Easy phishing: Set up email templates, landing pages and listeners
in Metasploit Pro's wizard -- type 'go_pro' to launch it now.
=[ metasploit v4.7.0-2013071701 [core:4.7 api:1.0]
+ -- --=[ 1131 exploits - 638 auxiliary - 180 post
+ -- --=[ 309 payloads - 30 encoders - 8 nops
stty: standard input: Bad file number
msf > exit
localhost / # ls
acct init.trace.rc
bin init.usb.rc
cache initlogo.rle
charger lib
config lpm.rc
d media
data mnt
default.prop opt
dev persist
efs proc
etc res
extSdCard root
firmware run
fstab.qcom sbin
init sdcard
init.cm.rc srv
init.goldfish.rc storage
init.qcom.class_core.sh sys
init.qcom.class_main.sh system
init.qcom.early_boot.sh tmp
init.qcom.lpm_boot.sh tombstones
init.qcom.rc ueventd.goldfish.rc
init.qcom.sh ueventd.qcom.rc
init.qcom.syspart_fixup.sh ueventd.rc
init.qcom.usb.rc usbdisk0
init.qcom.usb.sh usr
init.rc var
init.recovery.qcom.rc vendor
init.target.rc
localhost / # exit
exit
[email protected]:/ #
EDIT: Please note that to get this working I had to "su -c bash" so that some of the mount commands would work properly, this is why is says "localhost / #" and not "[email protected]:/ #", its bash and thats the same interpreter the normal chroot throws you into. This is bash from Androids / directory.
My kind of thinker. I'll have to look into this!
Sent from my SPH-L710 using xda app-developers app
Haven't gotten time to try out your mod yet but thought I'd let you know I did get Kali Linux installed on my GS3 and metasploit runs relatively well ssh'ing through terminal!
Sent from my SPH-L710 using xda app-developers app

Lewa,Miui,Colour OS,Aosp and another roms porting tutorial MT6582 to MT6582

Lewa,Miui,Colour OS,Aosp and another roms porting tutorial MT6582 to MT6582
It is very Hard
Requirements :
*Windows XP/7/8
* 7-Zip
* Notepad++
* Java Jdk
* Cygwin
* Boot.img Unpack/Repack Tools or Android
kitchen
* Stock ROM
*Port RomRom
[N.B : There are two type roms
1. Stock rom [ orginal rom from your
mobile ]
2. Port rom [ Whichever you want to port
rom ]]
*SO NOW PORTING START
+ Replace it from your stock rom to the port
rom
[ FOLDER & FILE TO REPLACING ]
*system/etc/firmware
*system/etc/permission/platform.xml
*system/etc/permission/
handheld_core_hardware.xml
*system/lib/hw
*system/lib/modules
*system/lib/ libaudio.primary.default.so
*system/lib/ libcamdrv.so
*system/lib/libcamalgo.so
*system/lib/libcameracustom.so
*system/lib/libdpframework.so
*system/lib/ libsensorservice.so
*system/lib/libvcodecdrv.so
*system/lib/libsync.so
*system/usr/keylayout
[ FIXING PROBLEM ]
Sim card problem :
*system/bin
SD Card Problem :
*system/etc/vold.fstab
*system/etc/vold.fstab.nand
Camera Focus Problem :
*system/lib/libcameraservice.so
[NB:These step not required for Walton
Primo GF,GH,GH+ & GH2]
Boot loop problem :
*system/lib/libandroid_runtime.so
*system/lib/libandroid_servers.so
*system/lib/libmedia_jni.so
Other Problem :
*system/etc/dhcpcd
*system/etc/permissions
*system/etc/security
*system/etc/audio
*system/etc/bluetooth
*system/etc/wifi
*system/lib/drm
*system/lib/egl
*system/lib/soundfx
* Now open build.prop in notpad++ and change your language.
English user :
ro.product.locale.language=en
ro.product.locale.region=US
* Replace the stock boot.img to port rom
* Unpack Boot.img (Both) then open init.rc (Both) and find these line....
on early_property:ro.build.type=user
write /proc/bootprof "INIT: user build setting"
export BOOTCLASSPATH /system/framework/
core.jar:/system/framework/core-junit.jar:/
system/framework/bouncycastle.jar:/system/
framework/ext.jar:/system/framework/
framework.jar:/system/framework/telephony-
common.jar:/system/framework/mms-
common.jar:/system/framework/
android.policy.jar:/system/framework/
services.jar:/system/framework/apache-xml.jar:/
system/framework/mediatek-common.jar:/
system/framework/mediatek-framework.jar:/
system/framework/secondary-framework.jar:/
system/framework/CustomProperties.jar:/system/
framework/mediatek-telephony-common.jar:/
system/framework/mediatek-op.jar
on early_property:ro.build.type=userdebug
write /proc/bootprof "INIT: userdebug build
setting"
export BOOTCLASSPATH /system/framework/
core.jar:/system/framework/core-junit.jar:/
system/framework/bouncycastle.jar:/system/
framework/ext.jar:/system/framework/
framework.jar:/system/framework/telephony-
common.jar:/system/framework/mms-
common.jar:/system/framework/
android.policy.jar:/system/framework/
services.jar:/system/framework/apache-xml.jar:/
system/framework/mediatek-common.jar:/
system/framework/mediatek-framework.jar:/
system/framework/secondary-framework.jar:/
system/framework/CustomProperties.jar:/system/
framework/mediatek-telephony-common.jar:/
system/framework/mediatek-op.jar
on early_property:ro.build.type=eng
write /proc/bootprof "INIT: eng build setting"
export BOOTCLASSPATH /system/framework/
core.jar:/system/framework/core-junit.jar:/
system/framework/bouncycastle.jar:/system/
framework/ext.jar:/system/framework/
framework.jar:/system/framework/telephony-
common.jar:/system/framework/mms-
common.jar:/system/framework/
android.policy.jar:/system/framework/
services.jar:/system/framework/apache-xml.jar:/
system/framework/mediatek-common.jar:/
system/framework/mediatek-framework.jar:/
system/framework/secondary-framework.jar:/
system/framework/CustomProperties.jar:/system/
framework/mediatek-telephony-common.jar:/
system/framework/mediatek-op.jar:/system/
framework/emma.jar
** Now replacing these line Form port Boot.img to Stock Boot.img
* Then Repacke boot.img and built a new boot.img
[# Camera Drive problem fixing]
* Again Extract the boot.img for android kitchen
[ Both stock & port boot.img]
* and open init.rc/# camera
* Find these missing line port to stock
boot.img and whole missing line paste it
( #Camera )
Example :
#Camera
chmod 0660 /dev/camera-sysram
chmod 0660 /dev/camera-isp
chmod 0660 /dev/camera-pipemgr
chmod 0660 /dev/kd_camera_hw
chmod 0660 /dev/kd_camera_flashlight
chmod 0660 /dev/kd_camera_hw_bus2
chmod 0660 /dev/FM50AF
chmod 0660 /dev/OV8825AF
chmod 0660 /dev/OV88252AF
chmod 0660 /dev/OV8850AF
chmod 0660 /dev/CAM_CAL_DRV
chown system camera /dev/camera-sysram
chown system camera /dev/camera-isp
chown system camera /dev/camera-pipemgr
chown system camera /dev/kd_camera_hw
chown system camera /dev/
kd_camera_flashlight
chown system camera /dev/
kd_camera_hw_bus2
chown system camera /dev/FM50AF
chown system camera /dev/OV8825AF
chown system camera /dev/OV88252AF
chown system camera /dev/OV8850AF
chown system camera /dev/CAM_CAL_DRV
* Now repack boot.img
* Open the Port rom folder go to META-
INF/google/Android / and open updater-script
in Notpad++
And change these line.......
[mmcblkOp3 ----- mmcblkOp9]
[ Example for WALTON PRIMO GH2
[mmcblkOp6]]
* Now go to back the folder of port rom and
you will see two folder and one file name
+ META-INF
+ system
+ boot.img
* Now select these 2 folder 1 file and click
right mouse button and click on 7zip ->>
add to archive
* Now a dialouge box should
appear!
* Configure the Format like This:
Archive format: ZIP
Compression Level : Normal
Compression Method: Deflate
Dictoioany Size: 32k
Word Size 32
* Now Start Zipping and Push the
ZIP to your Memory Card
* Go to Recovery >> Install ZIP &
Wipe Data
Finished!!
_______________A.S.NOMAN KHAN
Continous bootloop
sir,i tried lewa os for Symphony H100 ,from Walton Primo R3 kitkat. i tried with stock boot image then patched boot image then patched boot image + 3 files you mentioned for bootloop ,every time there is bootloop. boot animation ends and starts again .please help......................
port any best rom for lava iris 405+
Sent from my iris405+ using xda app-developers app
Nice guide bro...
Sent from my Android One using XDA Free mobile app
Good bro
thanks

Where can I find the "sswap" utility?

Sorry if this is posted in the wrong forum. XDA's brain-damaged posting policy doesn't allow me to post in the development section.
Moderator Edit: Definitely in the wrong Forum, you're right. Should have been in Q and A... which it now is. This Post will help you understand the XDA stance on posting in Development
I've been scratching my head trying to figure out the location and purpose of a mysterious file introduced in recent Cyanogenmod builds for the Samsung Galaxy Tab S 8.4 (klimtwifi).
The file is sswap. The file is referenced in at least two files within the Cyanogenmod build directory, i.e.:
Code:
device/samsung/klimtwifi/proprietary-files.txt
device/samsung/klimtwifi/rootdir/etc/init.universal5420.rc
In proprietary-files.txt we see the following lines:
Code:
# Samsung SSWAP
root/sbin/sswap
Basically, proprietary-files.txt is the list of files that the extract-files.sh script uses to download the prebuilt binary-only vendor files (without source code) from a working Cyanogenmod installation. This appears to place the file within the /system directory. At least this is my understanding of how the extract-files.sh script works, i.e. it takes the relative paths found in proprietary-files.txt and appends the base path /system.
Code:
if [ "$SRC" = "adb" ]; then
adb pull /system/$FILE $BASE/$DEST
# if file dot not exist try destination
if [ "$?" != "0" ]
then
adb pull /system/$DEST $BASE/$DEST
fi
However the reference to sswap in init.universal5420.rc puts it in a different location:
Code:
service sswap /sbin/sswap -s
class core
user root
group root
oneshot
seclabel u:r:sswap:s0
I can only assume that sswap is hardlinked or softlinked to or from the /system directory. However, this kind of defeats the
purpose of /sbin being assigned root-only read permissions.
Finally, I've not been able to find any documentation with regard to sswap, particularly what its advantages or disadvantages are when compared to the standard Linux swapon/swapoff utility.
DisposableName said:
Sorry if this is posted in the wrong forum. XDA's brain-damaged posting policy doesn't allow me to post in the development section.
Moderator Edit: Definitely in the wrong Forum, you're right. Should have been in Q and A... which it now is. This Post will help you understand the XDA stance on posting in Development
I've been scratching my head trying to figure out the location and purpose of a mysterious file introduced in recent Cyanogenmod builds for the Samsung Galaxy Tab S 8.4 (klimtwifi).
The file is sswap. The file is referenced in at least two files within the Cyanogenmod build directory, i.e.:
Code:
device/samsung/klimtwifi/proprietary-files.txt
device/samsung/klimtwifi/rootdir/etc/init.universal5420.rc
In proprietary-files.txt we see the following lines:
Code:
# Samsung SSWAP
root/sbin/sswap
Basically, proprietary-files.txt is the list of files that the extract-files.sh script uses to download the prebuilt binary-only vendor files (without source code) from a working Cyanogenmod installation. This appears to place the file within the /system directory. At least this is my understanding of how the extract-files.sh script works, i.e. it takes the relative paths found in proprietary-files.txt and appends the base path /system.
Code:
if [ "$SRC" = "adb" ]; then
adb pull /system/$FILE $BASE/$DEST
# if file dot not exist try destination
if [ "$?" != "0" ]
then
adb pull /system/$DEST $BASE/$DEST
fi
However the reference to sswap in init.universal5420.rc puts it in a different location:
Code:
service sswap /sbin/sswap -s
class core
user root
group root
oneshot
seclabel u:r:sswap:s0
I can only assume that sswap is hardlinked or softlinked to or from the /system directory. However, this kind of defeats the
purpose of /sbin being assigned root-only read permissions.
Finally, I've not been able to find any documentation with regard to sswap, particularly what its advantages or disadvantages are when compared to the standard Linux swapon/swapoff utility.
Click to expand...
Click to collapse
When I put together the prop* there was no option to get files from the roms ramdisk (extract-files.sh assumes all needed files reside in /system/. sswap lives in /sbin/ and should be in /sbin for the source build rom, too. If you look here:
https://github.com/TheMuppets/propr...-common/exynos5420-common-vendor-blobs.mk#L25
...you'll see that sswap is copied to /root/sbin. In /root the android build environment assambles the ramdisk.
You can use mkswap on the swap partition and go ahead with swapon and swapoff. This will work. But since I havn't found any documentation of samsungs sswap partition format, I decided to use samsungs sswap instead of standard linux kernel swap interface: I have no idea hpw to "mkswap" for sswap. If you use mkswap and swapon be prepared to have a hard time to get back to sammy tw.

Categories

Resources