[Q] lsof for android or busybox - Galaxy S I9000 Q&A, Help & Troubleshooting

I'm experimenting with mounting a loopback image which contains some private files. I've been mounting and unmounting it using scripts executed via GScript.
Sometimes when I try to unmount the image, it gives me a failed error. I am assuming this is because a file is open by some process, but I can't figure out which one.
So finally to my question: does anybody know of an lsof busybox applet, a native lsof binary, or any application that can tell me what files are opened by which processes?

You can try such way
lsof | grep <your process name or folder name>
Click to expand...
Click to collapse
For me it's worked. I can see all open files from one mounted folder.

Related

[Q] Compiling kernel modules

Hi
I'm a new owner to a Galaxy tab 8.9 and trying to make it able to mount NFS exports.
So I've rooted the device, installed SuperUser and terminal emulator. Then I downloaded the kernel source tree from Samsung, I compiled the NFS module on my desktop computer moved it to /system/lib/modules on the tab. But it doesn't work, when I do 'insmod nfs.ko' it gives back 'insmod: init_module nfs.ko failed (No such file or directory)'
Is it possible at all to add modules to the standard kernel that comes with the device?
Is my device completely rooted because when I try 'adb root' I get 'adbd cannot run as root in production builds'
me too...
I just encountered the exact same problem on my LG Revolution, except I'm trying to load nfsd.ko for server support.
I know I built it correctly because I've already succeeded in getting tun.ko working properly...
Code:
root # /system/bin/insmod /system/lib/modules/nfsd.ko
insmod: init_module '/system/lib/modules/nfsd.ko' failed (No such file or directory)
root # ls /system/lib/modules
... nfsd.ko
Very odd...
When you do the insmod are you actually in the /system/lib/modules directory? If not, you have to use the full path to the module.
The message with "adb root" is normal even on a rooted device. If you can do "adb shell" followed by "su" you should be ok.
edit...
Now that I think of it...that message usually means the module file was found but a dependency wasn't.
gtj0 said:
Now that I think of it...that message usually means the module file was found but a dependency wasn't.
Click to expand...
Click to collapse
Yep that was my problem. My nfsd.ko needed dependencies that didn't exist...
To the OP: try to insmod the nfs.ko module again and then look at the output of dmesg. You should see messages complaining about the dependencies required by the nfs module.
Then you ought to be able to either remove the requirement for them from your module (my nfsd.ko wanted posix_acl support so I just got rid of that option and rebuilt the module) or if it's something you need/want you might be able to add support for whatever it is as another module...
Good luck and I hope I didn't intrude upon your thread too much
Thanks, I had indeed a dependency problem. Now I managed to load nfs.ko and sunrpc.ko and lockd.ko that were needed because of dependency.
Although I'm still having problems at mounting an nfs export. Previously, before kernel module problem was solved, I got the error message 'No such device' when I tried to mount, now I get 'Invalid argument' instead.
I've tried commands like
busybox mount -t nfs 192.168.1.100:/mnt/raid/media /sdcard/nfs
and
busybox mount -o nolock,ro,hard,intr,vers=3 -t nfs 192.168.1.100:/mnt/raid/media /sdcard/nfs
Any thoughts?
NFS Share - Invalid Argument
Marlin79 said:
........... now I get 'Invalid argument' instead.
I've tried commands like
busybox mount -t nfs 192.168.1.100:/mnt/raid/media /sdcard/nfs
and
busybox mount -o nolock,ro,hard,intr,vers=3 -t nfs 192.168.1.100:/mnt/raid/media /sdcard/nfs
Any thoughts?
Click to expand...
Click to collapse
Seems like an Old thread, and I would assume you've gotten this fixed already, but in case it ISN'T fixed...
>Double check your NFS config (/etc/exports file) and confirm that you are sharing:
* /exports/mnt/raid/media *
If you specified something else in your /etc/exports file, check to make sure your Hard drive (I assume /mnt/raid/media) is soft-linked to the share name you wanted to give it, or that at least the subfolders/files you want shared are softlinked to the /exports/share directory.
**e.g.**
# ln -s /exports/media/ /mnt/raid/media
-OR-
# ln -s /exports/media/shared_media_1.mp4 /mnt/raid/media/actual_file.mp4

