Hi,
I run CM 13 and want to encrypt my sd card. The internal storage is already encrypted. I do NOT want to use the sd card as "internal" or "adopted" because the sd is for data only and I want all the apps in the faster internal storage. I do not care if the sd is usable on other phones or not, I just want to completely encrypt it.
The security menu doesn't show a "encrypt sd card" option anymore as in previous versions.
So what is the best way to encrypt the sd card?
Is there some command like "vdc cryptfs" which handles sd cards?
Thanks.
Nobody got a solution for this?
I've been reading various Android crypto documentations, the vold source code etc. and haven't found a solution yet. Seems like this is not a feature readily available...
Ok, after some work I figured out a way to do it.
You need a rooted phone and an adb connection to it. I tried this with CM13, other versions or roms will probably differ slightly in the parameters, so you should have basic linux shell skills.
The first step is to get a cryptsetup binary compiled for the architecture of your phone. You can compile it yourself from sources like https://android.googlesource.com/platform/external/cryptsetup/+/master or https://github.com/nelenkov/cryptsetup.
But I was lazy and installed LUKS Manager from the Play store. It contains a version of cryptsetup compiled for ARM. Extract it like this:
Code:
adb root
adb shell
setenforce 0
cd /data/app/com.nemesis2.luksmanager-1
unzip base.apk
cp assets/lm.cryptsetup /data
chmod 755 /data/lm.cryptsetup
Now we have the cryptsetup binary lying in /data/lm.cryptsetup. You can now uninstall LUKS Manager again as we don't need it anymore.
Now is a good time to back up the contents of your sd card. Then insert it into the phone and format it as portable if you don't have done that yet.
The next step is to figure out the device node of your sd card. You don't easily see this when looking at the mounts as vold hides it from us. So go to /dev/block and look at the device nodes. You are looking for a mmc device that has just one partition (just one extra node with ...p1). Then open it with fdisk and look if the size matches your sd card. On my phone it was mmcblk1.
Now we split the sd into two partitions: one very small (like 10MB) fat32 partition and the rest as an encrypted partition with LUKS header. This is to trick vold into helping us making the encrypted partition visible to regular Android apps.
Run fdisk for the mmc device (not the one with ...p1, the one without) and delete the existing partition. Create two partitions as outlined above. Set the type of the small partition to "c" (fat32) and the type for the large one to "8e".
It should look like this:
Code:
# fdisk /dev/block/mmcblk1
The number of cylinders for this disk is set to 3902128.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems.
Command ('m' for help): p
Disk mmcblk1: 127.8 GB, 127864930304 bytes
4 heads, 16 sectors/track, 3902128 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
mmcblk1p1 33 352 10240 c Win95 FAT32 (LBA)
mmcblk1p2 353 3902128 124856832 8e Linux LVM
Now we format and set up the partitions. Replace "mmcblk1" with the device node on your device.
Code:
mkfs.vfat /dev/block/mmcblk1p1
/data/lm.cryptsetup -i 5000 -h sha256 luksFormat /dev/block/mmcblk1p2
/data/lm.cryptsetup luksOpen /dev/block/mmcblk1p2 sdcrypt
mkfs.ext2 /dev/mapper/sdcrypt
The mkfs.ext2 may take a while. I'm using ext4 here as it's usually faster for reads than f2fs. I use the sd mostly for long-term media storage, so reads are more important than writes.
When you are done reboot your phone.
When it is up again check your sd card storage. It should be a bit below the size you chose for the small fat32 partition, e.g. around 9 MB. If that worked, then vold has mounted the small partition and made it available to regular Android apps.
Connect with adb and check the volume id of the fat32 partition like this:
Code:
blkid /dev/block/mmcblk1p1
Mine is "5824-FB9F". You need to adapt the following commands and insert your volume id.
Now we open the crypto container and mount the partition over the mountpoint of the small fat32 partition. This way we reuse the work that vold has just done and switch out the partitions without it noticing.
These are the commands you need to issue on a root shell to do the mount:
Code:
echo "your_secret_password" | /data/lm.cryptsetup luksOpen /dev/block/mmcblk1p2 sdcrypt
mount /dev/mapper/sdcrypt /mnt/media_rw/5824-FB9F -t ext4 -o nosuid,nodev,noexec,noatime,nodiratime,context=u:object_r:vfat:s0
am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///storage/5824-FB9F
This needs to be done on after each reboot. I use tasker for this, but there are plenty of other methods. The script contains your password. So make sure that it is stored on the encrypted /data partition and not somewhere insecure.
On the first mount I had to fix the permissions like this:
Code:
chown -r media_rw:media_rw /mnt/media_rw/5824-FB9F
chmod 770 /mnt/media_rw/5824-FB9F
Have phun!
Just for your convenience, here is the tasker profile I use to automatically mount it on startup:
Code:
<TaskerData sr="" dvi="1" tv="4.8u5">
<Profile sr="prof6" ve="2">
<cdate>1478460038918</cdate>
<edate>1478460038919</edate>
<id>6</id>
<mid0>5</mid0>
<nme>Booted</nme>
<Event sr="con0" ve="2">
<code>411</code>
<pri>0</pri>
</Event>
</Profile>
<Task sr="task5">
<cdate>1478457711553</cdate>
<edate>1478460213089</edate>
<id>5</id>
<nme>Mount Sdcrypt</nme>
<Action sr="act0" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">echo "your_secret_password" | /data/lm.cryptsetup luksOpen /dev/block/mmcblk1p2 sdcrypt</Str>
<Int sr="arg1" val="20"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act1" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">mount /dev/mapper/sdcrypt /mnt/media_rw/5824-FB9F -t ext4 -o nosuid,nodev,noexec,noatime,nodiratime,context=u:object_r:vfat:s0</Str>
<Int sr="arg1" val="20"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act2" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///storage/5824-FB9F</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
</Task>
</TaskerData>
You just need to replace the password, the block device node name and the volume id of the fat32 filesystem.
After having used it for a few days, I encountered a few problems regarding the access rights to the sd card: new folders are created with the unix-ownership of the app doing the create. All other apps don't have access and I couldn't find anything like a global umask for all Android apps. Usually portable sd cards are formatted vfat, so there are no unix permissions at all.
I first thought about solutions like bindfs, which is an extra FUSE layer which can replace the permissions on access. But I was to lazy to set up a build environment. So I replaced the ext4 on the encrypted drive with exfat, which also does not have permissions.
Why exfat and not fat? Because I don't want the limit of 4GB per file.
To switch to exfat, format the encrypted drive like this:
Code:
mkfs.exfat /dev/mapper/sdcrypt
Mounting is done like this:
Code:
mount /dev/mapper/sdcrypt /mnt/media_rw/5824-FB9F -t exfat -o nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007
Just replace the commands in the steps above with these.
Kudos to robberknight for finding out how this works on Marshmellow!
After upgrading to lineage 14.1 (Android 7.1.2), the given approach did no longer work.
The sd card storage is now divided into multiple "views" by making use of mount namespaces.
This allows an user to grant or deny sd card permission at app runtime.
The corresponding git commit in "vold" is:
Code:
commit 66270a21df1058434e4d63691221f11ff5387a0f
Commit: Jeff Sharkey <[email protected]>
CommitDate: Thu Jun 25 22:40:08 2015 -0700
Let's reinvent storage, yet again!
..
After countless hours of tracing through vold, I developed a solution for lineage 14.1.
Main changes:
mount source exfat filesystem with correct selinux context
automatically unmount all user views and then call the "sdcard" binary to set up the user views again. "sdcard" is normally called by vold internally.
The updated mount script can either store the password or ask for the password upon mount.
Not storing the password might come in handy if you are forced to reveal any unlock codes:
If the encrypted volume is not mounted, the "original" SD card content from the first partition is mounted by Android.
Here's the updated script, please adjust path to cryptsetup binary / uuid of the sd card:
Code:
password=""
cardid="780AD-7FC9"
cardmnt="/mnt/media_rw/$cardid"
cryptsetup_bin="/data/cryptsetup.arm"
function die()
{
echo "$*"
exit 1
}
# ask user for password if not given
if [ "$password" = "" ]; then
echo -n "Enter password: "
read password
fi
echo "$password" | $cryptsetup_bin luksOpen /dev/block/mmcblk1p2 sdcrypt
password=""
test -b /dev/mapper/sdcrypt || die "luksOpen failed"
# unmount old sdcard (up to four mount points on lineage 14.1)
count=0
while grep -q -F "$cardid" /proc/mounts; do
# force unmount like the UI would
umount -f "/mnt/media_rw/$cardid"
count=$((count+1))
[ $count -eq 10 ] && die "sdcard $cardid still mounted? Please check."
done
echo "Unmounted $count old mount points"
# Mount base filesystem with correct selinux context
mount /dev/mapper/sdcrypt "$cardmnt" -t exfat -o context=u:object_r:fuseblk:s0,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007
# set up read/write views using "sdcard"
sdcard -u 1023 -g 1023 -U 0 "/mnt/media_rw/$cardid" "$cardid"
# tell MediaServer to search for new content
am broadcast -a android.intent.action.MEDIA_MOUNTED -d "file:///storage/$cardid"
Hopefully this is useful for someone else.
Big thanks to haggertk for bringing lineage 14.x to the Samsung Galaxy S5 (klte).
I tried the solution by robberknight and thomasjfox on a Motorola G (2015) "osprey" running the latest nightly LineageOs 14, but when I want to mount the exfat, I get an error:
mount: '/storage/emulated/0/'->'/dev/storage/xxxx-xxxx': No such file or directory
Is the exfat-support missing on my device?
Edit: I formated the LUKS partition with my ubuntu machine to fat32 (vfat). Then I was able to mount it with the solution by thomasjfox. Just changed -t exfat to -t vfat
Glad it's working for you. As the linux kernel is different for each LineageOS phone, it could be that the Motorola G (2015) does not have exfat support. Though I always thought that exfat support is provided by userspace (FUSE), so it should work IMHO.
does this still work with current Android 10?
I'm considering trying this on my Xiaomi Note 9S (curtana).
But before I start I'd love it if somebody could tell me if they have tried it on an Android 10 device and if it worked.
I'd feel more confident that I don't do the work of backing up and restoring my sdcard in vain (since this post is from 2016/17 and about Android 6..)
hagekic548 said:
does this still work with current Android 10?
Click to expand...
Click to collapse
Works for me except last part (about mounting and setting permissions). I prefer use fbind magisk module to handle encrypted partitions on my SD card, slightly modded it to meet Android 10, works fine so far.
Related
I'm trying to make an auto install script within the initramfs. I've got everything working, including automatic fdisk, but I cannot get mkfs.ext4 to work on the Android kernel, and there is no version of Busybox with the ext4 applet. Does anyone have a mkfs.ext4 that runs successfully on Android? When I run it from a terminal the output is
Code:
mkfs.ext4: 1: Syntax error: word unexpected (expecting ")")
Here's my code if you want to see what I'm doing.
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk1p2 /tmp/tmproot
mkdir /tmp/tmproot/itworks
tar -xzvf /tmp/mnt/mysticfw.tar.gz -C /tmp/tmproot/
sync
#rm /tmp/mnt/mysticfw.tar.gz
umount /tmp/tmproot
fi
sync
umount /tmp/mnt
It automatically partitions the stock Android block and installs a tar.gz from the internal storage to simplify my unsquashed 2.1.4 filesystem install, and the only part I can't get working is mkfs.ext4.
Found one! It's 3 MBs though, so if anyone has a smaller one, it would be very nice.
msticninja said:
I'm trying to make an auto install script within the initramfs. I've got everything working, including automatic fdisk, but I cannot get mkfs.ext4 to work on the Android kernel, and there is no version of Busybox with the ext4 applet. Does anyone have a mkfs.ext4 that runs successfully on Android? When I run it from a terminal the output is
Code:
mkfs.ext4: 1: Syntax error: word unexpected (expecting ")")
Click to expand...
Click to collapse
Why do you don't use the mke2fs from Uruk for example (the easiest way) asking $auron if it's ok for him. His size is only 49KB.
Find it like the following on Uruk installation:
Code:
[COLOR="DarkRed"]
# mkfs.ext4 -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
# find / -name mke2fs | xargs ls -l
-rwxr-xr-x 1 root root 30584 Dec 15 03:46 /system/bin/mke2fs
[B]-rwxr-xr-x 5 root root 49248 4 Jan 15 13:14 /usr/local/sbin/mke2fs[/B]
#/usr/local/sbin/mke2fs -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
[/COLOR]
Here's my code if you want to see what I'm doing.
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk1p2 /tmp/tmproot
mkdir /tmp/tmproot/itworks
tar -xzvf /tmp/mnt/mysticfw.tar.gz -C /tmp/tmproot/
sync
#rm /tmp/mnt/mysticfw.tar.gz
umount /tmp/tmproot
fi
sync
umount /tmp/mnt
It automatically partitions the stock Android block and installs a tar.gz from the internal storage to simplify my unsquashed 2.1.4 filesystem install, and the only part I can't get working is mkfs.ext4.
Click to expand...
Click to collapse
and don't forget to add "-l" on FDISK command and change the device mmcblk0 with mmcblk1 on the lines:
Code:
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
Cheers,
shklifo said:
Why do you don't use the mke2fs from Uruk for example (the easiest way) asking $auron if it's ok for him. His size is only 49KB.
Find it like the following on Uruk installation:
Code:
[COLOR="DarkRed"]
# mkfs.ext4 -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
# find / -name mke2fs | xargs ls -l
-rwxr-xr-x 1 root root 30584 Dec 15 03:46 /system/bin/mke2fs
[B]-rwxr-xr-x 5 root root 49248 4 Jan 15 13:14 /usr/local/sbin/mke2fs[/B]
#/usr/local/sbin/mke2fs -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
[/COLOR]
and don't forget to add "-l" on FDISK command and change the device mmcblk0 with mmcblk1 on the lines:
Code:
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
Cheers,
Click to expand...
Click to collapse
Why didn't I think of that? Thanks.
But regarding mmcblk0/1, I'm replacing the stock Android, so the fdisk.input file contains the commands to delete mmcblk0p2 and p3, and make a new partition in the unused space. I hate using space on my Internal Storage, so I'm using Archos' space.
msticninja said:
Why didn't I think of that? Thanks.
But regarding mmcblk0/1, I'm replacing the stock Android, so the fdisk.input file contains the commands to delete mmcblk0p2 and p3, and make a new partition in the unused space. I hate using space on my Internal Storage, so I'm using Archos' space.
Click to expand...
Click to collapse
If you are using the mmcblk0p2 as rootfs as you say (and you are expanded tar archive on mmcblk1p2), than you have to change the line:
mount /dev/mmcblk1p2 /tmp/tmproot
Click to expand...
Click to collapse
with
mount /dev/mmcblk0p2 /tmp/tmproot
Click to expand...
Click to collapse
shklifo said:
If you are using the mmcblk0p2 as rootfs as you say (and you are expanded tar archive on mmcblk1p2), than you have to change the line:
with
Click to expand...
Click to collapse
I know, that's my current data partition, I'll change it once I'm done testing. The tar file just has a test file in it, so when I boot back into block1, I can see if the IF statement was executed by seeing if it was extracted to block1. I'll also have to change etc/mountpoints once testing is actually finished.
One more question since you're so quick. I think I have everything working, except it needs a reboot in between the fdisk and mke2fs commands to reload the partition table. I'm trying to use partprobe instead of rebooting, but it hasn't been cross compiled to work on Android, AFAIK. Have you seen a way to reload the MBR without rebooting?
msticninja said:
I know, that's my current data partition, I'll change it once I'm done testing. The tar file just has a test file in it, so when I boot back into block1, I can see if the IF statement was executed by seeing if it was extracted to block1. I'll also have to change etc/mountpoints once testing is actually finished.
One more question since you're so quick. I think I have everything working, except it needs a reboot in between the fdisk and mke2fs commands to reload the partition table. I'm trying to use partprobe instead of rebooting, but it hasn't been cross compiled to work on Android, AFAIK. Have you seen a way to reload the MBR without rebooting?
Click to expand...
Click to collapse
I'v been looking at the recovery_lib.sh in the recovery boot image and can't find anything special to re-read the partition table. And yes they also use fdisk to repartition. So I suspect the driver for the block device does not cache the MBR and you can just mke2fs after the partition table is created.
I can't remember from what firmware that recovery boot image was but I think it's from the 2.1.04 and they do some repartitioning there for the swap space.
I'll check it again and get back to you.
wdl1908 said:
I'v been looking at the recovery_lib.sh in the recovery boot image and can't find anything special to re-read the partition table. And yes they also use fdisk to repartition. So I suspect the driver for the block device does not cache the MBR and you can just mke2fs after the partition table is created.
I can't remember from what firmware that recovery boot image was but I think it's from the 2.1.04 and they do some repartitioning there for the swap space.
I'll check it again and get back to you.
Click to expand...
Click to collapse
I just checked the recovery image from 2.1.04 and after the fdisk commands there is nothing to re-read the MBR the next commands executed are mount commands to check if the fs is present I suggest you look at the /etc/scripts/recovery_lib.sh yourself it could give some clues on how to do things.
wdl1908 said:
I just checked the recovery image from 2.1.04 and after the fdisk commands there is nothing to re-read the MBR the next commands executed are mount commands to check if the fs is present I suggest you look at the /etc/scripts/recovery_lib.sh yourself it could give some clues on how to do things.
Click to expand...
Click to collapse
For me too, it have nothing to do with a reboot to load partitions table and access partition to format them with the choised filesystem.
You can delete any partition on linux (except rootfs one ), recreate them and directly format them as you like, reboot isn't necesary.
Thanks for all the replies, very helpful, but I'm stuck. Fdisk seems to use ioctl to reload the partition table, so you don't need a reboot if everything on the device is unmounted before writing the partition table, but I'm having very strange issues with mke2fs now. I've had the whole thing work twice now, but when I flash back to stock, then retry the script, it usually does everything except the formatting. Here's the code:
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
umount /dev/mmcblk0p1
umount /dev/mmcblk0p2
umount /dev/mmcblk0p3
umount /dev/mmcblk0p4
fdisk /dev/mmcblk0 < /home/fdisk.input
mv /tmp/mnt/mysticfw.tar.gz /tmp/mnt/mysticf.tar.gz
sync
umount /tmp/mnt
log_and_reboot
fi
if [ -f /tmp/mnt/mysticf.tar.gz ]; then
rm /etc/mtab
touch /etc/mtab
mke2fs -T ext4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk0p2 /tmp/tmproot
tar -xzf /tmp/mnt/mysticf.tar.gz -C /tmp/tmproot/
sync
mv /tmp/mnt/mysticf.tar.gz /tmp/mnt/mysticdone.tar.gz
umount /tmp/tmproot
rm /etc/mtab
ln -s /proc/mounts /etc/mtab
fi
sync
umount /tmp/mnt
I have it reboot after the fdisk just in case, and the fdisk works perfectly, so the second IF/THEN is the issue. I had to retouch the mtab just to make sure it's empty, as mke2fs fails if mtab doesn't exist(at least in terminal), then I relink it to /proc/mounts as they do in the stock firmware. Here's my mke2fs.conf:
Code:
[defaults]
base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
blocksize = 4096
inode_size = 256
inode_ratio = 16384
[fs_types]
ext3 = {
features = has_journal
}
ext4 = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
inode_size = 256
}
ext4dev = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
inode_size = 256
options = test_fs=1
}
small = {
blocksize = 1024
inode_size = 128
inode_ratio = 4096
}
floppy = {
blocksize = 1024
inode_size = 128
inode_ratio = 8192
}
news = {
inode_ratio = 4096
}
largefile = {
inode_ratio = 1048576
blocksize = -1
}
largefile4 = {
inode_ratio = 4194304
blocksize = -1
}
hurd = {
blocksize = 4096
inode_size = 128
}
Is there a way to echo the output from my script to a file like dontpanic so I can see what the error is?
msticninja said:
Is there a way to echo the output from my script to a file like dontpanic so I can see what the error is?
Click to expand...
Click to collapse
Simple append (">>") and "echo" doesn't work to a redirected logfile?
I've only learned what I've needed to learn over the years, usually with endless google searches and reading through man pages, so I've never tried to log outputs, because I could always see the output in a terminal or onscreen during boot. Android is the first time I haven't been able to actually see the boot process.
Once again, thanks for your help. I probably could've googled this, but I kind of asked as an afterthought. I didn't even think about redirecting. So if the mke2fs line is the one I want to log, I just add "2&>> /tmp/mnt/logfile" to the end of it, right?
Also, thanks for your original thread about booting from Internal Storage, I never got around to developing on Android until you posted that, and I realized just how similar Android is to L/unix(e.g. exactly the same).
msticninja said:
I didn't even think about redirecting. So if the mke2fs line is the one I want to log, I just add "2&>> /tmp/mnt/logfile" to the end of it, right?
Click to expand...
Click to collapse
ehm, no.
In your case must be like the following:
Code:
"your command" >> /tmp/mnt/logfile 2>&1
That means redirect all messages from STDERR (2 - standard error) to STDOUT (1 - standard output) and all messaged collected on STDOUT to the redirected log file /tmp/mnt/logfile, or more comprensible redirect all mesage including error ones to the log file.
I'm working in Unix environments and use them often
And a good practice in developing is to use "echo" to the same log file, so you know the exact place the script is running, like:
Code:
echo "I'm just before the formatting step of the ..." >> /tmp/mnt/logfile
shklifo said:
ehm, no.
In your case must be like the following:
Code:
"your command" >> /tmp/mnt/logfile 2>&1
That means redirect all messages from STDERR (2 - standard error) to STDOUT (1 - standard output) and all messaged collected on STDOUT to the redirected log file /tmp/mnt/logfile, or more comprensible redirect all mesage including error ones to the log file.
I'm working in Unix environments and use them often
And a good practice in developing is to use "echo" to the same log file, so you know the exact place the script is running, like:
Code:
echo "I'm just before the formatting step of the ..." >> /tmp/mnt/logfile
Click to expand...
Click to collapse
Strange. The google searching lead me to believe the "2>&1" was before the location, and replaced ">>". Once again, thanks for the help.
any chance of you getting this uploaded? iterested in this since I'm not that good with linux
TjaXanK said:
any chance of you getting this uploaded? iterested in this since I'm not that good with linux
Click to expand...
Click to collapse
I could probably finish it, but I'm waiting for a new version of Uruk first, as his install script already gets rid of the linux steps, it just doesn't give you the choice to install to the internal memory yet. Once he does that, I'll add my changes to make it install to the Archos partition. The latest Uruk is also a bit too big for the archos partition. I had to cut my data partition down to ~150 megs.
msticninja said:
I could probably finish it, but I'm waiting for a new version of Uruk first, as his install script already gets rid of the linux steps, it just doesn't give you the choice to install to the internal memory yet. Once he does that, I'll add my changes to make it install to the Archos partition. The latest Uruk is also a bit too big for the archos partition. I had to cut my data partition down to ~150 megs.
Click to expand...
Click to collapse
ok, I'm currently running urk with the new install system and it's brillant but it would be perfect if we could run it without cutting down on our storage space
Hi,
I wish to perform a read/write to /dev/block/mmcblk1p1 from the initrd stage of the booting sequence on my SGS III.
I've managed to unpack the boot.img, add some shell code to /sbin/init and re-pack the image and flash it to my device.
but when i try to access the mmcblk1p1 (the external sd, which is of course present) it seems that the write fails. i tried the most simple procedure:
Code:
echo "hello world" > /dev/block/mmcblk1p1 # shuld write to the first sector.
or
Code:
mkdir /mysd
mount -t vfat /dev/block/mmcblk1p1 /mysd
echo "hello world" > /mysd/test.txt # should create a file on the sd card.
umount /mysd
but non seems to work.
with the second code i actually managed to create a test.txt with with "hello world" into the internal sd "/" partition.
as well I've added mknod and created the mmcblk1p1 file descriptor. i think I've might need to add something to the fstab file.
many thanks.
Another try :angel:
i have to assume that its a permission issue, but i cant figure out for the life of me exactly what...
heres the deal, been converting from cm10 to cm10.1 on the warp sequent, have gotten as far as to make the sd card readable using adb shell... i can cd to /storage/sdcard, do an ls, and it shows all my files just as it should. but when i go to gallery, it says no sd card, and when i go to file manager there is nothing there its just an empty folder even with all hidden files, symlinks, system files, etc shown and in root browser mode, it makes no sense to me at all
even when trying to view the size in the storage menu it says its 289mb or whatever size the tempfs is
please help save what little is left of my sanity
init.warp2.rc
on early-init
mkdir /storage/sdcard 0000 system system
# for backwards compatibility
symlink /storage/sdcard /mnt/sdcard
symlink /storage/sdcard /sdcard
export EXTERNAL_STORAGE /storage/sdcard
vold.fstab
dev_mount sdcard /storage/sdcard auto /devices/platform/msm_sdcc.4/mmc_host/mmc2
storage_list.xml
<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
<!-- removable is not set in nosdcard product -->
<storage android:mountPoint="/storage/sdcard"
android:storageDescription="@string/storage_sd_card"
androidrimary="true"
android:removable="true"
android:allowMassStorage="true"
android:maxFileSize="4096" />
</StorageList>
This isnt a fix for your file manager, but
sudo apt-get install gmtp
try it out
it works for stock
read something interesting the other day, so how is the jellybeer rom i built, not jellybeer ?
no, not linux, android... on the phone, if i go to the cm file manager it cant see anything in the directory as if the sd card isnt mounted, then if i go in through the computer using an adb shell command, which has the exact same function as a terminal emulator program on the phone itself, cd to the sd cards directory, the same directory i was just looking at in cm manager that was supposedly blank, it has the sd cards files in it
android 4.2 changed the sd card access methods completely, and it screwed us. the sd card mounts, but android itself cant read it right
I added a couple lines to PG's boardconfig.mk for the sdcard, after i build without it, i will build one with the changes, it points the sd card to certain dir.
from here https://github.com/animusfl/android_device_zte_warp2/blob/jellybean/BoardConfig.mk
# sdcard
BOARD_HAS_LARGE_FILESYSTEM := true
BOARD_USES_MMCUTILS := true
BOARD_HAS_SDCARD_INTERNAL := true
BOARD_SDCARD_DEVICE_PRIMARY := /dev/block/mmcblk1p1
BOARD_SDCARD_DEVICE_SECONDARY := /dev/block/mmcblk1
BOARD_SDEXT_DEVICE := /dev/block/mmcblk1p2
https://github.com/Warped420/android_device_zte_warp2/blob/cm-10.1/BoardConfig.mk
Warped420 said:
I added a couple lines to PG's boardconfig.mk for the sdcard, after i build without it, i will build one with the changes, it points the sd card to certain dir.
from here
# sdcard
BOARD_HAS_LARGE_FILESYSTEM := true
BOARD_USES_MMCUTILS := true
BOARD_HAS_SDCARD_INTERNAL := true
BOARD_SDCARD_DEVICE_PRIMARY := /dev/block/mmcblk1p1
BOARD_SDCARD_DEVICE_SECONDARY := /dev/block/mmcblk1
BOARD_SDEXT_DEVICE := /dev/block/mmcblk1p2
Click to expand...
Click to collapse
youre still missing the point. mounts fine, can be seen on the phone using a terminal emulator program, cant be seen in file manager. card is mounted, but android only sees the temp fs version which is blank
Junkie2100 said:
youre still missing the point. mounts fine, can be seen on the phone using a terminal emulator program, cant be seen in file manager. card is mounted, but android only sees the temp fs version which is blank
Click to expand...
Click to collapse
I have this exact same problem.
Have you found any solution to the case ?
HOW TO:
Merge "Internal Storage" (/storage/sdcard0) and "Data" (/data) partitions.
WHY:
1) Eliminate "not enough storage" limitation on installed apps. Install as many as you want.
2) Increase potential Internal Storage space (adding unused space from the /cache /preload /data and /emmc partitions together into one mega partition).
3) True full device encryption for /data and /storage/sdcard0 (if you desire).
OVERVIEW OF HOW IT WORKS:
1) Use Odin to flash a modified PIT file to repartition your device. /data is sized to 14+ GB, /cache, /preload, and /emmc are all downsized to 10MB each and are unused.
2) Use my script to modify your ROM to store your "Internal Storage" files on the /data/media/0 folder. This script will hijack your "su" and "sdcard" binaries to work properly.
3) Use my custom TWRP recovery for all of your recovery needs (supports encryption).
4) Encrypt your device if you like.
DIFFICULTY:
Medium
REQUIRED SKILLS:
1) Know how to use ADB
2) Know how to use Odin
3) Know how to fully backup your device and restore it after a factory reset.
SUPPORTED DEVICES:
SGH-S959G ONLY
"COULD BE" SUPPORTED DEVICES:
***DO NOT USE THIS METHOD FOR ANYTHING OTHER THAN SGH-S959G OR YOU WILL RISK HARD-BRICKING IT.
***IF YOU WANT TO TRY IT OUT THEN YOU MUST POST TO THIS FORUM FIRST AND WE WILL DISCUSS
***GETTING YOUR DEVICE SUPPORTED
***Possibly SGH-I777
***Possibly SGH-I9100
***Maybe Others
SUPPORTED ROMS:
CyanogenMOD 12+ (and probably derivative ROMs)
*Risk of soft brick if trying on another ROM (but no higher risk of hard brick).
RISKS: There is a very small risk of hard-brick when flashing a PIT file to your device. To minimize your risk:
1) Don't try to flash during a thunderstorm.
2) Don't try to flash to an unsupported device.
3) Don't try to flash if your USB cable / port / charging port is damaged/faulty. YOU MUST HAVE A RELIABLE USB PORT
4) Don't try to flash with your battery at 0%.
5) Don't try to flash with a computer that likes to crash a lot.
6) Don't unplug or restart your device or computer in the middle of a flash (it takes 10 seconds, be patient, geez).
STEPS TO INSTALL:
Step #1:
Make 2 backups of everything on your phone. All partitions, sdcard, micro-SD, etc...
MOVE THESE BACKUPS TO YOUR COMPUTER, THEY WILL BE ERASED FROM YOUR PHONE.
Make sure you know how to fully restore a completely wiped phone (without a preinstalled recovery) using the computer backups, starting only from the phone's BOOTLOADER/Download/Odin mode.
If you don't know how to do this, you must stop here.
PROCEEDING WITH THIS TUTORIAL WILL PERMANENTLY WIPE MOST PARTITIONS ON YOUR PHONE, THAT INCLUDES: /cache /modem /system /data /emmc /preload
Did you back up your /efs?
BACK UP YOUR /efs!!!
Step #2: Download all attached files.
Step #3: Verify that you have an uncorrupted version of both PIT files. To do this, use the md5 tool (attached) in the windows command line:
> md5 Original_SGH-S959G.pit
Output should read:
7237EC02379B497C6028236B5BBC0C91 Original_SGH-S959G.pit
> md5 MEGADATA_SGH-S959G.pit
Output should read:
9036368F41FAD9FAA266D08398EA2A33 MEGADATA_SGH-S959G.pit
If the MD5 sums don't match, STOP HERE.
DO NOT FLASH A .PIT FILE IF THE MD5 SUM IS WRONG.
Step #5: Install recovery ...
SGH-S959G_TWRP_v2.8.7.0_datamedia.zip
Step #6: Flash PIT
Did you do Step 3? Do it again, don't be lazy.
Open Odin (attached), click the PIT button. Select MEGADATA_SGH-S959G.pit
Re-Partition, Auto Reboot and F. Reset Time should be checked. The PIT filename should appear next to the PIT button.
NOTHING ELSE SHOULD BE CHECKED.
Boot your phone into bootloader/download mode and connect it. The first ID:COM field should turn yellow and have text that looks like 0:[COM5]. In the message field you will see something like <ID:0/005> Added!
Review the risks of what you're about to do above.
Hold your breath, press the start button.
Flashing takes about 10 seconds. Once it's done your phone will reboot. You can close Odin at this point.
Step #7: Format partitions.
Boot into recovery.
Format EMMC: adb shell make_ext4fs mmcblk0p11
Format PRELOAD: adb shell make_ext4fs mmcblk0p12
Wipe CACHE using recovery interface (from advanced wipe screen).
Format DATA using recovery interface (special button present on wipe screen) .
Wipe INTERNAL STORAGE using recovery interface (from advanced wipe screen).
Step #8: Restore partitions.
Reboot into recovery (you must do this again after you format, and the recovery must be datamedia version if you are installing, regular version if you are uninstalling - did you follow step #5?).
... restore your /modem /system /data and /emmc partitions. /cache and /preload should not be restored.
Step #9: Modify Android ...
(I tested on a fully booted android system, but probably works from recovery too.)
Run these commands (obviously correcting the "C:datamedia_installer" path).
*********************************
** If installing from recovery **
*********************************
** mount /data **
** mount /system **
*********************************
adb root
adb push "C:datamedia_installer" /data/local/datamedia_installer
adb shell chmod 700 /data/local/datamedia_installer
To Install: adb shell /data/local/datamedia_installer install
Note: If you ever flash a new ROM in the future it will likely disable this mod. You'll have to do the Step #9 command(s) again.
To Uninstall: adb shell /data/local/datamedia_installer uninstall
Reboot.
Step #10: Adjust /data/media permissions ...
adb root
adb shell chown -R media_rw /data/media/0
adb shell chgrp -R media_rw /data/media/0
adb shell find /data/media/0 -type d -exec chmod 775 {} +
adb shell find /data/media/0 -type f -exec chmod 664 {} +
adb shell chcon -R ubject_r:media_rw_data_file:s0 /data/media/0
Congratulations, if you made it this far you're golden.
STEPS TO UNINSTALL:
Step #1: Install recovery ...
SGH-S959G_TWRP_v2.8.7.0.zip
Step #2: MD5 Verify and then Flash PIT ... (see Step #6 above)
Original_SGH-S959G.pit
Step #3: Format Partitions ... (see Step #7 above)
Step #4: Restore partitions ... (see Step #8 above)
Make sure you are using regular version, not datamedia version.
**You can optionally skip the /emmc restore at this point, and instead finish Step #5 below, then restore to /storage/sdcard0 while Android is running (not in recovery). This should (theoretically) setup the right permissions so you can skip step #6 below.
Step #5: Modify Android ... (see Step #9 above)
Only difference is the first argument for datamedia_installer script (use "uninstall")
Step #6: Adjust /mnt/media_rw/sdcard0 permissions ...
Not sure exactly what the permissions need to be, never had to do this. Let me know if you are trying to do this and I can help you troubleshoot.
**See my note in uninstall Step #4 if you are having trouble here.
XDA:DevDB Information
[PIT] SGH-S959G: Merge /data and /storage/sdcard0 (/data/media mod), Tool/Utility for the AT&T Samsung Galaxy S II SGH-I777
Contributors
dimoochka, Lanchon (thanks for the idea!)
Version Information
Status: Stable
Created 2015-10-07
Last Updated 2015-10-07
great work!
for those wanting to peek at the script without downloading 17MB...
Code:
if [ $1 ] && [ $1 == "install" ]
then
if [ -e /system/bin/sdcard_bin ]
then
echo "Already installed."
else
mount -o remount,rw /system
cp /system/xbin/su /data/local/su_bin_backup
cp /system/bin/sdcard /data/local/sdcard_bin_backup
chmod 700 /data/local/su_bin_backup /data/local/sdcard_bin_backup
cp /system/bin/sh /system/bin/sdcard_sh
mv /system/bin/sdcard /system/bin/sdcard_bin
mv /system/xbin/su /system/xbin/su_bin
echo "#!/system/bin/sdcard_sh" > /system/bin/sdcard
echo "" >> /system/bin/sdcard
echo "while true; do" >> /system/bin/sdcard
echo " sleep 10000" >> /system/bin/sdcard
echo "done" >> /system/bin/sdcard
echo "if [ \$7 ] && [ \$7 == \"/storage/sdcard0\" ]" >> /system/bin/sdcard
echo "then" >> /system/bin/sdcard
echo "fi" >> /system/bin/sdcard
echo "#!/system/bin/sh" > /system/xbin/su
echo "" >> /system/xbin/su
echo "if [ \$1 ] && [ \$1 == \"--daemon\" ]" >> /system/xbin/su
echo "then" >> /system/xbin/su
echo " /system/xbin/sdcardd&" >> /system/xbin/su
echo "fi" >> /system/xbin/su
echo "/system/xbin/su_bin \"\[email protected]\"" >> /system/xbin/su
echo "#!/system/bin/sh" > /system/xbin/sdcardd
echo "" >> /system/xbin/sdcardd
echo "while [ \"\$mprop\" != running ]; do" >> /system/xbin/sdcardd
echo " sleep 1" >> /system/xbin/sdcardd
echo " mprop=\`getprop init.svc.fuse_sdcard0\`" >> /system/xbin/sdcardd
echo "done" >> /system/xbin/sdcardd
echo " setenforce 0" >> /system/xbin/sdcardd
echo " runcon u:r:init:s0 /system/bin/sh -c \"
setenforce 1;
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/usbdisk0 /storage/usbdisk0&
\"&
" >> /system/xbin/sdcardd
chmod 755 /system/xbin/su /system/xbin/sdcardd
chmod -R 755 /system/bin/sdcard /system/bin/sdcard_sh
chown -R root /system/bin/sdcard /system/bin/sdcard_sh
chgrp -R shell /system/bin/sdcard /system/bin/sdcard_sh
chcon u:object_r:su_exec:s0 /system/xbin/su
chcon u:object_r:su_exec:s0 /system/xbin/sdcardd
chcon u:object_r:sdcardd_exec:s0 /system/bin/sdcard
chcon u:object_r:sdcardd_exec:s0 /system/bin/sdcard_sh
mount -o remount,ro /system
echo "Successfully installed (you can ignore any device busy errors and should not see any other errors)."
fi
fi
if [ $1 ] && [ $1 == "uninstall" ]
then
if [ -e /system/bin/sdcard_bin ]
then
mount -o remount,rw /system
mv -f /system/bin/sdcard_bin /system/bin/sdcard
mv -f /system/xbin/su_bin /system/xbin/su
rm /system/bin/sdcard_sh
rm /system/xbin/sdcardd
mount -o remount,ro /system
echo "Successfully installed (you can ignore any device busy errors and should not see any other errors)."
else
echo "Not installed."
fi
fi
This looks interesting to me, I have the 4 GB pit mod on my S959G and I have been wondering if one could take the internal SD card space and put it to /data. You made my day with this but has anyone had luck in doing this mod and using xposed modules to make the external SD card the card apps, music, pictures, downloads, and etc folders as a fake internal SD card or is that what modding the android system does so that ROMs see the external SD card as the only expandable memory directory?
Sent from my CM 10 Toshiba Thrive using XDA Free mobile app
cidlover said:
This looks interesting to me, I have the 4 GB pit mod on my S959G and I have been wondering if one could take the internal SD card space and put it to /data. You made my day with this but has anyone had luck in doing this mod and using xposed modules to make the external SD card the card apps, music, pictures, downloads, and etc folders as a fake internal SD card or is that what modding the android system does so that ROMs see the external SD card as the only expandable memory directory?
Sent from my CM 10 Toshiba Thrive using XDA Free mobile app
Click to expand...
Click to collapse
In a nutshell, this is what my mod does:
/data points to mmcblk0p10 (I think off the top of my head)
/storage/sdcard0 points to /mnt/media_rw/sdcard0 which points to mmcblk0p11 (I think off the top of my head)
By installing my PIT, you severely shrink mmcblk0p11 and expand mmcblk0p10 to monster size.
My script then changes the location that /storage/sdcard0 points to (to /data/media/0 which is located on mmcblk0p10).
Android puts everything (pictures, downloads, etc.) by default onto /storage/sdcard0 -> so these files get redirected to the partition which has all the space (/data/media/0 or mmcblk0p10).
So, to answer your question, an Xposed mod to redirect all of that stuff to /storage/sdcard1 (external SD) instead may or may not work depending on the method it uses. If it tells the system that the default directory to use is /storage/sdcard1 via some environment variable or method then there should be no interaction (which is probably the way that the mod works; that's the simplest method). If it does some unmounting/mounting of directories then that may interfere with my script depending on the timing with which the Xposed mod activates.
If you decide to try to get Xposed to do this and it doesn't work - let me know what mod you're using. I can fix my script to accommodate it.
Alternatively, you don't even need Xposed. Instead you can just edit the script at this point (in notepad):
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
First line: change /storage/sdcard0 to /storage/sdcard1
Second line: change storage/sdcard1 to /storage/sdcard0
*don't add/remove any whitespace or new lines (or really change anything other than the 0 and 1) or you may break the script
This will swap the folders so that /storage/sdcard0 points to external SD and /storage/sdcard1 points to /data/media/0.
Why do you want to do this anyway? 14+ gigs of /data not enough for your carefully curated porn collection?
dimoochka said:
In a nutshell, this is what my mod does:
/data points to mmcblk0p10 (I think off the top of my head)
/storage/sdcard0 points to /mnt/media_rw/sdcard0 which points to mmcblk0p11 (I think off the top of my head)
By installing my PIT, you severely shrink mmcblk0p11 and expand mmcblk0p10 to monster size.
My script then changes the location that /storage/sdcard0 points to (to /data/media/0 which is located on mmcblk0p10).
Android puts everything (pictures, downloads, etc.) by default onto /storage/sdcard0 -> so these files get redirected to the partition which has all the space (/data/media/0 or mmcblk0p10).
So, to answer your question, an Xposed mod to redirect all of that stuff to /storage/sdcard1 (external SD) instead may or may not work depending on the method it uses. If it tells the system that the default directory to use is /storage/sdcard1 via some environment variable or method then there should be no interaction (which is probably the way that the mod works; that's the simplest method). If it does some unmounting/mounting of directories then that may interfere with my script depending on the timing with which the Xposed mod activates.
If you decide to try to get Xposed to do this and it doesn't work - let me know what mod you're using. I can fix my script to accommodate it.
Alternatively, you don't even need Xposed. Instead you can just edit the script at this point (in notepad):
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
First line: change /storage/sdcard0 to /storage/sdcard1
Second line: change storage/sdcard1 to /storage/sdcard0
*don't add/remove any whitespace or new lines (or really change anything other than the 0 and 1) or you may break the script
This will swap the folders so that /storage/sdcard0 points to external SD and /storage/sdcard1 points to /data/media/0.
Why do you want to do this anyway? 14+ gigs of /data not enough for your carefully curated porn collection?
Click to expand...
Click to collapse
Lol, no, I wanted to see if we turn, in theory, our Galaxy S2 phones into a phone with no Internal Memory and the only expandable memory is a external sd card to expand it, i just was thinking a few xposed modules can help after doing this mod.
cidlover said:
Lol, no, I wanted to see if we turn, in theory, our Galaxy S2 phones into a phone with no Internal Memory and the only expandable memory is a external sd card to expand it, i just was thinking a few xposed modules can help after doing this mod.
Click to expand...
Click to collapse
Just to clarify, the behavior of the device after this mod is identical. If installed properly, this mod does not create any new problems that need fixing. It still behaves exactly the same as if an internal storage partition exists.
dimoochka said:
Just to clarify, the behavior of the device after this mod is identical. If installed properly, this mod does not create any new problems that need fixing. It still behaves exactly the same as if an internal storage partition exists.
Click to expand...
Click to collapse
Sorry to bring this up again, but how is sd card data handled? Like .obb files in the Android folder on the internal SD card after this mod. And has anyone tried this mod yet?
cidlover said:
Sorry to bring this up again, but how is sd card data handled? Like .obb files in the Android folder on the internal SD card after this mod. And has anyone tried this mod yet?
Click to expand...
Click to collapse
Real simple. Instead of files being placed into /storage/sdcard0 they are redirected to /data/media/0. At the end of the day that is the primary difference.
The /data/media/obb folder remains empty (I have no idea what this is used for normally).
I've been using this mod for 2 months, it's worked great. I think me and you are probably the only two people interested in doing it :laugh:
dimoochka said:
The /data/media/obb folder remains empty (I have no idea what this is used for normally).
Click to expand...
Click to collapse
http://blog.notfaqs.com/2013/05/android-obb-files-location.html
http://developer.android.com/google/play/expansion-files.html
/system 1gb
I would like to get some help modifying the /system partition to be 1 gb is there any help i can get?
Hi, I'm completly lost. I'm trying to get Daydream running on a Sony Xperia XZ Premium (XZP). I read that 2 files must be modified for this. I already edited the build.prop file in /system. But the second one, the handheld_core_hardware.xml is for some reason not where it should be. I backed up the TA-partion and flashed the firmware "G8141_MobilTel EAD BG_1309-2357_47.2.A.10.62_R2C" with the kernel "boot-G8141-47.2.A.10.62-hideunlock-magisk-19.3.img" following the instructions here on XDA. Using ADB I open a root shell (ADB shell, su) and try to copy a modified version of the XML file from data/local/tmp to system/etc/permissions after re-mounting /system in rw-mode. I got the file by extracting the ext4-image in the system.sin of the firmware pack and pushed it to tmp using ADB. When I try to copy the file, I either get "I/O error" or no error. In the latter case the file is nevertheless not copied and I get the I/O error when mounting to ro-mode again. It's also strange that in this case I can cat the contents and list it via ls -l but only if I use the exact name no wildcards. On next boot or when ro-mounting succeeds its completely gone.
This is how it looks on the shell:
Code:
127|G8141:/system/etc/permissions # ls -l handheld_core_hardware.xml
ls: handheld_core_hardware.xml: No such file or directory
1|G8141:/system/etc/permissions # cp /data/local/tmp/handheld_core_hardware.xml /system/etc/permissions
cp: /system/etc/permissions/handheld_core_hardware.xml: I/O error
1|G8141:/system/etc/permissions # ls -l /data/local/tmp
total 12
-rw-rw-rw- 1 shell shell 4877 2019-09-06 10:03 handheld_core_hardware.xml
drwxr-xr-x 2 root root 4096 2019-09-06 11:47 test
G8141:/system/etc/permissions # mount | grep system
/dev/block/dm-0 on /system type ext4 (rw,seclabel,relatime,block_validity,discard,delalloc,barrier,user_xattr)
/dev/block/sde33 on /system/vendor/firmware_mnt type vfat (ro,context=u:object_r:firmware_file:s0,relatime,gid=1000,fmas
k=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/sde37 on /system/vendor/bt_firmware type vfat (ro,context=u:object_r:bt_firmware_file:s0,relatime,uid=1002,gi
d=3002,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/sde34 on /system/vendor/dsp type ext4 (ro,seclabel,nosuid,nodev,relatime,data=ordered)
/sbin/.magisk/block/system on /sbin/.magisk/mirror/system type ext4 (ro,seclabel,relatime,block_validity,discard,delallo
c,barrier,user_xattr)
G8141:/system/etc/permissions #
What am I doing wrong?
Is there maybe a better way meanwhile to enable Daydream on unsupported devices?
I mean, it's a bad joke, Sony makes this great 4k display but doesn't support VR properly. Daydream even starts and is working just to block the view a second later with a big PopUp telling that the device is not compatible.