How do I modify a file under /vendor/etc? (Mount System RW) - Google Pixel 2 Questions & Answers

I am trying to modify /vendor/etc/audio_policy_configuration.xml for some personal tests. I am rooted with Magisk v14.4 and have Snoke R11 kernel.
I have tried:
FX App (with root module) and mounting various folders RW
Root Browser app
"mount -o rw,remount /system" in ADB then modifying the file with an app on the phone
ADB push the file in TWRP with system mounted (adb pull the file after shows my modifications)
But, every time I reboot to the OS, the file has reverted and my changes are not present. I can successfully modify the build.prop however...and if I reboot to the bootloader after pushing the new file with TWRP, then boot into TWRP and pull the file, I can still see the changes. But the changes get wiped on boot of the OS.

I have a similar problem (I want to update the hosts file that is located in the /vendor/etc partition).
I don't know why you mount the /system partition in RW while you need to access the /vendor partition...

The whole point of Magisk is that you can do these things without modifying your /system/ or /vendor/ partitions, just create a Magisk Module with your modifications.

https://forum.xda-developers.com/showpost.php?p=74843454&postcount=850

Related

Can't manage to modify the /system folder

I've been trying for a couple of days now to try and modify the /system folder because I want to edit the host file and delete standard .apk's. However I just can't get it to work and I don't understand why.
I got a rooted 2.2 legend with modaco stock htc sense rom.
Things I tried:
Root explorer: For some reason I can't write files to the folder. It always says there is not enough free space while there is something like 6mb available. Also, deleting files doesn't actually seem to work. Root exploreres says the files are deleted but after a reboot they are there again!
Also root explorer makes my phone reboot.
ADB: Basically the same thing. Also I don't get adb to work when i'm in recovery mode (red traingle screen, I used to have clockwork but even after trying to reflash the clockwork recovery that just doesn't show up anymore and gone fubar out of the blue....) and want to enter the /system folder.
Terminal app: Same thing as above.
All 3 make my phone reboot.
What am I doing wrong?
I don't use the same phone as you, but I think that /system is usually mounted as read only (ro). Some file managers can mount /system as read/write (rw). Or I think you can chmod /system to 777 in your terminal as su with the command chmod 777 /system. Also I think CWM has an option to mount /system as rw, but I may be wrong. If you chmod, remember to set it back. You'll need to know shell commands and how to read permissions from an ls -a -l command and reset them. Hope this helps.
Sent from my SAMSUNG-SGH-I897 using XDA App

[Q]How to flash broadcom?

Hi,
i installed Shadow Hawk, but Wifi doesn´t work. It´s because of the Hyperion Kernel. I just don´t know how to "replace the broadcom module inside /system/etc/lib/modules". Because i used HTCDev(il) to unlock, i flash boot.img with fastboot. But how do i replace the broadcom module?
Please help!
Given your handset is S-OFF, either,
- Hard way :
Use android SDK adb to mount system RW and push module file :
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mmcblk0p25 /system
adb pull c:\bcm4329.ko /system/lib/modules/bcm4329.ko
- Easy way :
Just use ES file explorer, enable root R/W mode and copy/paste bcm4329.ko into /system/lib/modules
And then reboot.
dmfr said:
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mmcblk0p25 /system
adb pull c:\bcm4329.ko /system/lib/modules/bcm4329.ko
And then reboot.
Click to expand...
Click to collapse
If you use adb, those are not the commands. Should be:
adb remount
adb push :\bcm4329.ko /system/lib/modules/bcm4329.ko
In your first line you were trying to mount a yaffs2 filesystem, when it's probably a ext4 one. The "remount" option will work regardless of the fs.
Ths second line is fairly obvious, you want to push the file to the rom, not pull it from there.
Also, if you S-ON and flashed the rom, the broadcom module was flashed, it's just boot.img that gets left out. This means that when you manualy flash boot.img with fastboot, you don't need to update anything else.
So: Check in system settings if you actually flashed the kernel. It must say "Hyperion V2.XXX", or whatever version was included. If it is, wifi must work, if not, you messed something up on the fastboot flash procedure.
Cheers
will try later, thank you.
ICS Quattro Rom worked including Wifi..
update:
working now.
"Please follow these steps in the same order (I'm shouting) :
1. Boot into recovery
2. Format System (not wipe option but format option !!!)
3. Format Data
4. Format Cache then Format Boot
5. Wipe Data/Factory reset (1st option in wipe/format menu)
6. Wipe Dalvik Cache
Next if you have some wiping utility like Full Wipe 1.5 Ext4 for Saga.zip...run that by selecting install zip from sd card and installing the zip...
7. Now install zip from sd card and flash the rom
8. If any kernel flash it as well
9. Now reboot (Note don't flash any tweaks like transparent notification except gapps if required)
10. Now setup your phone
11. Reboot into recovery
12. Now go into advanced fix permissions and then any tweaks you want (Note whether mentioned or not always wipe Dalvik Cache before installing tweak zip)
13. Voila everything would work perfect 100%.... "
did follow these instructions.
flashed boot.img
having a fast and stable rom now hopefully. ICS wasnt stable enough. especially browser.

Cannot remount /system partition even when rooted (Sony xperia M2)

I have a Sony xperia M2 D2303 with kitkat 4.4.4 and compilation number 18.3.1.C.1.17.
I have successfully rooted it using KingRoot v4.9.5.
Also I have checked that system is rooted using tools such as root checker and it says rooted.
Now, I am trying to remount /system partition as RW but without succcess.
I have googled and tried several solutions posted here but nothing works for me.
Access to /sys/kernel/security/sony_ric and try to disable sony ric security using:
problem here is that sony_ric folder is empty, I mean, there is no "enable" file and I cannot create it as partition is RO (read-only).
Using ES file explorer or other file explorers as root I have tried to remount partition as RW but it fails.
Code:
echo 0 > enable
Using ROM Toolbox pro, and then from terminal emulator I have tried some commands:
Code:
su
mount -o remount,rw /system
fails.
Code:
su
system/bin/mount -o remount,rw /system
also fails.
Code:
adb shell
su
mount -o rw,remount /system
also fails...
I have tried to install busybox but it fails as well.
I have tried the method explained here but when executing the command:
sh /sdcard/mrw/root.sh
some errors appear as script tries to do things in /system so since it is read-only (not rw) it fails.
Also I have tried the method using SuperSu-me explained here but without success. It completes ok but then SuperSu is executed automatically. SuperSu says to update binaries so I update binaries, then another screen comes saying that another root app was detected, so I press the button to uninstall it and continue installing SuperSu. SuperSu says "Installing ........" and then it crashes, that is, it appears a screen with two buttons, "How to update" and "Reboot". Kingroot, purify apps continued installed and working, and I cannot replace them with SuperSu.
So at this point I have no idea what to do...
My conclusion is that all these tools need to make changes to / and /system but since I have these two partitions set to read-only (cannot make them rw) then all these tools fail. So I think the main cause is that I have / and /system readonly.
Any help will be highly appreciated.
Please, help!

[GUIDE] How to edit fstab.qcom if you don't have permission (or any other file)

I have some troubles with editing fstab.qcom from forceencrypt to encryptable, because system says that editing of this file is denied.
So, how to edit, then?
1. Turn off the phone
2. Boot into TWRP recovery
3. Mount System.
4. On PC ADB type
Code:
adb pull /vendor/etc/fstab.qcom
5. You will have fstab.qcom file in adb folder
6. Edit something in this file to whatever you want - like forceencrypt to encryptable. Save it.
7. Push the fstab.qcom into mobile by typing this
Code:
adb push fstab.qcom /vendor/etc
8.Voila, you have rewrited fstab.qcom file!
9. Now, you can reboot the phone.
For me it worked, I hope it helps to someone.
ondraczsk said:
I have some troubles with editing fstab.qcom from forceencrypt to encryptable, because system says that editing of this file is denied.
So, how to edit, then?
1. Turn off the phone
2. Boot into TWRP recovery
3. Mount System.
4. On PC ADB type
Code:
adb pull /vendor/etc/fstab.qcom
5. You will have fstab.qcom file in adb folder
6. Edit something in this file to whatever you want - like forceencrypt to encryptable. Save it.
7. Push the fstab.qcom into mobile by typing this
Code:
adb push fstab.qcom /vendor/etc
8.Voila, you have rewrited fstab.qcom file!
9. Now, you can reboot the phone.
For me it worked, I hope it helps to someone.
Click to expand...
Click to collapse
I have rooted NSTV device with Android11, when I connect my external HDD (ext4 formatted) to it, the device notify me the HHD not supported.
I can mount the HDD successfully:
Code:
mount -w -t ext4 UUID=89087942-e2b5-4f4a-99d7-9818559c6844 /mnt/media_rw
The root privileged file manager apps can read & write to HDD (Root-Explorer or Solid-Explorer)
But I can't open my movies through the VLC, MxPlayer... apps (logcat is: Access denied), also I tried to 'chown & chmod' but I'm not success.
Can you help me to solve my problem please?!
@mrhamed I had a similar issue in android 11 smartphone. My sd card had ext4 fs and bind mounts to it in /sdcard were 'invisible' to apps, due to inaccessible selinux context and permission errors. From this stackexchange post, I did the following to access its files from apps.
You need bindfs cli program. I use termux, so installing bindfs is very easy. If you can't get termux on your tv, cross-compile bindfs for your tv or compile it statically from source or search for pre-compiled binaries.
Mount your external HDD as you did, but use a different directory other than /mnt/media_rw since android mounts external storage devices there, to avoid possible data loss:
Code:
# mkdir /drive
# mount -w -t ext4 UUID=89087942-e2b5-4f4a-99d7-9818559c6844 /drive
Create any directory where you will bind-mount drive in /storage/emulated/0/:
Code:
$ mkdir /storage/emulated/0/HDD
The owner and group of files when bind-mounting must be root (0) and everybody (was 9997 in my case). Now bind-mount /drive to /mnt/runtime/full/emulated/0/HDD:
Code:
# bindfs --ctime-from-mtime --xattr-none --direct-io --resolve-symlinks --create-for-group=10261 --create-for-user=10261 --create-with-perms=u+rwD:go+rD:fugo-X --force-user=0 --force-group=9997 --chmod-ignore --chgrp-ignore --chown-ignore --perms=ug+rwD:fugo-X:o-rwD /drive /mnt/runtime/full/emulated/0/HDD
Bindfs options don't have to be the same though. 10261 can be any uid. The android media provider module sets up the rest of the emulated storage views like read and write for you. That's all. Write speed to HDD folder won't be the same as writing directly to /drive; was slower in my case.
Apps that use the android media API to know which media files are in your storage will not detect the files in HDD until a media scan is done. Again I used termux for the media scan: termux-media-scan, but this process of media scanning and extraction turned out to be too battery intensive because I have very many songs, so I stopped scanning. I searched for apps that scan for media themselves like MX Player or VLC.

[Q] How to edit build prop file using adb ?

I tried to pull build.prop file using adb then edit it , but when I try to push file it say that file can not be accessed remotely
I tried to use build prop editor but it doesn't run on device, if anyone have idea about alternatives?
Note that I am rooted and using adb insecure
Android's partition /system must get mounted as RW, to save a modified build.prop file ( what must be UNIX-style formatted ).
If its a modern/recent device, chances you cannot make the system partition R/W and therefore caznnhot write a new build.prop file. To make changes to system files you will have to use magisk. Or build a complete ROM from source...
I remounted system as rw and it worked
.
need to be on
unlocked bootloader
dmverity disabled (make sure to disable on the ACTIVE partition remember some have multiple partitions such as A/B )
also using a "VNDKLITE" system image helps with newer releases,
and of course system needs to be rooted
and then finally from within the android OS mount the partition with read/write permissions
I tried running adb as root then I remounted system as rw and it worked

Categories

Resources