Linux installer

Trying to get Ubuntu chroot up and running with Linux installer from the market.
Followed the quick start guide to a "t", only changes I made from the default settings were distribution and version. This resulted in a /data/local/mnt/Linux directory with the Ubuntu file structure inside and a Linux.loop file in the root of my internal storage.
The part that is confusing of how to mount. The last step in the guide is to press the button that creates the linuxchroot script; when I press the button out says it's creating the file but the file isn't created.
I'm attempting to use the following commands to mount manually:
Code: ---------# mount loop.img directory ---------If for some reason that doesn't work use losetup.
Code: ---------# losetup /dev/block/loop7 loop.img # mount -t auto /dev/block/loop7 directory
But not sure how to use them because there isn't a .img file, just the previously mentioned /data/local/mnt/Linux directory and the Linux.loop file.
Anyone? Thanks in advance
Sent from my DROID3 using Tapatalk 2
Q9Nap said:
Trying to get Ubuntu chroot up and running with Linux installer from the market.
Followed the quick start guide to a "t", only changes I made from the default settings were distribution and version. This resulted in a /data/local/mnt/Linux directory with the Ubuntu file structure inside and a Linux.loop file in the root of my internal storage.
The part that is confusing of how to mount. The last step in the guide is to press the button that creates the linuxchroot script; when I press the button out says it's creating the file but the file isn't created.
I'm attempting to use the following commands to mount manually:
Code: ---------# mount loop.img directory ---------If for some reason that doesn't work use losetup.
Code: ---------# losetup /dev/block/loop7 loop.img # mount -t auto /dev/block/loop7 directory
But not sure how to use them because there isn't a .img file, just the previously mentioned /data/local/mnt/Linux directory and the Linux.loop file.
Anyone? Thanks in advance
Sent from my DROID3 using Tapatalk 2
Click to expand...
Click to collapse
If you see the directory structure in /data/local/mnt/Linux then it's already mounted.
Code:
chroot /data/local/mnt/Linux /bin/bash
Should work, but I have no idea why the script isn't being created.
To manually mount.
Code:
mount /sdcard/Linux.loop /data/local/mnt/Linux
and un-mount after exiting the chroot environment by a ctrl-d or typing "exit".
Code:
umount /data/local/mnt/Linux
if un-mounting causes a device is busy error, un-mount the lazy way
Code:
umount -l /data/local/mnt/Linux
Doing any of this manually might cause some errors because the script isn't doing whatever it is that it does.
Ok so I finally got Ubuntu up and running with vnc server and all, & realized there's no way to input text.
Anyone know if there's any possible way to be able to use the d3 keyboard while in chroot (other than in terminal of course) ?
*edit*
Seems to be working now...

Linking from /mnt/sdcard to /mnt/sdcard-ext - automatization

