How can I get more information about my loadable module and why it fails? - Galaxy Note 3 Developer Discussion [Developers Onl

I created two test loadable modules in my build environment for a SM-N900P with Snapdragon 8974 chip. I have used some previous images to successfully flash my phone; so I know my images work. When I try to activate the modules with insmod, I can activate one my modules and I can activate the scsi_wait_... module. But I can not load the last one. I get the following error message:
Code:
insmod /lib/modules/tbt.ko
insmod: init_module '/lib/modules/tbt.ko' failed (Device or resource busy)
How can I get more information about this error please? Is there a log or a specific level I need to look into? I just do not see anything in logcat. What I did way to issue logcat -d > logfile.txt while my phone was connected. I opened the file but I do not see any reference to a loadable module failure. I also found the /d directory and checked some of the files, but again I do know what each of these files contain. I can guess from the name in some cases, but I like to be sure. Also I did not find anything which seemed to provide more information about why my device driver is failing. I really appreciate any help in this area.

Related

tun.ko for NEXUS ONE available?

as I am behind the GFW of CN I am eager to get openvpn to work (trying with TunnelDroid, with vpn binaries of WITOPIA...
unfortunately i can't get the connection to work, and apparently it is because of the lacking tun.ko
I took the only tun.ko I can find online (vpn connnections, for DROID...), but apparently the current Nexus One kernel does not support.
Does anybody have a tun.ko file that works on Nexus One?
thanks....
I have the exact same problem.......I need a tun.ko to start using witopia to get through the stupid ISP block on google Voice !!
So if anyone has any working tun.ko PLEASE PLEASE help us out !!
I got it !!
Finally......I managed to extract the tun.ko from Modaco's latest build, so credit goes to Modaco for this, I just extracted it for those who like to stick to Stock Roms (like myself for now).
I tested it and it works
How do you guys like openvpn on android? is it pretty stable? Has anyone tried using Access Server?
Are you sure you're running the stock OS?
I am still getting those messages:
insmod: init_module 'tun.ko' failed (Exec format error)
and in dmesg:
tun: version magic '2.6.29.6-cm-teknologist-0.1 preempt mod_unload ARMv7 ' should be '2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7 '
@chirayu : Well, I dont like it so much right since it still needs ALOT of work. Its lacking ALOT of things right now.
@sjakub : Yep, im running the latest ERE36 update. But yea its a stock image.
I didnt see any of the errors you mentioned. I got differnet errors while I was trying it with Witopia, which didnt really work out, but it doesnt seem like a tun driver issue, it was something about an encryption key not available, still working on that.
I have ERE27, that could be why. Where did you get that update from?
Can you get some other module from that phone (like bcm4329.ko) and look for 'vermagic' string inside?
Also, how did you extract tun.ko from that build? Maybe it's possible to extract one from the ERE27-based build?
sjakub said:
Also, how did you extract tun.ko from that build? Maybe it's possible to extract one from the ERE27-based build?
Click to expand...
Click to collapse
Well, the tun.ko is tested and works fine on ERE27 and ERE36 updates so that shouldnt be the problem.
As for the other files, like bcm4329.ko . Why would you need that ? It should be there by default ? as far as i know that module is responsible for certain wireless activities, I do have that file with me if you need it.
As to how i extracted, its simple.....I made a NAND backup of my stock image then flashed Modaco's latest update including the tecknologist kernel which supported tunneling and therefore included the tun.ko. Copied the file to the sdcard, then restored the backup and copied the files to /system/lib/modules
I don't NEED that module.
I would like to know what is the value of "vermagic" inside.
This is the string that describes the version of the kernel used.
Now, if it's something like '2.6.29-01117-g4bc62c2' and the one in the tun.ko you posted is '2.6.29.6-cm-teknologist-0.1' it means that you're somehow able to load module that has a different vermagic than a kernel. If the vermagic in bcm4329.ko is '2.6.29.6-cm-teknologist-0.1' it means that you have a different version of the kernel (and not the stock one). I have no idea why it would be working with ERE27 in that case, unless it was modified ERE27, not the stock one. Or, you were able to load an incompatible module somehow. In that case I would start investigating how to do that with my kernel as well
Hm, or you could check you phone's info:
Could you, on your phone, go to "Settings->About phone" and check what it says under "Kernel version"?
Thanks!
Finaly! I figured out how to build tun.ko module for the stock kernel.
If anybody wants to repeat that:
* I have Android OpenSource installed in /opt/android
* In /opt/android I did: git clone git://android.git.kernel.org/kernel/msm.git kernel-nexus
* In kernel-nexus I did:
- git checkout -b origin/android-msm-2.6.29-nexusone
- git checkout HEAD^
(The last operation reverses one revision, I needed a previous revision from the tree. Different revisions generate modules with different vermagic values)
(Actually, instead of previous two this should work as well - it should checkout the correct revision: git checkout 4bc62c230b2942bea72c3b5258e3e4f1d6cb534b )
- make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- distclean
- adb pull /proc/config.gz
- gunzip config.gz
- mv config .config
- Edited .config: changed "# CONFIG_TUN is not set" to: "CONFIG_TUN=m"
- make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules
- The driver ends up in: drivers/net/tun.ko
- You can verify if it is going to match the kernel by running:
+ strings drivers/net/tun.ko | grep 2.6.29
+ It should produce "vermagic=2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7"
+ The "2.6.29-01117-g4bc62c2" should be the same as the "Kernel version" in "Settings->About phone" on your phone.
* Now you can upload the module to your phone. I did:
- adb shell mount -o remount,rw /dev/block/mtdblock3 /system
- adb push drivers/net/tun.ko /system/lib/modules/
- adb shell mount -o remount,ro /dev/block/mtdblock3 /system
- And you can use adb shell, enter /system/lib/modules and run: insmod tun.ko
- It should work
The module is attached.
hey Sjakub..
I have tried using your module and I got the same thing like with the one i extracted from Modaco's mod. The tunnel droid gets stuck at "Connecting" any ideas?
Thanks again for all your work mate appreciate it !
Cyanogen Roms have built-in openvpn support. I don't have any problem using Tunneldroid on CM 5.0.4.1. I got the tun.ko error only when I was on the stock ROM. I'm also behind the GFW. Witopia does the trick for me.
thank you sjakub~i used to use your tun.ko working very well with tunneldroid.but after i update the kernel that supports tethering.the tun.ko doesn't work... the new kernel version is:2.6.29-gad36b87-dirty...
The tun.ko module has to be compatible with the kernel you have. Where did you get the kernel from? You need to find a source of exactly that kernel version and compile tun.ko yourself.
sjakub said:
The tun.ko module has to be compatible with the kernel you have. Where did you get the kernel from? You need to find a source of exactly that kernel version and compile tun.ko yourself.
Click to expand...
Click to collapse
i download the kernel for my nexus one from here ——code.google.com/p/android-wifi-tether/
and i follow the steps in the site to flash my rom :code.google.com/p/android-wifi-tether/wiki/NexusOneKernelUpdate
finally...i'm not able to use the previous workable tun.ko which you built...and i'm afraid that i was too amateur to complie tun.ko myself even though you have already list out the compiling steps...
Try asking authors of the wifi-tether for that module. That's probably the easiest way
sjakub said:
Try asking authors of the wifi-tether for that module. That's probably the easiest way
Click to expand...
Click to collapse
okay~i manage to browse that source in google code,though,i can't found tun.ko module.or maybe i will flash cyanogen rom which consist of all the necessary things
anyone brewing a tun.ko for nexus one froyo stock kernel. I don't see aosp code to build right now.

[BETA] [TRACKER] Known workarounds to known issues for Magisk Beta

This is a thread to track known workarounds for known issues for Magisk Beta.
DO NOT post any questions or random stuff in this thread as they will be ignored. The point is to have a clear tracking table for known workarounds as they
are currently getting lost in the post spam of the official beta thread. Discussions on workarounds or the problems they aim to fix/alleviate, should happen in the official
thread.
ONLY post known workarounds with references to the posts that introduce them and validate them and I will add them to the list. What you are reporting
must be related to the Magisk Beta. This thread is not about generic issues unrelated to the beta.
Error 1 during installation of v13.0 (96f8efc)
Users who get Error 1 during installation of v13.0 (96f8efc), specifically those who get the following error in the recovery log:
Code:
ioctl LOOP_SET_FD failed: Device or resource busy
@jenslody has made a modified version of (96f8efc) that fixes the problem for many users. LINK HERE. This version uses an older updater-binary script that correctly identifies non-64-bit paths to install Magisk (afaik).
The .zip package has been updated and now also includes the fix for very slow installation on some devices (described below).
Apparently the real issue behind this error is the toolbox failing to mount the loop device as reported by @Deic here: LINK HERE
The fix is moving the bundled busybox path variable earlier in the path export. I have modified the current update-binary script (which also includes the very slow installation on some devices fix) in the .zip attached here: LINK HERE​
SafetyNet fails with v.13.0 (96f8efc)
@Deic has made a module that might solve the issue. LINK HERE. It should be noted that this doesn't fix every possible issue, since some modules like Xposed Framework will trigger SafetyNet no matter what you do. Try disabling all your modules, verify that SafetyNet passes, then one-by-one reactivate the modules to identify the culprit. ​
Viper4Android doesn't work (multiple causes)
Status: Abnormal
If you are using v.13.0 (96e8efc) and V4A installs but the Driver Status says "Status: Abnormal," user @LazerL0rd provided a solution HERE. Download the .txt file and place it in /magisk/.core/post-fs-data.d/, then change the '.txt' to '.sh'. Change the permissions to 0755.​Processing: No in apps like YouTube
This can be remedied in some devices by removing the deep_buffer in the various audio_policy and audio_effects system files. You can make a script to remove these lines yourself or use the Universal Deep_Buffer Remover [AUDMODLIB] module by @ahrion if you are already using his ViPER4Android FX 2.5.0.5 [AUDMODLIB] module (note that this is not the one found in the Magisk Manager modules repo!).​
Installation of v.13 beta takes hours!
According to many patient users, the installation will succeed, even if it takes hours. @Nodens explains what the problem is, and a solution for it, in this informative post: LINK HERE.
Modded 96f8efc .zip package by @tdunham : LINK HERE.
This is fixed in current beta.​
MagiskHide failing to start.
Magisk log shows the following error:
Code:
bind_mount: /dev/magisk/mirror/system/xbin/dexlist -> /system/xbin/dexlist
* Running module post-fs-data scripts
[B]resetprop: prop [persist.magisk.hide] does not exist[/B]
** late_start service mode running
* Running service.d scripts
@_litz explains the problem and how to fix it here: LINK HERE. ​
Magisk Manager is not getting installed / Magisk Manager FCing
A lot of users report that the installer is not installing the manager automatically for them.
The Manager is included in the .zip file, in directory "common" and is named "magisk.apk. Extract it and install manually.
@p34rp34r also reports that reinstalling it manually has fixed the Manager FCing for him and other users: LINK HERE. ​
Module installed through Magisk Manager not visible on reboot
There have been several reports about installations of modules through Magisk Manager that are not visible in the Manager on reboot.
The big majority of those reports also report that on second reboot the module is properly listed.
It has also been reported that this never happens when modules are installed through TWRP instead.
According to my tests this also looks fixed on the latest beta. If someone still experiences this on the latest beta, please report it on main thread.​
Magisk is not available on boot after installation but no error in shown in TWRP
@jenslody explains the issue and offers a modded zip here: LINK HERE. ​
Credits: The initial list was compiled by @p34rp34r in this post: LINK HERE.
*reserved*
*reserved2*
*reserved3*
*reserved4*
*reserved5*
I also linked my post (link is on the OP here already) for the slow install issue and added to your comment for Magisk issues on Github.
https://github.com/topjohnwu/Magisk/issues
I updated my post ( https://forum.xda-developers.com/showpost.php?p=72704270 ) and attached the zip-file directly, because my server is currently down, due to technical problems of my hoster.
The updated zip ( https://forum.xda-developers.com/attachment.php?attachmentid=4187406&d=1497908496 ) also includes the fix for very slow loading by @tdunham .
I'll also add this for MagiskHide failing to start ....
Check your Magisk log for the following error:
bind_mount: /dev/magisk/mirror/system/xbin/dexlist -> /system/xbin/dexlist
* Running module post-fs-data scripts
resetprop: prop [persist.magisk.hide] does not exist
** late_start service mode running
* Running service.d scripts
If you see this, the installer failed to setup default props on your device. You can verify this by issuing the "getprops" command from an ADB shell, and looking specifically for :
persist.magisk.hide
persist.magisk.root
They should be missing. You can add them with the following commands, then rebooting :
RESETPROP persist.magisk.hide 1
RESETPROP persist.magisk.root 3
After reboot, you should see the following indicating MagiskHide correctly loads:
* Running module post-fs-data scripts
resetprop: getprop [persist.magisk.hide]: [1]
* Starting MagiskHide
hide_pre_proc: Hiding sensitive props
resetprop: getprop [ro.debuggable]: [0]
resetprop: getprop [ro.secure]: [1]
hide_list: initialize...
hide_list add: [com.google.android.gms.unstable]
IMPORTANT! : if MagiskHide does not start, SafetyNet will never pass!
"Device or resource busy" – This is caused by "too many days links" as seen sometimes in failing to flash stock firmware on Nexii. I have noticed it may be caused by MTP so restarting your phone a few times AND DISCONNECTING from your PC is a massive help.
LazerL0rd said:
"Device or resource busy" – This is caused by "too many days links" as seen sometimes in failing to flash stock firmware on Nexii. I have noticed it may be caused by MTP so restarting your phone a few times AND DISCONNECTING from your PC is a massive help.
Click to expand...
Click to collapse
Mind giving me some more info? Where does the "Device or resource busy" error pop up? In a log? Magisk? Recovery? What behavior is associated with it? (Failure to install? Some component or function not working?)
Nodens said:
Mind giving me some more info? Where does the "Device or resource busy" error pop up? In a log? Magisk? Recovery? What behavior is associated with it? (Failure to install? Some component or function not working?)
Click to expand...
Click to collapse
After copying lots of files to a device, you see this error when trying to flash an image to your device.
It's an error limited to the io governors which cancel out tasks after some time "deadline" AND (correctly me if I'm wrong) any NON-UFS storage devices (as ufs can read and write same time {double helix} therefore it doesn't need to wait to do one task at a time).
This error will occur if there eMMC device is being used to read and write too much or previously didn't finish clearing itself out (fsync or fflush or something it's called). By restating your phone and avoiding connection to your PC (which'll trigger MTP and cause more reads) you'll avoid this error.
Thanks allot for reading, this is based on my previous knowledge of flashing firmware unto Nexii and I'll be happily corrected of I'm wrong; live and learn, right?
Sorry mate but what you're describing is an issue with flashing roms to Nexus devices. This thread tracks verified workarounds for known issues pertaining to the Magisk Beta only.
It's not even about general Magisk issues. So generic issues on flashing roms to specific devices do not belong here. Everything on the list must and will pertain to the beta only.
Nodens said:
Error 1 during installation of v13.0 (96f8efc)
Users who get Error 1 during installation of v13.0 (96f8efc), specifically those who get the following error in the recovery log:
Code:
ioctl LOOP_SET_FD failed: Device or resource busy
@jenslody has made a modified version of (96f8efc) that fixes the problem for many users. LINK HERE. This version uses an older updater-binary script that correctly identifies non-64-bit paths to install Magisk (afaik).
The .zip package has been updated and now also includes the fix for very slow installation on some devices (described below).​
Click to expand...
Click to collapse
That error is because is not used busybox to mount the loop device. The toolbox one gives that busy error.. and that is due to the built-in busybox path is the last in the PATH var of the updater-binary script.
Deic said:
That error is because is not used busybox to mount the loop device. The toolbox one gives that busy error.. and that is due to the built-in busybox path is the last in the PATH var of the updater-binary script.
Click to expand...
Click to collapse
Ok this makes sense. So
Code:
export PATH=$BUSYBOX:/system/bin:/system/xbin
should fix it.
Is there any reason why busybox variable should not be first in the path? Comment instructs to prefer system binary in bin instead of bundled busybox.
EDIT: Attaching here modded .zip so I can link it to the OP.
_litz said:
I'll also add this for MagiskHide failing to start ....
Check your Magisk log for the following error:
bind_mount: /dev/magisk/mirror/system/xbin/dexlist -> /system/xbin/dexlist
* Running module post-fs-data scripts
resetprop: prop [persist.magisk.hide] does not exist
** late_start service mode running
* Running service.d scripts
If you see this, the installer failed to setup default props on your device. You can verify this by issuing the "getprops" command from an ADB shell, and looking specifically for :
persist.magisk.hide
persist.magisk.root
They should be missing. You can add them with the following commands, then rebooting :
RESETPROP persist.magisk.hide 1
RESETPROP persist.magisk.root 3
After reboot, you should see the following indicating MagiskHide correctly loads:
* Running module post-fs-data scripts
resetprop: getprop [persist.magisk.hide]: [1]
* Starting MagiskHide
hide_pre_proc: Hiding sensitive props
resetprop: getprop [ro.debuggable]: [0]
resetprop: getprop [ro.secure]: [1]
hide_list: initialize...
hide_list add: [com.google.android.gms.unstable]
IMPORTANT! : if MagiskHide does not start, SafetyNet will never pass!
Click to expand...
Click to collapse
That's one of the issues @topjohnwu asks for help with in the beta thread. Could you maybe provide him with some logs for that one? Instructions as to which logs are in the OP of the beta thread.
Thanks for making this thread and the credit; I did worry about my post being lost to the ether and making a thread never crossed my mind! But credit where it's due - all the other great users in these threads. All of these answers are buried in those 100+ pages somewhere. Enough OT though...
One user here had an issue with the Magisk Manager FCing after successfully flashing the Magisk beta. I recall seeing somewhere something about extracting the apk and installing it manually. This worked for me. Perhaps it can be added to the list of possible fixes?
Nodens said:
Ok this makes sense. So
Code:
export PATH=$BUSYBOX:/system/bin:/system/xbin
should fix it.
Is there any reason why busybox variable should not be first in the path? Comment instructs to prefer system binary in bin instead of bundled busybox.
EDIT: Attaching here modded .zip so I can link it to the OP.
Click to expand...
Click to collapse
I updated my original post accordingly and linked to yours.
Hello i have a problem installing magisk 13 beta , i dont get error 1 it just dont install, i needed force shutdown i waited 10 min
It stays on constructing evoriment
Device sm-g928f with khongloi 11
Wesley_NL said:
Hello i have a problem installing magisk 13 beta , i dont get error 1 it just dont install, i needed force shutdown i waited 10 min
It stays on constructing evoriment
Device sm-g928f with khongloi 11
Click to expand...
Click to collapse
Did you try the installer from this thread ?
https://forum.xda-developers.com/showpost.php?p=72734887&postcount=15

[MODULE HELP] How to execute a script only once when module is installed/uninstalled?

The question title can't be much longer but I basically need to execute a script only once when each of the following events happen:
Module is installed.
Module is uninstalled.
Module is enabled.
Module is disabled.
In other words:
When the user first installs my module, I need to execute a script just once.
If the user eventually disables the module, I need to execute the same script again just once.
If the user eventually re-enables the module, I need to execute the same script again just once.
When the user decides to uninstall my module, I need to execute a script just once.
That script is basically removing a particular app's dalvik cache (rm -rf /data/dalvik-cache/<(arm|arm64)>/<app_specific_folder>), and user data (rm -rf /data/data/<package_name>).
I need some pointers on how to do this properly for those 4 events mentioned above and in a way compatible with most devices (for the record, I'm only supporting Nougat and above, if that's relevant).
Installation is easy. Make a function with your script in config.sh and call that from update-binary. Also make sure to let the module install a boot script (post-fs-data.d or service.d, depends on what you want to do) that takes care of the rest for you.
Whenever a module is disabled, there'll be a file named disable in the module folder, so you can let the boot script check for that and then run whatever code you need for the "module disabled" scenario. If you also let that code add a check file to the module folder you can let the code only run once. If both the disable and check files are present, don't run the code...
If the module then is enabled again, the disable file will be deleted. In that case you'll only have the check file, which will mean you should then run the "module enabled" code (which should also delete the check file, of course).
Also let the boot script check for the module folder. If it isn't found it means the module has been uninstalled and you can safely run your "module uninstalled" scenario, do some cleanup, and then let the boot script uninstall itself.
That should work...
There are several modules that do something similar, my MagiskHide Props Config is one of them. Look around for more examples.
I see what you mean but I need to test my code with logging to make sure I'm doing things correctly. What's the best way for me to print to logcat from my Magisk module?
Use exec with xtrace.
Code:
exec 2>/path/to/log/file;
set -x;
It will redirect the command (execution) tree and their errors to the log_file.
Regards.
@JayminSuthar Sorry, I don't understand. Where should I place that code? And are you saying that all the commands (outputs and errors) on my module will be redirected to that file, no exceptions?
You should place this code in your script from where you want logging to start (mostly the beginning). This will print the command (execution) tree in the log file, and all errors (if any), It will not print the output, but the command executed itself.
The format of the logs should be like
Code:
+ >&2
+ echo 'Here logging starts, I'm stderr'
Here logging starts, I'm stderr
+ rm -f /some/non/existent/file
rm: Can't remove file: No such file or directory

Need someone to convert TWRP zip into Magisk Module

Dear Members iam not a developer so i am looking for someone who can convert attached file into Magisk Module.. This TWRP zip contain vendor files for Sharp Aquos S3 (HH6) and iam using it to run Android One which is for device HH1..
If it is possible for anyone please.
I downloaded this file from 4PDA so i can not request them to convert as i don't know russian to communicate
You don't need to be a developer to create a Magisk module. You've got the module template right here: https://github.com/topjohnwu/magisk-module-installer
Simply take the vendor directory from the original zip and place it in the system directory of the module template. Then you can update the info in module.prop to something descriptive (so you know which module it is in the modules list later), zip up the template and flash it.
Great Thanks alot i will do it right away
Didgeridoohan said:
You don't need to be a developer to create a Magisk module. You've got the module template right here: https://github.com/topjohnwu/magisk-module-installer
Simply take the vendor directory from the original zip and place it in the system directory of the module template. Then you can update the info in module.prop to something descriptive (so you know which module it is in the modules list later), zip up the template and flash it.
Click to expand...
Click to collapse
Iam getting an error as below
Copying zip to temp_directory
Installing module.zip
Installation failed
Where I can see what is wrong, i simply copied vendor folder from original TWRP zip folder and pasted into system folder of module template as instructed
There are no logs in Magisk Manager > Logs
Didgeridoohan said:
You don't need to be a developer to create a Magisk module. You've got the module template right here: https://github.com/topjohnwu/magisk-module-installer
Simply take the vendor directory from the original zip and place it in the system directory of the module template. Then you can update the info in module.prop to something descriptive (so you know which module it is in the modules list later), zip up the template and flash it.
Click to expand...
Click to collapse
jameelmemon said:
Iam getting an error as below
Copying zip to temp_directory
Installing module.zip
Installation failed
Where I can see what is wrong, i simply copied vendor folder from original TWRP zip folder and pasted into system folder of module template as instructed
There are no logs in Magisk Manager > Logs
Click to expand...
Click to collapse
I'm gonna guess you didn't replace the dummy update-binary with the proper installation script. It's detailed in the documentation but I could probably have mentioned it... Here's the relevant part of the docs: https://topjohnwu.github.io/Magisk/guides.html#magisk-module-installer
Didgeridoohan said:
I'm gonna guess you didn't replace the dummy update-binary with the proper installation script. It's detailed in the documentation but I could probably have mentioned it... Here's the relevant part of the docs: https://topjohnwu.github.io/Magisk/guides.html#magisk-module-installer
Click to expand...
Click to collapse
After Following all instructions, module gets installed but it is not effective
After analyzing files that this module loads I think they doesn't work as they do not execute as they should, I maybe wrong here, but i think these scripts need to be split and placed / executed in different way.
here is code from vendor/etc/init/hw/init.sku.rc
on fs
setprop persist.radio.skt_iot 1
setprop persist.vendor.ims.no_stapa 1
setprop ro.product.first_api_level 27
setprop ro.product.vendor.brand SHARP
setprop ro.product.vendor.model FS8032
setprop ro.product.vendor.name FS8032_00A0
setprop ro.product.vendor.device HH6_sprout
setprop ro.product.vendor.manufacturer SHARP
on post-fs
setprop persist.sys.security_enable false
setprop persist.radio.multisim.config dsds
on fs
setprop ro.vendor.build.fingerprint SHARP/FS8032_00A0/HH6_sprout:9/PPR1.180610.011/FS8032S0314P:user/release-keys
there are 2 files init.fingerprint.gxfp5288_sd1.rc and init.fingerprint.gxfp3258_sd1.rc containing on post-fs-data which should be placed in common/post-fs-data.sh file, but i don't know about on fs or other parts.
whereas vendor/etc/init/hw/init.HH1.target.rc imports some existing scripts from vendor folder and executes code on boot, on pre-boot and on init
from prename of each file i guess they can be executed as init.d script if so how i can use a module to convert them as init.d scripts and load effectively
All the props (the setprop commands) can be placed in the module system.prop file (don't forget to also activate it in install.sh). The rest of the commands would have to be converted to the post-fs-data.sh and service.sh module scripts, depending on when they're needed (again, don't forget to activate them in install.sh). The service.sh script runs later in the boot process.
I can unfortunately not help you there though. Time is a way too valuable commodity...
Setprop i can do but can you please have a look into the files and explain to me how i would rewrite the script or point me to a tutorial would be great help
Didgeridoohan said:
All the props (the setprop commands) can be placed in the module system.prop file (don't forget to also activate it in install.sh). The rest of the commands would have to be converted to the post-fs-data.sh and service.sh module scripts, depending on when they're needed (again, don't forget to activate them in install.sh). The service.sh script runs later in the boot process.
I can unfortunately not help you there though. Time is a way too valuable commodity...
Click to expand...
Click to collapse

Have others found that mount-master works under Android 11?

Hi there,
I recently got my OnePlus 9, and am converting the scripts I use to run luks to the new phone. Everything seems fine, losetup creates the node and loads the file as a block device, dmcrypt unlocks it, mount /dev/mapper/<partition-name> mounts it fine, but it's only visible as root (the user that mounted it). I've verified that the Magisk (22100) setting is to use the globalname space and just to make certain I've explicitly run mount within "su -mm", but regardless can only see the unmounted directory (verified by containing a file that isn't present within the encrypted partition).
Dmesg doesn't mention anything about the mount namespace (but I don't know that it would), so I wanted to verify that others have managed to use the su -mm/-M/--mount-master option successfully under android 11 (or, I guess more specifically Oxygen OS 11.2.4.4)?
As a side-note, this same script has been tested and worked with a OnePlus 7 on android 10 with magisk set to use globalnamespaces. Happy to provide further information or run tests if it'll help to get to the bottom of what's going on...
Thanks!
This also occurs in Magisk 23000.
I've discovered this thread:
https://twitter.com/i/web/status/1279508461370269696, however, I'm calling `su -mm` and I've set the mount namespace mode to "All root sessions use the global mount namespace", so I don't think that's relevant.
As best I can tell, once root mounts a directory, any other process running as root can see it (because of the global mount namespace), but normal processes can't access it. This seems to be due to mount namespaces, so the device now needs to be mounted with `-o shared` or `--make-shared`, but unfortunately that gives an unhelpful "invalid argument" message. Trying to change it with `-o remount` seems to succeed but the change to shared appears to be ignored.
When running the command, I get a single log entry that might provide more details:
05-15 03:02:54.184 30090 30090 I su : type=1400 audit(0.0:1523): avc: denied { ioctl } for path="/dev/pts/3" dev="devpts" ino=6 ioctlcmd=0x5404 scontext=u:r:magisk:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=1
But I can't quite tell what's causing that to be stopped. I don't know whether it's related or not and whether I should be digging into audit/selinux permissions, or figuring out what the ioctlcmd is. Any help would be much appreciated...
Well, I've confirmed that any app that launches root can see the mountpoint, but otherwise can't. The `-o shared` option seems to cause either a parsing error, or at least no success with both the native toybox implementation and with busybox.
I found this excellent article suggesting that `nsenter -t 1 -m <shell-command>` should get me into the pid 1 namespace, which should then be inherited by everyone. I can get in there, and carry out the mount, but I can only get apps to see the mount point if I enter their specific pid namespace and mount the directory I want. This happens if root namespace is both global or inherited (I haven't tried isolated, but I can't see why that would work?). So essentially, even though I seem to be doing all the right things, I'm getting nowhere. Clearly it's possible to mount things so that everyone can see them (because magisk does it when it bind mounts various programs from modules), so could anyone that knows the internals of magisk better shed some light on what might be going wrong and how I could get global mounting working properly? I tried the pid for zygote64 as well (which seemed to be part of `main` which was at the top of the process tree), but again it wasn't seen by the test program.
Any help would be much appreciated...

Categories

Resources