OEM partition readonly - Moto Z Questions & Answers

I'm trying to flash lineageOS on my Moto Z/XT1650 however it aborts with 'E2001: Failed to update vendor image.' and leaves the system in an unbootable state (which i have then to fix by restoring the stock image from backups) After having a closer look the error seems to originate from the updater script when it tries to patch the vendor/oem partition (/dev/block/bootdevice/by-name/oem or /dev/block/sdc9) because the partition is readonly.
Code:
block_image_update("/dev/block/bootdevice/by-name/oem", package_extract_file("vendor.transfer.list"), "vendor.new.dat.br", "vendor.patch.dat") ||
abort("E2001: Failed to update vendor image.");
I also failed to mount the partition rw via adb shell.
Code:
~ # mount -w /dev/block/sdc9 /oem
~ # ls -al /oem
drwxr-xr-x 6 root root 4096 Jan 1 1970 .
drwxrwxrwt 31 root root 1040 Jul 26 09:25 ..
drwxr-xr-x 6 root root 4096 Sep 25 2018 app
drwxr-xr-x 6 root root 4096 Sep 25 2018 etc
drwx------ 2 root root 4096 Jan 1 1970 lost+found
-rw-r--r-- 1 root root 146 Sep 25 2018 oem.prop
drwxr-xr-x 4 root root 4096 Sep 25 2018 priv-app
~ # touch /oem/test
touch: /oem/test: Read-only file system
How do i make the partition rw so that twrp/lineage installer can patch it?

Never mind, i found the solution: Booting directly into twrp causes these issues. Flash the twrp/recovery image and boot into recovery mode instead

Related

CWM: "Error mounting /sdcard!"

I've seem many threads about it, but couldn't really find a solution.
I just pulled out my sdcard to do some updates in my rom (I was running Th3Bill's miui v4).
I've copied a couple of .zips to try, and when I inserted back, my I /sdcard wasn't mounting.
I've tried to format in windows (fast and normal mode); I've putted this very same card in my tabled (xoom2 me) and it was working fine.
I've tried to run format /sdcard in cwm. same error mounting;
I went to advance > show log:
CWM-based Recovery v5.0.2.7-atrix5
Error mounting /sdcard!
ro.bootloader=unknown
ro.hardware=olympus
ro.revision=33776
ro.emmc=0
init.svc.recovery=running
init.svc.adbd=running
I:Checking for extendedcommand...
I:Skipping execution of extendedcommand. file not found...
W:failed to mount /dev/block/mmcblk1p1 (No such file or directory)
W:failed to mount /dev/block/mmcblk1 (No such file or directory)
Error mounting /sdcard!
I've tried some stuff on adb (someone mentioned it, not sure what it means):
C:\Users\Neon\Documents\Android\Auto stuff>adb shell ln -n -s /data/media /sdcar
d
ln: /sdcard/media: File exists
C:\Users\Neon\Documents\Android\Auto stuff>adb shell ls -a -l
drwxr-xr-x 21 root root 0 Aug 7 02:15 .
drwxr-xr-x 21 root root 0 Aug 7 02:15 ..
drwxr-xr-x 2 root root 0 Aug 7 02:15 boot
drwxrwx--x 5 system cache 4096 Aug 7 01:43 cache
drwxrwx--x 2 root root 0 Jan 1 1970 data
drwxr-xr-x 2 root root 0 Aug 7 02:15 datadata
-rw-r--r-- 1 root root 3875 Jan 1 1970 default.prop
drwxr-xr-x 9 root root 3260 Aug 7 02:15 dev
drwxr-xr-x 2 root root 0 Aug 7 02:15 emmc
drwxr-xr-x 2 root root 0 Aug 7 02:15 etc
-rwxr-x--- 1 root root 94404 Jan 1 1970 init
-rwxr-x--- 1 root root 783 Jan 1 1970 init.rc
drwxr-xr-x 2 root root 0 Aug 7 02:15 osh
drwxr-xr-x 2 root root 0 Aug 7 02:15 pds
drwxr-xr-x 2 root root 0 Aug 7 02:15 preinstall
dr-xr-xr-x 95 root root 0 Jan 1 1970 proc
drwxr-xr-x 3 root root 0 Jan 1 1970 res
drwx------ 2 root root 0 Sep 5 2011 root
drwxr-x--- 2 root root 0 Jan 1 1970 sbin
drwxr-xr-x 2 root root 0 Aug 7 02:15 sd-ext
drwxr-xr-x 2 root root 0 Aug 7 02:16 sdcard
drwxr-xr-x 14 root root 0 Jan 1 1970 sys
drwxr-xr-x 3 root root 0 Jan 1 1970 system
drwxr-xr-x 2 root root 0 Aug 7 02:15 tmp
-rw-r--r-- 1 root root 0 Jan 1 1970 ueventd.goldfish.rc
-rw-r--r-- 1 root root 9731 Jan 1 1970 ueventd.olympus.rc
-rw-r--r-- 1 root root 4078 Jan 1 1970 ueventd.rc
What do I need to do?
Maybe is there some pins not working in my phone? Because I've tried another micro sd and got same error!
Thanks in advance!
Sounds like you really do have some issues with the built-in card slot. Try inspecting it visually, maybe there is some visible damage. Other than that, I'm not sure what can you do... Maybe claim warranty on it?
You should also never run random commands if you don't have at least some idea what they do. Those commands have nothing to do with fixing the sdcard, luckily for you they didn't work.
ravilov said:
Sounds like you really do have some issues with the built-in card slot. Try inspecting it visually, maybe there is some visible damage. Other than that, I'm not sure what can you do... Maybe claim warranty on it?
You should also never run random commands if you don't have at least some idea what they do. Those commands have nothing to do with fixing the sdcard, luckily for you they didn't work.
Click to expand...
Click to collapse
Well, Actually those commands weren't trying to fix it, and I know what ls does, I wasn't much sure about how ln works, but I know that it wouldn't damage my stuff.
I just checked some stuff here, it seems to be a hardware issue indeed, when I put my nail under the card, it reads! Unfortunately I can't claim warranty. I bought this phone used, via ebay, like and year ago, from a seller in USA (I'm in Brazil). I'll try to arrange some workaround (maybe some paper under it might work,...) and hope it works properly.