Found the solution, it's in the fifth post
Hey, first of all I'm Linux and Android newbie, so sorry if my question reveals it a bit
As my Internal Storage a.k.a. /mnt/sdcard is getting full and I hate to be reminded of it by notification I can't get rid of, I decided to put some effort into moving the largest files to the SD card. I have a 64GB SD an there still are several free gigs So after some googling I found out a way to link it. It works like this:
Code:
mount -o bind /origdir /newdir
where both /origdir and /newdir must exist, in my case as an example:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
where /mnt/sdcard-ext/sd/DictionariesNGHS is the data containing folder and /mnt/sdcard/sd/DictionariesNGHS is an empty folder for linking. It works like a charm, tried with several applications including some off-line navigations. The downside is that such links are forgotten after a reboot.
I didn't find out how to automatize that. I tried putting the line from second code to the end of /system/etc/init.goldfish.sh (I run Eclipse ICS 1.2) and it didn't get linked after a reboot (but works OK after mounting manually in terminal) - I suspect it runs before sdcard-ext is mounted. Any thoughts on how to make it run after reboot? Or maybe of an app that does this for me?
EDIT:
Put my links into /data/data/init.sh
Tried several not working apps:
ScriptMe by gilsken says Script run mount: No such file or directory
Script Manager - SManager by devworm says
Code:
exec sh '/data/data/init.sh'
[email protected]_maserati:/ # exec sh '/data/data/init.sh'
mount: No such file or directory
while interestingly when I write it by myself in its built-in console it works...
App that works: Tasker by Crafty Apps
I can have scripts run on boot and it works, but I can add only one line at time (or at least it's the only option I found) which is still kinda inconvenient plus it runs all the time consuming system resources. I'd like some less robust solution, preferably executed after boot and exiting after mounts proceed. Any ideas?
EDIT 2:
My "workaround" in Tasker: Profiles -> New -> Event -> System -> Device Boot -> OK -> New Task -> OK -> + -> Script -> Run Shell -> Command: /data/data/init.sh -> OK
Surprisingly enough it doesn't even need root permission...
In init.sh I have several lines with different mounts, it all works well. I'm still looking for less robust solution than Tasker is, or maybe a way to kill it after the init.sh is processed?
hey
can you please post the content of youre
Code:
/data/data/init.sh
---------- Post added at 04:35 PM ---------- Previous post was at 03:50 PM ----------
youre problem is, at the runtime form the mount command, the mount is not in youre path.
can you add to you script the command
Code:
env
and post the output?
I tried it with a file containing only this line:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
OK, after running it by SManager it looks like giving errors, but the folder gets mounted.
Also it seems apps get access to /mnt/sdcard faster after reboot then to /data/data (I wonder why...?) so I moved the script there.
Here you have the output with env at the end of init.sh, run by SManager as root (mounted OK):
Code:
exec sh '/mnt/sdcard/init.sh'
[email protected]_maserati:/ # exec sh '/mnt/sdcard/init.sh'
mount: No such file or directory
_=/system/xbin/env
ANDROID_BOOTLOGO=1
ANDROID_PROPERTY_WORKSPACE=8,69632
LOOP_MOUNTPOINT=/mnt/obb
SM_API=15
RANDOM=26725
ANDROID_ASSETS=/system/app
USER=root
EXTERNAL_STORAGE=/mnt/sdcard
ANDROID_DATA=/data
PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
SM_LAUNCHER=MANUAL
TERM=vt100
PS1=$(precmd)[email protected]$HOSTNAME:${PWD:-?} #
SM_VERSION=2.5.3.1
SM_GUIFD=3
LD_LIBRARY_PATH=/vendor/lib:/system/lib
SECONDARY_STORAGE=/mnt/sdcard-ext
SM_ALIAS=init.sh
ASEC_MOUNTPOINT=/mnt/asec
SM_HOME=/mnt/sdcard
HOSTNAME=cdma_maserati
HOME=/
SM_VERSIONCODE=77
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar:/system/framework/kafdex.jar:/system/framework/com.motorola.orange.simauth.jar
ANDROID_ROOT=/system
SHELL=/system/bin/sh
MKSH=/system/bin/sh
ANDROID_SOCKET_zygote=9
So it works after all with the SManager as I intended, I just don't understand why it gives that error when everything actually is OK...
Any ideas on how to make it run automatically after every mount of sdcard-ext instead of on reboot? Because when I connect it to the computer as Mass Storage, the directory mounts disappear and I have to run the script manually...
LuH said:
I tried it with a file containing only this line:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
...
Any ideas on how to make it run automatically after every mount of sdcard-ext instead of on reboot? Because when I connect it to the computer as Mass Storage, the directory mounts disappear and I have to run the script manually...
Click to expand...
Click to collapse
for the first, replace the mount with this:
Code:
/system/bin/mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
Found out that the "mount: No such file or directory" error was due to typo in folder path
So to wrap it up:
You need to be rooted first.
Create your init.sh script file, works fine when put to /mnt/sdcard/
Example file (also attached so you have a sample in UNIX formatting - don't open with Notepad under Windows, better edit it in your phone):
Code:
# mount -o bind /sourcedir /fakedir - both sourcedir and fakedir MUST exist!
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
mount -o bind /mnt/sdcard-ext/sd/Android/obb /mnt/sdcard/Android/obb
Note: you should use a UNIX formatting of the file, not Windows (I'm not sure if it's necessary though).
As hinted in the beginning note, sourcedir and fakedir must exist and after successful mount the fakedir folder will appear to have the contents of the sourcedir folder. Any fakedir's contents are ignored ("disappear") after mount and reappear only after it gets unmounted.
It gets automatically unmounted after unmounting of either fakedir's or sourcedir's media (typically when connecting phone to a computer as mass storage) and I haven't found any workaround for running the script after remounting of media... Any suggestions?
Install SManager (free version here).
In SManager navigate to your script file, tap it and select Script/Executable and tap Su and Boot icons (see attached screenshot).
Done, your folders get mounted on reboot

[APP] DropBear Server II // ssh/scp (root only)

I wanted to enable SCP and SSH using DropBear II ... for some reason DropBear Server II doesn't install scp & ssh binaries, you can get them from github and symlink it into system. Here's what I did...
DropBear archive (1M): https://www.dropbox.com/s/h2guipuvdltiden/dropbearii.zip
Feel free to mirror that if you want.
These directions allow you to ssh into the system as root, be very careful. I recommend not leaving the service running if you are not using it.
I take no responsibility if you brick your unit while mucking around as root.
Back Up
Download dropbearii.zip and unzip on your local file system.
From your local filesystem install the APK and push scp & ssh to tmp.
Code:
adb install DropBearServer2.1.apk
adb push scp /data/local/tmp/scp
adb push ssh /data/local/tmp/ssh
From the OUYA GUI install the DropBearServerII service... Select Make -> Software -> DropBearServer II -> Install
Shell into your OUYA and make /system writable.
Code:
adb shell
su
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
Move scp & ssh into DropBear II directory
Code:
mv /data/local/tmp/scp /data/data/me.shkschneider.dropbearserver2/app_data/
mv /data/local/tmp/ssh /data/data/me.shkschneider.dropbearserver2/app_data/
Change the permissions
Code:
chmod 6555 /data/data/me.shkschneider.dropbearserver2/app_data/scp
chmod 6555 /data/data/me.shkschneider.dropbearserver2/app_data/ssh
Create the symlinks
Code:
cd /system/bin/
ln -s /data/data/me.shkschneider.dropbearserver2/app_data/scp ./scp
ln -s /data/data/me.shkschneider.dropbearserver2/app_data/ssh ./ssh
Change /system back to read-only (optional) and exit.
Code:
mount -o ro,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
exit
exit
Reboot the OUYA (optional)
Code:
adb reboot
Notes/testing
Windows users can use Putty to ssh & scp get them here.
To ssh into the system:
Code:
ssh [email protected]_ADDRESS
To scp a file to the sdcard:
Code:
scp ./some_file [email protected]_ADDRESS:/sdcard/
To get to settings push the U circle button one time.
If you turn on "Start on boot" in the settings menu and reboot, the service will be turned off. Though it will be left on in the standard standby mode.
I recommend using pubkey rather than password. Basically generate a public key and push it into /sdcard/ then install it from the DropBear II app.
Unix Hosts can do:
Code:
ssh-keygen -t rsa
Windows using PuttySSH follow these directions, I haven't tested them though.
If you don't want to be bothered with pubkey, please change the default password it is set to 42.
If you already know about pubkey, you can cat them into: /data/data/me.shkschneider.dropbearserver2/app_data/authorized_keys
Unchecking "Allow Password" doesn't work properly.
Why would I want to do this? I didn't really like the Wireless ADB disappearing after the OTA upgrade, this may be less annoying if the next OTA doesn't nuke it.
I'm getting an error that busybox is not installed when trying to start the service. Is there anything special you had to do with busybox to get this to run? I installed it via the apk.
Edit: Nevermind. I didn't realize the busybox apk was an installer and I didn't find the icon when I looked. Just checked again and found the busybox installer icon and did a smart install. Dropbear ssh is running now.
I ran it manually with
Code:
dropbear -E -s -P /data/dropbear/dropbear.pid -r /data/dropbear/dropbear_rsa_host_key -d /data/dropbear/dropbear_dss_host_key
and it looks ok when idling but when connection it gives me
Aiee, segfault! You should probably report this as a bug to the developer
Click to expand...
Click to collapse
This could be CM10.1 environment issues (libc). The built-in SSHd doesn't work properly as well. Some binaries give strange errors when executed with SSHd (like sqlite3).
I can't install the DropBearServer II from the Make option, comes up with "operation failed". Tried to make the system rw to see if that might have been the problem but still no luck. Anyone else had that problem?
andlid said:
I can't install the DropBearServer II from the Make option, comes up with "operation failed". Tried to make the system rw to see if that might have been the problem but still no luck. Anyone else had that problem?
Click to expand...
Click to collapse
I installed it via adb.
For others I was able to install using IncognitoMan's -=StockPlus=- ROM -- http://forum.xda-developers.com/showthread.php?t=2347214
You may need busybox installed, I'm not 100% sure, I haven't tried without busybox.
SSH command line on android
The link is broken
Could someone please reupload this? would be awesome
Thank you so much
BIade said:
Could someone please reupload this? would be awesome
Thank you so much
Click to expand...
Click to collapse
bump - upload again please
You can also get static binaries from dropbear or ssh server apks in playstore by simply unpacking the apk.

How To Guide How to make files in /system writable

How to make files in /system writable
In Android 12 and newer /system is mounted read-only can not be remounted read-write anymore.
Sometimes it's useful that one or more files in /system are writable (for example for develop tasks or for testing)
This can be implemented using Magisk (see How to change files in the directory /system for more details)
Example :
Make the file /system/etc/vimrc writable
Note:
In Android 12 /etc is a symbolic link to /system/etc.
Open a (adb) shell as user root and do
Bash:
# create a dummy Magisk module
#
mkdir -p /data/adb/modules/writable_system/system/etc
# copy the file that should be writable to the Magisk module directory
#
cp /system/etc/vimrc /data/adb/modules/writable_system/system/etc/
# make the file in the Magisk module directory writable
#
chmod +w /data/adb/modules/writable_system/system/etc/vimrc
Now reboot the phone.
After the reboot the file /system/etc/vimrc is writable by the user root, Example:
Code:
ASUS_I006D:/ # id
uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
ASUS_I006D:/ #
ASUS_I006D:/ # ls -l /system/etc/vimrc
-rw-r--r-- 0 root root 3350 2022-11-04 11:36 /system/etc/vimrc
ASUS_I006D:/ # tail -2 /system/etc/vimrc
\ | wincmd p | diffthis
endif
ASUS_I006D:/ #
ASUS_I006D:/ # echo '" Test Comment' >>/system/etc/vimrc
ASUS_I006D:/ #
ASUS_I006D:/ # tail -2 /system/etc/vimrc
endif
" Test Comment
ASUS_I006D:/ #
Only the user root can access the directory /data/adb. Therefor the files configured using this approach are only writable by the user root.
To make a file in /system writable for non-root users use this method:
Open a (adb) shell and execute as user shell:
Bash:
#
# create a directory that is writable for the user shell
#
mkdir /data/local/tmp/writable_system
mkdir /data/local/tmp/writable_system/etc
#
# copy the file that should be writable to that directory
#
cp /system/etc/vimrc /data/local/tmp/writable_system/etc
The next commands must be executed as user root:
Bash:
# create dummy Magisk module
#
mkdir -p /data/adb/modules/writable_system/system/etc
#
# create a symbolic link to the file in the writable directory in the directory with the dummy Magisk module
#
ln -s /data/local/tmp/writable_system/etc/vimrc /data/adb/modules/writable_system/system/etc
Now reboot the phone.
After the reboot the file /system/etc/vimrc is writable by the user shell, Example:
Code:
ASUS_I006D:/ $ id
uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0
ASUS_I006D:/ $
ASUS_I006D:/ $ tail -2 /system/etc/vimrc
\ | wincmd p | diffthis
endif
ASUS_I006D:/ $
ASUS_I006D:/ $ echo '" Test Comment' >>/system/etc/vimrc
ASUS_I006D:/ $
ASUS_I006D:/ $ tail -2 /system/etc/vimrc
endif
" Test Comment
ASUS_I006D:/ $
Important:
The writable directory can also be in a sub directory in /sdcard. But be aware that /sdcard is mounted late in the boot process so it might be that the overwritten file in /system will be used by the OS when the bind mount points to a non-existent file if using a sub directory in /sdcard.
The changes to the file done using these methods are "persistent" as long as Magisk is installed in the boot partition.
To restore the file with the original contents after each new reboot of the phone without removing the writable config open a (adb) shell as user root and execute:
Bash:
#
# restore the file /data/adb/modules/writable_system/system/etc/vimrc from the original file /system/etc/vimrc
#
# this must be done before Magisk creates the bind mounts
#
echo "cp /system/etc/vimrc /data/adb/modules/writable_system/system/etc/vimrc">/data/adb/post-fs-data.d/restore_vimrc.sh
chmod 755 /data/adb/post-fs-data.d/restore_vimrc.sh
Now the file in the dummy Magisk module will be restored with the contents of the original file from /system after each reboot
To temporary access the original file from /system just stop the Magisk daemon, Example:
Code:
ASUS_I006D:/ # echo '"Test Test' >>/etc/vimrc
ASUS_I006D:/ #
ASUS_I006D:/ # tail -1 /etc/vimrc
"Test Test
ASUS_I006D:/ #
ASUS_I006D:/ # id
uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
ASUS_I006D:/ #
ASUS_I006D:/ # magisk --stop
ASUS_I006D:/ #
ASUS_I006D:/ # id
uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
ASUS_I006D:/ #
ASUS_I006D:/ # tail -1 /etc/vimrc
endif
ASUS_I006D:/ #
Note
Stopping the Magisk daemon will disable all bind mounts done by Magisk.
Restarting the Magisk daemon will not re-create the bind mount - to re-activate the bind mount for the writable file after stopping the Magisk daemon the phone must be rebooted.
To make more then one file writable in a sub directory in /system you can also replace the complete folder using these commands as user root:
Bash:
#
# make all files in /system/etc writable by the user root
#
mkdir -p /data/adb/modules/writable_system/system/etc/
cd /system/etc
find . | cpio -pdum /data/adb/modules/writable_system/system/etc/
touch /data/adb/modules/writable_system/system/etc/.replace
Now Magisk will replace the directory /system/etc with the directory /data/adb/modules/writable_system/system/etc after the next reboot
Notes
You should test these commands with a not important file like /system/etc/vimrc before changing important files.
It is NOT recommended to use this approach on productive phones.
See How to change any file or directory using Magisk for another approach to change files on read-only mounted filesystems.
Trouble Shooting
As always: If something does not work like expected check the Magisk log file /cache/magisk.log and also check the infos in this post.
Does this method require root on device?
FormulaSea said:
Does this method require root on device?
Click to expand...
Click to collapse
yes
Is there any method don't require root?
This looks interesting. Are you using OverlayFS for this? Looks like you did quite the research on this
Read-only is boring even as root. It's time for some RW baby
FormulaSea said:
Does this method require root on device?
Click to expand...
Click to collapse
I don't know a method to do this without root access.
But you can disable the root access in Magisk after implementing the changes . You could even uninstall tne Magisk app afterwards (but not the Magisk part from the boot partition)
regards
Bernd
lebigmac said:
This looks interesting. Are you using OverlayFS for this? Looks like you did quite the research on this
Read-only is boring even as root. It's time for some RW baby
Click to expand...
Click to collapse
I don't know what exactly you mean by "OverlayFS" - I use MagiskModules to modify files in /system and as far as I know Magisk used bind mounts to implement it.
>>Read-only is boring even as root.
Correct, but if you made the changes directly in /system, they would not survive the next OS upgrade.
One of the great advantages of this feature of Magisk is that it survives an OS upgrade - so as long as the change is compatible with the installed OS version, it only needs to be done once.
regards
Bernd
Thanks it worked on the audio folders on my 7t pro but didn't work on the boot animation folder. Both folders appear in the adb though with there files. Let me know op if you figure out how to do the boot animation folder it's moved to /my_product/ instead of /system/ I see that the my product folder and boot animation appear in the adb modules like the audio folder does and I swapped files the same way as with my audio modding but the changes for boot didn't take effect.
cbomb1337 said:
Thanks it worked on the audio folders on my 7t pro but didn't work on the boot animation folder. Both folders appear in the adb though with there files. Let me know op if you figure out how to do the boot animation folder it's moved to /my_product/ instead of /system/ I see that the my product folder and boot animation appear in the adb modules like the audio folder does and I swapped files the same way as with my audio modding but the changes for boot didn't take effect.
Click to expand...
Click to collapse
/my_product is not in the list of folders supported by Magisk so that may not work
Please post the output of these commands (executed as root user):
df -h
mount
ls -ald /*
ls -lZd /my_product
and a
ls -ldZ $( find /data/adb/modules/ )
and
cat /cache/magisk.log
(or attach the log file to the post if too big)
regards
Bernd
Here is this the correct log file. Thank you for responding to me.
cbomb1337 said:
Here is this the correct log file. Thank you for responding to me.
Click to expand...
Click to collapse
can you also post the output of the OS commands listed?
I Don't know how.
It didn't let me add the log here. Sorry that's it's cut and paste I tried a few termux commands to save a log but the were blank. I don't understand how to do it right.
Edit here I managed to upload the log to drive
https://drive.google.com/uc?id=1uWurf_462b5uLC_D21SFcgLcBWiXQZOn&export=download
bnsmb said:
can you also post the output of the OS commands listed?
Click to expand...
Click to collapse
Linefeeds are missing in that file so it's very hard to interpret the file contents correct
Can you do in a adb shell on the phone:
Bash:
(
set -x
set -v
su -
echo
df -h
echo
mount
echo
ls -ald /*
echo
ls -lZd /my_product
echo
ls -ldZ $( find /data/adb/modules/ )
echo
) > /sdcard/Download/oscmds.log 2>&1
then
Bash:
gzip /sdcard/Download/oscmds.log
and post / upload the file
/sdcard/Download/oscmds.log.gz
regards
Bernd
and
Here is the gzip I wasn't sure what was going on after entering that first command the termux was frozen for a few minutes. Also With the folders in the module folder and them being a copy of the original folder is it ok to delete them as a whole folder to remove the rw and revert it of needed. I tried it and didn't see any issues doing it but wanted to know if it reverted it properly and does deleting the module folders make me lose anything original that was in it or is my stock stuff safe because it's through magisk.
cbomb1337 said:
Here is the gzip I wasn't sure what was going on after entering that first command the termux was frozen for a few minutes. Also With the folders in the module folder and them being a copy of the original folder is it ok to delete them as a whole folder to remove the rw and revert it of needed. I tried it and didn't see any issues doing it but wanted to know if it reverted it properly and does deleting the module folders make me lose anything original that was in it or is my stock stuff safe because it's through magisk.
Click to expand...
Click to collapse
Looks like /my_product is a directory in the root filesystem but on the other hand there is a mount point called /mnt/vendor/my_product so I'm not sure about that.
If /my_product is really only a separate directory in the root filesystem the only method to change it is to manipulate the ramdisk used for booting the phone (only if the phone is using a ramdisk, of course).
Can you check if there are other directories called my_product:
find / -type d -name my_product 2>/dev/null
And, if there are any, compare the files in that directory with the files in the directory /my_product?
regards
Bernd
The only folder that has the same boot animation files is the /dev/ ones and the mnt one like you said.
It's all good if it can't be done i just found a magisk module before which works for flashing my boot animation
cbomb1337 said:
The only folder that has the same boot animation files is the /dev/ ones and the mnt one like you said.
Click to expand...
Click to collapse
Then it can't be done using the standard Magisk feature for making r/o mounted filesystems read-write.
cbomb1337 said:
It's all good if it can't be done i just found a magisk module before which works for flashing my boot animation
Click to expand...
Click to collapse
OK, do you have the URL?
And you could just check the contents of the zip file with the Magisk Module on how it's implemented
regards
Bernd
bnsmb said:
Then it can't be done using the standard Magisk feature for making r/o mounted filesystems read-write.
OK, do you have the URL?
And you could just check the contents of the zip file with the Magisk Module on how it's implemented
regards
Bernd
Click to expand...
Click to collapse
I read the module it mentions binding. I don't understand none of it :/ I upload the module here and removed the boot animation to make it small.
cbomb1337 said:
I read the module it mentions binding. I don't understand none of it :/ I upload the module here and removed the boot animation to make it small.
Click to expand...
Click to collapse
Cool -- that's the solution I also found in the meantime (and successfully tested it on my Zenfone 8)
In principle the module does for the bootanimation file what Magisk does if you replace some directories or files in /system
I will write a general HowTo how that works today or in the next days
regards
Bernd

Categories

Resources