[Guide][Video] - Android General

How To Create a Swap Partition for Android
http://www.youtube.com/watch?v=OWAbpWWwJ9Y

Commands: fdisk -l dev/block/mmcblk_
swapon /dev/block/mmcblk_p_
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
vi /system/etc/init.d/05userinit
#Activate swap at boot
#!/system/bin/sh
swapon -a
chmod 750 /system/etc/init.d/05userinit
vi /system/etc/fstab
/dev/block/mmcblk_p_ swap swap
echo vm.swappiness=60 >> /system/etc/sysctl.conf

Related

Nandroid code

Could someone post how to push hard spl through adb or send a link. I cannot flash through recovery (E:No signature).
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# cd /system
cd /system
# cat /data/local/recovery.img > recovery.img
I tried this: but couldn't proceed after the # cat line above.
I need to restore a nandroid backup.

Backtrack issue HTC jetstream

Greetings.
Ive used following script , HTC jetsteam rooted unlocked bootloader.
Code:
if [ "$perm" != "0" ];then echo "This Script Needs Root! Type : su";exit;fi
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/bt
export bin=/system/bin
export mnt=/data/local/mnt
mkdir -p $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/loop2 ]; then
echo "Loop device exists"
else
busybox mknod /dev/loop2 b 7 0
fi
mount -o loop,noatime -t ext2 $kit/bt5.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "127.0.0.1 localhost bt5" > $mnt/etc/hosts
busybox chroot $mnt /bin/bash
echo "Shutting down BackTrack ARM For Xoom"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
but keep getting error message .
can't execute /bin/bash no such file or directory.
Hope to hear from you guys.
Regards
Net_Spy
May be u might not have busybox installed after rooting ur phone
Hit thanks rather than typing it
Well I do have busybox installed in my device.
Regards
Net_Spy

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?

usage of preinstall_cleanup.sh

Hi!
I see that all the ROMs has the file /system/preinstall_cleanup.sh
What is the meaning of this file?, it delete a folder that not exist on the ROM
Code:
#!/system/bin/sh
log -t PackageManager "Start to clean up /system/preinstall_del/"
mount -o rw,remount -t ext4 /system
rm system/preinstall_del/*.*
mount -o ro,remount -t ext4 /system
Is some kind of legacy code?

Running cron under CM12 on Galaxy S5 /klte

Bounty: US$200
Running CM12.1 on klte (galaxy S5).
I can run a script in /system/etc/init.d directory, but some parts of it do not work:
E.g.
Code:
mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
Code:
mount -o remount,rw rootfs /
do not work when run from the script.
The same script executes perfectly fine when run from the shell.
Any help is highly appreciated.

Categories

Resources