GingerMod Apps2SD Beta 1.0a for All ROMs!
This script is a part of GingerMod 2.1a (Galaxy Mini) (Soon)
NOTE:
I DON'T TAKE ANY RESPONSIBILITY IF YOU GET BOOTLOOPS YOUR SYSTEM/ROM/PHONE
Make a Backup first!
Click to expand...
Click to collapse
Prerequisite :
- Superuser
- busybox
- init.d run-parts
Features
move /data/app | /data/app-private | /data/dalvik-cache | /data/data | /cache to /sd-ext
set sdcard read ahead to : 2048 kb
how it work??
move /data/app | /data/app-private | /data/dalvik-cache | /data/data | /cache to /sd-ext
create symlinks of /data/app | /data/app-private | /data/dalvik-cache | /data/data | /cache to (/sd-ext)
for first boot (after installation)
move all apk's from /data/app to /sd-ext/app
remove /data/app folder
create symlink from /data/app to /sd-ext/app
mount /cache to /sd-ext/download
how to install??
open terminal
su
gmod install
All Commands
- gmod install
Install GingerMod Apps2SD if not Installed
- gmod uninstall
remove all GingerMod Apps2SD files & move back all data on /sd-ext to /data
- gmod all2sd
move /data/(app + app-private + dalvik-cache + data + cache) to /sd-ext
- gmod app2sd
move /data/app & /data/app-private to /sd-ext
- gmod cache2sd
move /data/dalvik-cache to /sd-ext/dalvik-cache
- gmod data2sd
move /data/data to /sd-ext/data
- gmod dl2sd
move /cache to /sd-ext/download
- gmod noall
move /sd-ext/(app + app-private + dalvik-cache + data + cache) to /data
- gmod noapp
move /sd-ext/app & /sd-ext/app-private to /data
- gmod nocache
move /sd-ext/dalvik-cache to /data/dalvik-cache
- gmod nodata
move /sd-ext/data to /data/data
- gmod nodl
move /sd-ext/download to /cache
Click to expand...
Click to collapse
Screenshot:
{
"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"
}
Download Link:
GingerMod Apps2SD Beta 1.0a
http://www.mediafire.com/?fpsdg3u5kq895mg
Changelog:
http://forum.xda-developers.com/showpost.php?p=24863010&postcount=2
Sorry for my bad English
Thanks for this interesting mod.
Could you explain what's advantage off your tool compare with traditional scripts?
Related
For experienced users only.
As the thread title suggests, this is a guide to backup, protect and restore root (su) as is sometimes needed after a system upgrade, broken Superuser update, etc...
Yes, there is an app for this, but if your like me, and enjoy full control over your system and don't mind working from the terminal, than this guide is for you.
What's involved:
We will be using two Linux commands orignially for the Linux second extended file system (ext2) but also works on ext3 and ext4.
- chattr (change file attributes)
- lsattr (list file attributes)
What's needed:
1. Terminal Emulator - there is an excellent one by Jack Palevich HERE
2. BusyBox compiled with the aforementioned utils/applets - an excellent pre-built binary by Linus Yang can be found HERE
-- I've also created a flashable zip for Linus Yang's BusyBox HERE
3. Extended file system as previously mentioned
A picture is worth a 1000 words:
Let's start with that and then review below
{
"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"
}
su ~ we need root access rights to make changes to the system
mount -o remount ~ we remount the system rw (read/write) to make the changes
cp -p ~ we copy/backup the su binary preserving (-p) the current file attributes/permissions, i.e. [rwsr-sr-x root root]
lsattr ~ list attributes; shows the files immutable bit is unset (not protected)
chattr +i ~ the +i is to set the immutable bit on the file
lsattr ~ list attributes; shows the files immutable bit is now set (protected)
chattr -i ~ the -i is to unset the immutable bit on the file
lsattr ~ list attributes; again, shows the files immutable bit is unset (not protected)
mount -o remount,ro ~ we remount the system read-only when finished making changes (always - don't forget)
Now what:
To restore root (su), i.e. after a system upgrade, we call the (su)protected /system/su-bak from terminal and use it to restore root access rights to /system/bin/su
Code:
/system/su-bak
mount -o remount,rw /system
chown 0.0 /system/bin/su
chmod 06755 /system/bin/su
mount -o remount,ro /system
Notes:
-In all my examples above, my su binary is in the /system/bin folder, however yours may very well be in the /system/xbin folder, so handle accordingly
-As long as the upgrade (OTA) is an in-place file system update then this should work, it is essentially the same process as the OTA RootKeepers
Sources and info:
chattr:
http://en.wikipedia.org/wiki/Chattr
http://linuxcommand.org/man_pages/chattr1.html
lsattr:
http://en.wikipedia.org/wiki/Lsattr
http://linuxcommand.org/man_pages/lsattr1.html
-JR-
Device: Teclast P78HD tablet, Allwinner A31 SoC, Android 4.4.2 (rooted) :::: Software: Busybox X (with fdisk, vi, etc.)
The Teclast P78HD tablet has a small 8GB internal eMMC SDcard with an external microSD slot. In order to best make use of the Link2SD utility, I chose to split in half the almost empty 4.7GB (usable) internal SD FAT32 partition and then format the new (primary) second partition to EXT2 EXT3 or EXT4 as used by the Link2SD app.
I used Busybox X to fdisk /dev/block/mmcblk0 ( /mnt/sdcard )
{
"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"
}
After rebooting, the DiskInfo app showed P1 ( mmcblk0p1 ) partition had shrunk to 2.4GB and, as expected, a new (unmounted) 2.3GB P4 ( mmblk0p4 , type 83, Linux ) was there too.
Connecting to a PC vis USB, I tried to format P4 to ext4 using MiniTool Partitioner (Windows) but it did not see the new partition, I then tried Gparted under Linux but it indicated that neither P1 or P4 existed. Gparted just showed a large 4.7GB "unallocated" block.
[ QUESTIONS ]
1. How do I format the new P4 mmblk0p4 partition to EXT4 using Busybox X on the tablet itself ?
2. Should I use some sort of fsck command to fix any side effects of simply truncating the original P1 mmblk0p1 FAT32 partition ?
3. What entry should I add to the tablet's /fstab.sun6i file shown below to make it automount at boot time ?
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/by-name/system /system ext4 ro wait
/dev/block/by-name/cache /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,barrier=1 wait,check
/dev/block/by-name/databk /databk ext4 noatime,nosuid,nodev,nomblk_io_submit,barrier=1 wait,check
/dev/block/by-name/data /data ext4 noatime,nosuid,nodev,nomblk_io_submit,barrier=1,noauto_da_alloc wait,check,encryptable=/dev/block/by-name/databk
/devices/virtual/block/nandj /mnt/sdcard vfat rw,relatime,fmask=0000,dmask=0000 wait,check,noemulatedsd,voldmanaged=sdcard:auto
/devices/platform/sunxi-mmc.2/mmc_host /mnt/sdcard vfat rw,relatime,fmask=0000,dmask=0000 wait,check,noemulatedsd,voldmanaged=sdcard:auto
/devices/platform/sunxi-mmc.0/mmc_host /mnt/extsd vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=extsd:auto
/devices/platform/sunxi-mmc.1/mmc_host /mnt/extsd vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=extsd:auto
/devices/platform/sw-ehci.1 /mnt/usbhost1 vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=usbhost1:auto
/devices/platform/sw_hcd_host0 /mnt/usbhost1 vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=usbhost1:auto
/devices/platform/sw-ohci.1 /mnt/usbhost1 vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=usbhost1:auto
BTW, despite the tablet's fstab entries, there is no /devices/platform directory but there is a /sys/devices/platform directory. Also note that sdcard0 and sdcard1 seem to point to the same place with the same files. I assume that my new partition should point to /storage/sdcard2
Did you ever figure it out? Thinking about splitting my internal storage and looking up for all the info I can find....
We need:
-debian chroot tarball or raspberry pi image (Download debian arm64 tarball)
-Magisk
-busybox (Magisk module avaible)
-GNU/Linux(for adb shell)
-Android terminal emulator (Download))
1- download tarball or image on computer
{
"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"
}
2-push file to /sdcard/ directory
3-Open android shell. Move file to /data/ and unpack file
4- Move rootfs to /data/linux
5- now go phone and run mount.sh in terminal (AOSP terminal has issue so We need another terminal)
6- If phone doesn't have busybox You must use busybox magisk module or any busybox installer.
7-after that reboot phone and run mount.sh in terminal
8-run chroot.sh in terminal and check update
9- done
Notes:
-if you want to install gui, You can install vnc server and connect in android vnc viewers.
-You can only install arm64/arm architecture rootfs.
-if you access system directory in rootfs, You can create /data/linux/system/
-if apt doesnt have internet access, edit /data/linux/etc/passwd file and replace _apt users UID to 0
-If you have any questions, You tell me
Mount.sh
Code:
#!/bin/sh
busybox mount --bind /dev dev
busybox mount --bind /sys sys
busybox mount --bind /proc proc
busybox mount --bind /data/cache tmp
busybox mount --bind /dev/pts dev/pts
busybox mount --bind /system system #optional
busybox mount --bind /sdcard root
Chroot.sh
Code:
#!/bin/sh
export TERM=linux
export TMPDIR=/tmp
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
export USER=root
export HOME=/root
/system/bin/chroot . /bin/bash
Is chroot support present in stock kernel?
kvsjxd said:
Is chroot support present in stock kernel?
Click to expand...
Click to collapse
Yes. Just root needed.
An alternative method to do a ubuntu/debian chroot would be to install Termux and just follow the instructions on the termux-ubuntu repository on Github.
Basically you download a script and it installs everything for you.
The readme file of the repo follows:
A script to install Ubuntu chroot in Termux
You need to install wget and proot in Termux before using this script.
Code:
pkg install wget proot
The script will make its files in the current directory. So if you want your Ubuntu-filesystem at a particular location switch to that folder first and then call the script with it's relative path. Example:
Code:
mkdir -p ~/jails/ubuntu
cd ~/jails/ubuntu
wget https://raw.githubusercontent.com/Neo-Oli/termux-ubuntu/master/ubuntu.sh
bash ubuntu.sh
After running it you can run "start-ubuntu.sh" to switch into your ubuntu
Click to expand...
Click to collapse
{
"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"
}
You have Trouble with unistalling Facebook?
Try my Script
NFO:
Code:
• Helpful for [B][URL="https://forum.xda-developers.com/android/apps-games/bullshified-version-facebook-okay-to-t3586318"]Facebook LC[/URL][/B] Installation
• Deletes Facebook, Facebook Installer & Facebook Manager,
after this its clearing the Cache & Dalvik-Cache automatically
Usage:
Flash it via TWRP, done
Download:
AFH
Note:
App Updates need a manually uninstall via Google Play Store, App Drawer or whatever
Wonder if it will work on Samsung? I'll test it later. Saved the topic for future! Thanks for this [emoji106]
Edit: no it doesn't work on Note 8 (SM-N950F) 8.0.0.
The names on Samsung data/app partition have names generated on instalation:
https://imgur.com/gallery/pg3MEVw
joluke said:
Wonder if it will work on Samsung? I'll test it later. Saved the topic for future! Thanks for this [emoji106]
Edit: no it doesn't work on Note 8 (SM-N950F) 8.0.0.
The names on Samsung data/app partition have names generated on instalation:
https://imgur.com/gallery/pg3MEVw
Click to expand...
Click to collapse
New Version with more Lines
You could try
Reports are very welcome
K3V1991 said:
Reports are very welcome
Click to expand...
Click to collapse
Here is shell script equalent to your edify one...
Code:
#!/sbin/sh
FD=$2
ui_print() {
echo -e "ui_print $1\nui_print" > /proc/self/fd/$FD;
}
is_mounted() { test "$(mount | grep " $1 " | grep "rw,")"; return $?; }
abort() { ui_print "$1"; exit 1; }
ui_print "############################################"
ui_print " "
ui_print "Facebook Uninstaller Script"
ui_print " "
ui_print "Mounting partitions: /system /data /cache"
is_mounted /data || mount /data || abort "Unable to mount /data"
is_mounted /system || mount /system || abort "Unable to mount /system"
is_mounted /cache || mount /cache || abort "Unable to mount /cache"
ui_print "Partitions mounted"
ui_print " "
ui_print "Removing FB, FB Installer & FB Manager"
files="
/system/app/Facebook_AppManager
/system/priv-app/Facebook_Installer
/data/app/com.facebook.katana
/data/app/com.facebook.orca
/data/app/com.facebook.android
/data/app/com.example.facebook
/system/priv-app/FBInstaller_NS
/system/app/FBAppManager_NS
/system/app/Facebook_stub
/system/app/FBAppManager
/system/priv-app/FBInstaller
/system/priv-app/FBServices
/system/priv-app/SNS_v2_N
"
for i in $files; do
rm -rf "$i"
done
ui_print "Done!"
ui_print " "
ui_print "Cleaning Cache and Dalvik-cache"
rm -rf /cache/*
rm -rf /data/dalvik-cache/*
ui_print "Unmounting partitions: /system /data /cache"
umount /system
ui_print " "
ui_print "############################################"
Just make a empty text file update-binary and fill the above script in it....
To make all archs compatible...
Hey, i'm trying to root crosscall core m5 but to no avail. Any help ?
What have you tried so far to root phone's Android 11?
jwoegerbauer said:
What have you tried so far to root phone's Android 11?
Click to expand...
Click to collapse
I have tried rooting Xiaomi Redmi 9 with success and flashed lineage os, the only thing is that the android 11 version doesn't allow read write permission to some config file i was trying to modify.
I'm now working with crossCall Core-M5 phones but i couldn't find the boot image that i need to get root access with magisk method.
I noted that Android 11 locked read only permission on / partition, tried many methods to get read write permission on files but no success.
To get RW access to folders / files you've to mount the partitions where these folders / files are located as RW.
jwoegerbauer said:
To get RW access to folders / files you've to mount the partitions where these folders / files are located as RW.
Click to expand...
Click to collapse
Yeah i did that but same error of read only
Bash:
lancelot:/ # mount -o remount,rw /dev/block/dm-1 /vendor
'/dev/block/dm-1' is read-only
Bash:
lancelot:/ # mount -o remount,rw /dev/block/dm-0 /
'/dev/block/dm-0' is read-only
these are the partitions identifiers
Bash:
adb remount
failed to remount partition dev:/dev/block/dm-0 mnt:/: Permission denied
failed to remount partition dev:/dev/block/dm-1 mnt:/vendor: Permission denied
failed to remount partition dev:/dev/block/dm-2 mnt:/product: Permission denied
remount failed
Re-mounting a partition as RW only can be applied by superuser ( AKA ROOT).
Example:
Code:
adb shell "su -c 'mount -o rw,remount <BLOCK> <MOUNTPOINT>'"
jwoegerbauer said:
Re-mounting a partition as RW only can be applied by superuser ( AKA ROOT).
Example:
Code:
adb shell "su -c 'mount -o rw,remount <BLOCK> <MOUNTPOINT>'"
Click to expand...
Click to collapse
Yes i'm root when i executed the previous commands
Bash:
su -c mount -o rw,remount -force /dev/block/dm-1 /vendor
but when i try to verify nothing happened still no write permission
{
"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"
}
The complete command passed to su must be enquoted as I've shown it above.
Device must get re-booted so change take effect.