weird characters with ADB command: adb shell ls -la /

hello, I need some assistance regarding a strange characters when using ADB commands from MSDOS window.
In my tablet that is running Android ICS 4.0.4, and is rooted, I replaced most of the commands that TOOLBOX was assign to issue in /system/bin. I replaced them with BUSYBOX commands, and everything works fine from the standpoint of the tablet.
But somehow I started to get some weird characters when using the LS command in ADB shell from a PC. so it happened right away after the replacement.
So I did a listing of the root files and folders in the tablet form my PC with the command:
adb shell ls -la /
and this is what I got:
C:\Windows\system32>adb shell ls -la /
total 285
drwxr-xr-x 16 root root 0 Sep 12 11:59 ←[1;34m.←[0m
drwxr-xr-x 16 root root 0 Sep 12 11:59 ←[1;34m..←[0m
drwxr-xr-x 3 root root 0 Sep 12 11:59 ←[1;34macct←[0m
drwxrwx--- 4 system cache 4096 Sep 12 13:01 ←[1;34mcache←[0m
dr-x------ 2 root root 0 Sep 12 11:59 ←[1;34mconfig←[0m
lrwxrwxrwx 1 root root 17 Sep 12 11:59 ←[1;36md←[0m -> ←[1;34m/sys/kernel/debug←[0m
drwxrwx--x 25 system system 4096 Sep 6 23:22 ←[1;34mdata←[0m
-rw-r--r-- 1 root root 89 Dec 31 1969 ←[0;0mdefault.prop←[0m
drwxr-xr-x 12 root root 14240 Sep 12 12:09 ←[1;34mdev←[0m
lrwxrwxrwx 1 root root 11 Sep 12 11:59 ←[1;36metc←[0m -> ←[1;34m/system/etc←[0m
drwxrwxrwx 3 root root 16384 Dec 31 1969 ←[1;34mfirmware←[0m
-rwxr-x--- 1 root root 98736 Dec 31 1969 ←[1;32minit←[0m
-rwxr-x--- 1 root root 2344 Dec 31 1969 ←[1;32minit.goldfish.rc←[0m
-rwxr-x--- 1 root root 15813 Dec 31 1969 ←[1;32minit.qcom.rc←[0m
-rwxr-x--- 1 root root 11014 Dec 31 1969 ←[1;32minit.qcom.sh←[0m
-rwxr-x--- 1 root root 30858 Dec 31 1969 ←[1;32minit.qcom.usb.rc←[0m
-rwxr-x--- 1 root root 8786 Dec 31 1969 ←[1;32minit.qcom.usb.sh←[0m
-rwxr-x--- 1 root root 19420 Dec 31 1969 ←[1;32minit.rc←[0m
-rwxr-x--- 1 root root 3491 Dec 31 1969 ←[1;32minit.target.rc←[0m
-rwxr-x--- 1 root root 12760 Dec 31 1969 ←[1;32minitlogo.rle←[0m
drwxrwxr-x 6 root system 0 Sep 12 11:59 ←[1;34mmnt←[0m
drwxrwx--x 4 system system 1024 Jul 19 22:25 ←[1;34mpersist←[0m
dr-xr-xr-x 900 root root 0 Dec 31 1969 ←[1;34mproc←[0m
drwx------ 2 root root 0 Jun 27 05:47 ←[1;34mroot←[0m
drwxr-x--- 2 root root 0 Dec 31 1969 ←[1;34msbin←[0m
lrwxrwxrwx 1 root root 11 Sep 12 11:59 ←[1;36msdcard←[0m -> ←[1;34m/mnt/sdcard←[0m
drwxr-xr-x 12 root root 0 Sep 12 11:59 ←[1;34msys←[0m
drwxr-xr-x 14 root root 4096 Sep 6 23:20 ←[1;34msystem←[0m
drwxr-xr-x 5 root root 4096 Jul 19 22:25 ←[1;34mtombstones←[0m
-rw-r--r-- 1 root root 272 Dec 31 1969 ←[0;0mueventd.goldfish.rc←[0m
-rw-r--r-- 1 root root 8338 Dec 31 1969 ←[0;0mueventd.rc←[0m
lrwxrwxrwx 1 root root 14 Sep 12 11:59 ←[1;36mvendor←[0m -> ←[1;34m/system/vendor←[0m
But from the tablet when I issue the command ls -la / i get the normal listing but in shows in COLOR, so I''m guessing that <-[1;36m in ADB represents a color ([0,0m for white, [1;34m for dark blue, etc), but how do I go to show color listing in ADB shell in my PC ?
Before when TOOLBOX was handing the LS command there was not color in the listing, but now with BUSYBOX handling the LS command I get nice different colors for files/folders/scripts, etc.
Any way I can fix this from the standpoint of the Widows PC MSDOS window with ADB shell listing files with LS in also in color ???
much appreciated, regards.
UPDATE:
I found out that I can list with ADB shell without those strange characters (in other words with NO COLOR) with the following command:
adb shell ls -la --color=never /
but it would be nice not to have to type --color=never every time I want a listing and better find a way to list it with color from PC in MSDOS window.
you can use a utility like ansicon, which allows msdos command windows to interpret the colour codes. You could add this to windows startup if you want, or use some replacement command line utility that can automatically run an app on startup.
flshg said:
you can use a utility like ansicon, which allows msdos command windows to interpret the colour codes. You could add this to windows startup if you want, or use some replacement command line utility that can automatically run an app on startup.
Click to expand...
Click to collapse
thanks a bunch, it worked just great!

[Q] Strange behavior with ext4 mount (root can see but apps cannot)

Hi all,
I'm just hacking at my rk3188 box, and trying to get XBMC to read my ext4 external hard drive.
However when the hard drive is mounted, XBMC only sees an empty directory!
Also, in the terminal, "su'ing" as an app user, the directory appears empty also.
This worked perfectly with android 4.2, 4.4 seems be more troublesome.
Code:
[email protected]_872xu:/ # ls -ailrt /mnt/usb_storage/usb/
3222 dr-xr-xr-x 3 media 1023 60 Sep 9 11:32 ..
10959 -rw-rw-rw- 1 root root 0 Sep 9 11:35 testing
8841 drwxrwxrwx 2 media root 60 Sep 9 14:18 .
[email protected]_872xu:/ # mount -t ext4 /dev/block/sda1 /mnt/usb_storage/usb
[email protected]_872xu:/ # ls -l /mnt/usb_storage/usb/backup/
-rwxrwxr-x 1 root root 2147483648 Sep 9 11:20 arch.img
drwxrwxrwx 2 root root 4096 Sep 7 17:30 init.d
[email protected]_872xu:/ # su - app_65
[email protected]_872xu:/ $ ls -l /mnt/usb_storage/usb/backup/
/mnt/usb_storage/usb/backup/: No such file or directory
1|[email protected]_872xu:/ $ ls -l /mnt/usb_storage/usb
-rw-rw-rw- root root 0 2014-09-09 11:35 testing
dmarkey said:
Hi all,
I'm just hacking at my rk3188 box, and trying to get XBMC to read my ext4 external hard drive.
However when the hard drive is mounted, XBMC only sees an empty directory!
Also, in the terminal, "su'ing" as an app user, the directory appears empty also.
This worked perfectly with android 4.2, 4.4 seems be more troublesome.
Code:
[email protected]_872xu:/ # ls -ailrt /mnt/usb_storage/usb/
3222 dr-xr-xr-x 3 media 1023 60 Sep 9 11:32 ..
10959 -rw-rw-rw- 1 root root 0 Sep 9 11:35 testing
8841 drwxrwxrwx 2 media root 60 Sep 9 14:18 .
[email protected]_872xu:/ # mount -t ext4 /dev/block/sda1 /mnt/usb_storage/usb
[email protected]_872xu:/ # ls -l /mnt/usb_storage/usb/backup/
-rwxrwxr-x 1 root root 2147483648 Sep 9 11:20 arch.img
drwxrwxrwx 2 root root 4096 Sep 7 17:30 init.d
[email protected]_872xu:/ # su - app_65
[email protected]_872xu:/ $ ls -l /mnt/usb_storage/usb/backup/
/mnt/usb_storage/usb/backup/: No such file or directory
1|[email protected]_872xu:/ $ ls -l /mnt/usb_storage/usb
-rw-rw-rw- root root 0 2014-09-09 11:35 testing
Click to expand...
Click to collapse
No ideas?

Android 6.0.1 SD card mounting and directory access driving me crazy

I've create a directory /storage/sdcard2 and mounted it as follows:
mkdir sdcard2
chmod 771 /storage/sdcard2
chgrp 1015 /storage/sdcard2
So it has looks like:
drwxrwx--x 3 root sdcard_rw 60 Feb 12 20:17 sdcard2
Now the external storage looks like:
drwxrwx--x 19 root sdcard_rw 32768 Dec 31 1969 DE52-F3E6
So they match exactly, but for some reason while most apps (non-root) can see and view /storage/DE52-F3E6 nothing but root apps can see /storage/sdcard2 (if I su* others can see it in a console but not access it). In Android (CM12) 5.1, this worked fine, in (CM13) 6.0.1 I'm going crazy. I thought it might be namespace separation in Super SU, but that does not appear to be the case it is as if there is another block that only allows root to see non-standard directories (or files) since creating a file in /storage has the exact same issue.
How do I fix this as it makes using 6.0.1 useless as I can not manually mount my secondary partition on the SD Sard and get access to the data on it (except as root).
su - u_10034
127|[email protected]:/storage # su - u0_a334
[email protected]:/storage $ ls -al
drwxr-xr-x 6 root root 140 Feb 12 20:06 .
drwxr-xr-x 28 root root 0 Feb 12 19:59 ..
drwxrwx--x 19 root sdcard_rw 32768 Dec 31 1969 DE52-F3E6
drwx--x--x 5 root sdcard_rw 4096 Dec 31 2014 emulated
drwxrwx--x 3 root sdcard_rw 60 Feb 12 20:17 sdcard2
drwxr-xr-x 2 root root 60 Aug 2 2015 self
[email protected]:/storage $
At a minimum I want to at be able to access the sdcard2 directory same as I can access DE52-F3E6 the permissions match, but the SE (ls -n) setting differ, but I can not find what setting I need to use there to allow the same access as DE52-F3E6 since DE52-F3E6 is a device and sdcard2 is a directory.
Thanks,
ERIC

[HELP] Unable to execute the ./simg2img binary

Hello.
I am using a Virtualbox with Ubuntu 16.04 as guest and Windows 10 as host.
I have also got the guest additions installed in Ubuntu. But the problem is that whenever i try to run the command "sudo ./simg2img system.img sys.raw" i get an error stating "sudo: unable to execute ./simg2img: No such file or directory"
I also have the simg2img binary in the same directory as my system.img sparse image is in and i have also given the binary executable permissions by typing this command and i was successful.Here is the output of the ls -l command of the directory in which the simg2img binary is in:-
Code:
[email protected]:/media/base$ sudo chmod +x simg2img
[email protected]:/media/base$ sudo ./simg2img system.img sys.raw
sudo: unable to execute ./simg2img: No such file or directory
[email protected]:/media/base$ ls -l
total 2712719
-rwxrwxrwx 1 root root 374272 Apr 23 2015 AndImgTool.exe
drwxrwxrwx 1 root root 8192 Sep 15 18:37 android-simg2img-master
-rwxrwxrwx 1 root root 137008 Dec 14 2015 APDB_MT6735_S01_L1.MP3_W15.47
-rwxrwxrwx 1 root root 3593 Sep 15 17:39 append2simg.c
-rwxrwxrwx 1 root root 9119 Sep 15 17:39 backed_block.c
-rwxrwxrwx 1 root root 2498 Sep 15 17:39 backed_block.h
drwxrwxrwx 1 root root 0 Sep 14 16:25 Binaries
drwxrwxrwx 1 root root 0 Sep 12 23:38 boot
-rwxrwxrwx 1 root root 7696384 Dec 14 2015 boot.img
-rwxrwxrwx 1 root root 8238962 Dec 14 2015 BPLGUInfoCustomAppSrcP_MT6735_S00_MOLY_LR9_W1444_MD_LWTG_MP_V26_P23_1_lwg_n
-rwxrwxrwx 1 root root 8388912 Dec 14 2015 cache.img
-rwxrwxrwx 1 root root 758 Sep 15 17:39 defs.h
-rwxrwxrwx 1 root root 4307 Sep 15 17:39 ext4_utils.h
-rwxrwxrwx 1 root root 31711 Sep 12 23:38 file_contexts
-rwxrwxrwx 1 root root 5485902 Sep 13 18:14 img2sdat.exe
-rwxrwxrwx 1 root root 862 Sep 13 18:21 img2sdat.pyc
-rwxrwxrwx 1 root root 284028 Sep 13 18:20 img2simg
-rwxrwxrwx 1 root root 2488 Sep 15 17:39 img2simg.c
drwxrwxrwx 1 root root 0 Sep 15 17:39 include
-rwxrwxrwx 1 root root 296420 Dec 14 2015 lk.bin
-rwxrwxrwx 1 root root 1647621 Dec 14 2015 logo.bin
-rwxrwxrwx 1 root root 514152 Sep 12 22:38 make_ext4fs
-rwxrwxrwx 1 root root 1775 Sep 15 17:39 Makefile
drwxrwxrwx 1 root root 0 Sep 12 23:25 META-INF
-rwxrwxrwx 1 root root 9373 Dec 14 2015 MT6753_Android_scatter.txt
drwxrwxrwx 1 root root 0 Sep 14 23:14 output
-rwxrwxrwx 1 root root 16994 Sep 15 17:39 output_file.c
-rwxrwxrwx 1 root root 1560 Sep 15 17:39 output_file.h
-rwxrwxrwx 1 root root 151192 Dec 14 2015 preloader_l5460.bin
-rwxrwxrwx 1 root root 780 Sep 12 22:43 README.md
-rwxrwxrwx 1 root root 8888320 Dec 14 2015 recovery.img
-rwxrwxrwx 1 root root 10392 Sep 12 22:39 rimg2sdat
-rwxrwxrwx 1 root root 3881 Sep 12 22:43 sdat2img.py
-rwxrwxrwx 1 root root 135168 Dec 14 2015 secro.img
-rwxrwxrwx 1 root root 278374 Sep 14 15:56 simg2img
-rwxrwxrwx 1 root root 1947 Sep 15 17:39 simg2img.c
-rwxrwxrwx 1 root root 2634 Sep 15 17:39 simg2simg.c
-rwxrwxrwx 1 root root 5212 Sep 15 17:39 simg_dump.py
-rwxrwxrwx 1 root root 8383 Sep 15 17:39 sparse.c
-rwxrwxrwx 1 root root 6038 Sep 15 17:39 sparse_crc32.c
-rwxrwxrwx 1 root root 857 Sep 15 17:39 sparse_crc32.h
-rwxrwxrwx 1 root root 1391 Sep 15 17:39 sparse_defs.h
-rwxrwxrwx 1 root root 997 Sep 15 17:39 sparse_err.c
-rwxrwxrwx 1 root root 916 Sep 15 17:39 sparse_file.h
-rwxrwxrwx 1 root root 2219 Sep 15 17:39 sparse_format.h
-rwxrwxrwx 1 root root 11352 Sep 15 17:39 sparse_read.c
drwxrwxrwx 1 root root 0 Sep 13 18:36 system_
-rwxrwxrwx 1 root root 2707273812 Dec 14 2015 system.img
-rwxrwxrwx 1 root root 60928 Dec 14 2015 trustzone.bin
-rwxrwxrwx 1 root root 27812432 Dec 14 2015 userdata.img
So can anyone please help me with this.I want to extract the system/ folder from the sparse sysem image but i am unable to do so in windows after having followed all the instructions carefully.
Many many thanks in advance.
You're trying to run 32-bit binary on a 64-bit system.
Follow this guide to solve ur problem :
http://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists

Categories

Resources