FORUMS
Remove All Ads from XDA

[DEV][TEMPLATE] AnyKernel3 - Easily Mod ROM Ramdisk + Pack Image.gz [Flashable Zip]

13,800 posts
Thanks Meter: 30,579
 
By osm0sis, Recognized Developer / Recognized Contributor on 5th March 2014, 03:32 AM
Post Reply Email Thread
15th December 2017, 11:10 AM |#571  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,579
 
Donate to Me
More
Quote:
Originally Posted by Zackptg5

Since it was because since the anykernel script runs in the same directory as ramdisk, I orignally had it as just "init.rc" without any directory in front of it. So I set overlay to equal have a slash at the end of it so the init.rc call wouldn't be "/init.rc" when overlay was set to nothing but having it set to ramdisk works too.

I wasn't sure if avb signing on non-avb devices would break anything so I only had that happen for slot devices (the move command moved it to the directory where the installer would find it and sign the image

Nah set to "" would run your commands on the actual live ramdisk as /init.rc would point there.. You're right though, since we're in $ramdisk already you could quite cleverly set overlay=. so that it'll end up ./init.rc and run on the unpacked files.

Pixel headaches, amiright?
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
22nd December 2017, 05:08 PM |#572  
tbalden's Avatar
Recognized Developer
Flag Budapest
Thanks Meter: 15,303
 
Donate to Me
More
EDIT: nevermind. I think it's going to be something else than slot vs treble. Digging further....
The Following User Says Thank You to tbalden For This Useful Post: [ View ]
2nd January 2018, 11:07 AM |#573  
joshuous's Avatar
Recognized Developer
Thanks Meter: 5,629
 
More
Hi @osm0sis,

For the do.modules feature, do you have any thoughts about adding support for pushing some modules separately to /vendor/lib/modules? I understand that some init scripts and system configurations attempt to insmod the modules from the vendor/lib/modules directory instead of system/lib/modules.
2nd January 2018, 11:20 AM |#574  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,579
 
Donate to Me
More
Quote:
Originally Posted by joshuous

Hi @osm0sis,

For the do.modules feature, do you have any thoughts about adding support for pushing some modules separately to /vendor/lib/modules? I understand that some init scripts and system configurations attempt to insmod the modules from the vendor/lib/modules directory instead of system/lib/modules.

Funny you should ask! @nathanchance messaged me yesterday with the same idea and is currently working on a PR, so it should be ready shortly.
The Following 6 Users Say Thank You to osm0sis For This Useful Post: [ View ]
2nd January 2018, 11:30 AM |#575  
joshuous's Avatar
Recognized Developer
Thanks Meter: 5,629
 
More
Quote:
Originally Posted by osm0sis

Funny you should ask! @nathanchance messaged me yesterday with the same idea and is currently working on a PR, so it should be ready shortly.

Awesome really glad to hear
2nd January 2018, 03:27 PM |#576  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,579
 
Donate to Me
More
Happy New Year!

Despite me being away on vacation here's a big update to module handling thanks to @nathanchance. If you are currently pushing modules with AK2 you will need to move the files under "modules/" to reflect their destination subfolder to avoid breakage, e.g. "modules/system/lib/modules/", "modules/system/vendor/lib/modules/" and/or "modules/vendor/lib/modules/"; this will be pretty future proof so was worth the while.

update-binary: Change how we handle modules:
https://github.com/osm0sis/AnyKernel...ee3d4b440fbde6

README: Update documentation for modules:
https://github.com/osm0sis/AnyKernel...73153f5b529cb2

example: Update modules folder for new location handling:
https://github.com/osm0sis/AnyKernel...8ec88fc97c550a
The Following 18 Users Say Thank You to osm0sis For This Useful Post: [ View ]
4th January 2018, 07:46 PM |#577  
Senior Member
Thanks Meter: 5,690
 
More
@osm0sis

For the oneplus5/5t, call recording can be enabled in countries that don't normally allow it by the following command:
Code:
settings put global op_voice_recording_supported_by_mcc 1
It needs to be run several seconds after boot though. The original solutions was to just use a magisk late start service script that slept for 15 seconds and then ran the above command but I wanted a more universal solution and so I attempted to patch the boot img.
I have it add this to init.rc:
Code:
service ENCR /system/bin/sh /init.encr.sh
    class late_start
    user root
    group root
    disabled
    oneshot

on property:sys.boot_completed=1
    start ENCR
And add this init script to the ramdisk:
Code:
#!/system/bin/sh

sleep 15
echo "$(date +"%T"): Native call recording enabled" >> /data/media/0/test
settings put global op_voice_recording_supported_by_mcc 1 &>> /data/media/0/test
The debug test file on my sdcard always gives me this error though:
Code:
/system/bin/settings[5]: app_process: not found
When I run the init script manually in terminal, it works fine so I'm not sure why I'm getting this error. Any ideas? Thanks

Edit: I removed the shebang from the init script and the error was replaced by a permission denied error. I didn't think I had to worry about root with an init script?
4th January 2018, 08:37 PM |#578  
Vagelis1608's Avatar
Senior Member
Flag Athens
Thanks Meter: 843
 
More
Quote:
Originally Posted by Zackptg5

@osm0sis

For the oneplus5/5t, call recording can be enabled in countries that don't normally allow it by the following command:
It needs to be run several seconds after boot though. The original solutions was to just use a magisk late start service script that slept for 15 seconds and then ran the above command but I wanted a more universal solution and so I attempted to patch the boot img.
I have it add this to init.rc:

And add this init script to the ramdisk:
The debug test file on my sdcard always gives me this error though:

When I run the init script manually in terminal, it works fine so I'm not sure why I'm getting this error. Any ideas? Thanks

Edit: I removed the shebang from the init script and the error was replaced by a permission denied error. I didn't think I had to worry about root with an init script?

Set the perms on the script file to 755

Also, add this line in the service that runs it: seclabel u:r:su:s0
This is so that SELinux ( on Enforcing ) won't block it.
The Following 2 Users Say Thank You to Vagelis1608 For This Useful Post: [ View ] Gift Vagelis1608 Ad-Free
4th January 2018, 08:59 PM |#579  
Senior Member
Thanks Meter: 5,690
 
More
Quote:
Originally Posted by Vagelis1608

Set the perms on the script file to 755

Also, add this line in the service that runs it: seclabel u:r:su:s0
This is so that SELinux ( on Enforcing ) won't block it.

The permissions were already set to 750 in anykernel.sh but the seclabel did it! Thanks!
The Following User Says Thank You to Zackptg5 For This Useful Post: [ View ] Gift Zackptg5 Ad-Free
5th January 2018, 01:09 PM |#580  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,579
 
Donate to Me
More
Quote:
Originally Posted by Zackptg5

The permissions were already set to 750 in anykernel.sh but the seclabel did it! Thanks!

You might be able to simplify the whole thing by making the actual service command /system/bin/sh -c "settings ..." and triggering it at boot completed.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
5th January 2018, 06:11 PM |#581  
Senior Member
Thanks Meter: 5,690
 
More
Quote:
Originally Posted by osm0sis

You might be able to simplify the whole thing by making the actual service command /system/bin/sh -c "settings ..." and triggering it at boot completed.

Even better, thanks!
Post Reply Subscribe to Thread

Tags
anykernel, flashable zip, kernel, scripting, template

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes