summaryrefslogtreecommitdiff
path: root/META-INF/com
AgeCommit message (Collapse)Author
2019-10-16Backend: break early on getprop failure fallback when value foundosm0sis
2019-10-16Backend: fix getprop and devicecheck for GSIsosm0sis
- add additional prop locations to getprop failure fallback - add vendor props to devicecheck and getprop parsing fallback check to avoid false negatives on GSIs - mask errors from devicecheck getprops as not all of them may exist on GSIs or non-GSIs Thanks @lazerl0rd for the information and start on the changes Closes #44
2019-08-29Backend: fix restore_env $bb commandsChris Renshaw
- this needs to be before cleanup so busybox will still be there
2019-08-27Backend: add /dev/random workaround for recoveryChris Renshaw
- per Chainfire, "fix slow RNG on some devices, which may cause installation to take weeks" - it seems like this issue may have been triggered now in recovery on some devices by some of the changes from the new mounting rewrite
2019-08-17Backend: rewrite mount logic to properly cover all casesosm0sis
- use $ANDROID_ROOT variable which in TWRP is set to /system_root on properly set up SAR devices and default set it to /system - continue to correct any issues with /system and /system_root mountpoints but backup and restore any symlinks encountered - only mount and umount /data when it is not mounted to begin with to fix MTP issues in TWRP on some devices (thanks @Zackptg5) - refactor tear down into restore_env() function to allow restoring original recovery environment even after abort - add lazy umounts because let's be thorough - remove hacky workaround to avoid /system_root umount when booted since that should be handled by flashing app now
2019-08-13Backend: mask error on TWRP devices without /system_root in fstabChris Renshaw
2019-08-13Backend: support TWRP devices with /system_root in fstabChris Renshaw
2019-08-12Backend: mounting fixes, simplify ui_printing from filesosm0sis
- rename unmount_all to umount_all since it's been bugging me for a while ;) - refactor mountpoint setup into its own function - try mount --move first since /system should already be mounted (thanks @Zackptg5) - refactor reused script to ui_print from files into its own function
2019-08-07Backend: fix derpChris Renshaw
2019-08-06Backend: ensure /system_root umount even if /system is a symlinkosm0sis
2019-08-06Backend: attempt to fix system_root setup on oddball device recoveriesosm0sis
- TWRP for some devices has /system as a symlink, some do not; apparently some weird devices have /system_root as a symlink (somehow); attempt to fix them all
2019-08-04AK3+Backend: fix multi-line abort outputsosm0sis
2019-07-20Backend: remember we needs them busybox awksosm0sis
2019-07-20Backend: introduce Android security patch level check, cleanupsosm0sis
- checks the supported.patchlevels prop in anykernel.sh and matches against it to prevent users flashing incorrect kernels for patch levels - this is possibly more important than supported.versions now since modern Android doesn't really do point releases anymore, so a patch level is more likely to signify breakage than a version change - supported.patchlevels can be a closed or open-ended range of dates in the format YYYY-MM, e.g. "2019-04 - 2019-06", "2019-04 -" or "- 2019-06" where the last two examples show setting a minimum and maximum, respectively - clean up device and version checks a bit while we're at it
2019-07-12Backend: speed up and simplify is_mounted useosm0sis
2019-07-01AK3: add simple arch detect to optionally support arm + x86 in same ziposm0sis
- for use with broad zips targetting many devices including different architectures - enable support by putting current tools binary contents in tools/arm and adding tools/x86 (thanks @Zackptg5 for the nudge)
2019-06-26Backend: use recovery umount for /vendorwloot
* It is a *HACK* * Avoid "Mount /cust (Device or resource busy) failed" error on orangefox which mounting /cust as /vendor and also runing a non-treble ROM. * It is a Orangefox feature that mount both /vendor and /cust while runing a non-treble ROM (Obviously, there is a BUG that it shouldnt mount both but /cust only), so both of them have a same block. In this case, normal busybox unmount will only un-mount what we inputted. I guess that orangefox hacked umount command to make /cust is binding with /vendor. (See comments in #41) Signed-off-by: wloot <wlootlxt123@gmail.com>
2019-06-26Backend: fix getting parent directory on some deviceswloot
/tmp/updater: line 33: cd: /tmp/anykernel/..: No such file or directory Closes #41
2019-06-10Backend: avoid tar complaining when there is no recovery.logChris Renshaw
- clean up needless $parent stuff - recovery.log will only be in /tmp regardless of $home
2019-06-09Backend: only take relevant files for debug .tgzChris Renshaw
- per suggestion from eng.stk avoid archiving all of $home since /tmp in recovery might hold sensitive crypto data - restrict tar to $home (i.e. /tmp/anykernel by default) and $parent/recovery.log (i.e. /tmp/recovery.log) - probably no need to be verbose when making the archive, it kinda clutters up the end of the captured log
2019-06-07Backend: fix debugging .tgz creation for booted installsosm0sis
- some apps copy the zip to be flashed to the app cache, which would result in the .tgz going either somewhere unknown/inaccessbile to the user or get deleted when the app cleans up after flash, so instead send to /sdcard if the device is booted to Android
2019-05-31Welcome to AK3: AnyKernel2 + Magisk = AnyKernel3!osm0sis
- abstract out execution directory as $home to fascilitate testing individual scripts (defaults to /tmp/anykernel) - general script clean ups for uniformity, readability, speed and simplicity - simplify consecutive `ui_print` commands where possible Backend only fixes: - use busybox umount and mount whenever possible to avoid linker warnings in stderr during system-as-root setup - use `busybox --install -s` for bin/* setup - consolidate setup to abort earlier if there are issues - add backwards compatible symlinks for those who might not have updated their anykernel.sh with ak3-core.sh (to be renamed in subsequent commit) Tools only fixes: - add magiskboot to replace separate support for AOSP and PXA-AOSP formats, with MTK headers, BLOB, DHTB, SEAndroid and Nook signing - add magiskpolicy to allow for easy sepolicy patching - remove xz and lz4 since magiskboot supports these AK3 Core only fixes: - use full `ui_print` function implementation like the backend - add `abort` function to simplify exit on errors - fix $patch directory being excluded from `reset_ak` - update $ramdisk_compression handling for magiskboot - magiskboot also resolves long-standing request for built-in Bump support (#18) - update Sony ELF and related support for initial repack as AOSP by using mkbootimg as plug-and-play optional add-in binary - update Sony ELF MTK header support using mkmtkhdr only when ELF is initially unpacked by unpackelf - add support for MTK RECOVERY ramdisk header type with Sony ELF - simplify U-Boot dumpimage/mkimage and Sony ELF unpackelf/mkbootimg split_img file handling - update patch_cmdline to handle both magiskboot as header prop file, and unpackelf or mboot as cmdline.txt - use `cp -fp` for `backup_file` and `restore_file` to hopefully better preserve attributes if used outside of the ramdisk - refactor setup into `setup_ak` to simplify `reset_ak` trigger to find slot and block again - add fallback to busybox for compression formats (i.e. lzop) which magiskboot cannot handle IMPORTANT NOTES: 1) forcing repack with uncompressed cpio ramdisk is not currently supported by magiskboot 2) forcing repack with lzop ramdisk when previously another format is not currently supported by magiskboot
2019-01-02Backend: support all half-sensible ROM version formatsosm0sis
9 9.0 9.0.0 Anything else is insanity.
2018-12-20Backend: workaround bad ROM versioning practices in supported checkosm0sis
- some ROMs have taken it upon themselves to go against AOSP, i.e. where starting with Pie AOSP now versions it as only 9, some ROMs are still making it 9.0 - introduce integer 2 float function that will add a decimal place to all for comparisons - this should support the majority of ROMs, but anything crazy like 9.0.0, or crazier like 09.0.0 should be frowned upon by the community and the ROM devs should be made to get it together and follow AOSP
2018-12-16Backend: clean up mountingosm0sis
- only mount system when not already mounted (avoids harmless stderr during booted flashes) - optimize module targeting and mount logic further
2018-12-16Backend: introduce Android version checkosm0sis
- checks the supported.versions prop in anykernel.sh and matches against it to prevent users flashing incorrect kernels for ROM versions - supported.versions can be a list, e.g. "7.1.2, 8.0, 8.1" or a range, e.g. "8.1 - 9" of versions in the correct formatting for that Android version in ro.build.version.release in /system/build.prop
2018-12-16AK2+Backend: fix file_getprop truncating if prop value contained =osm0sis
See comments: https://github.com/osm0sis/AnyKernel2/pull/35#issuecomment-447648900
2018-12-15Backend: cleanupsosm0sis
2018-12-14Backend: more robust getprop checks and replacementsosm0sis
- getprop failures are not only a system-as-root device issue, as it now also happens on OnePlus 5T in recovery when ROM is Pie Open Beta - this appears to come down to a libc mismatch between recovery and ROM resulting in direct property checks failing but getprop without arguments printing all properties working - revert most of https://github.com/osm0sis/AnyKernel2/commit/b1524da099efa716616a8eb3357876bca6a73540 since this should remain resolved with the new implementation - keep the old check and file_getprop fallback for devices without getprop entirely - add new getprop fallback that parses the full getprop output
2018-12-14Backend: allow infinite device.name<num>= device check properties (#34)osm0sis
2018-12-11Backend: only attempt module bind remount if already mountedosm0sis
- blindly attempting to remount broke module placement on some ROMs (e.g. Pocophone MIUI stock)
2018-12-11Backend: attempt remounting module location as wellosm0sis
- some custom ROMs on some devices (e.g. Lineage on Pocophone) bind mount modules in /system over modules on /vendor, so remount rw at the bind target to ensure the bind source is also remounted and replaced - toybox mount doesn't accept the /. prefixed paths from find so ensure we use busybox for mounts Thanks franciscofranco and topjohnwu for the tips!
2018-07-29AK2: Allow reading multiple lines from version fileDarkLord1731
This becomes handy to display some additional details apart from just showing the kernel version
2018-07-19Backend: move system_root mounting to after device checkosm0sis
- adapted from https://github.com/nathanchance/AnyKernel2/commit/3dfba3dcabff3cf1f859276e1851ae35891d8801 - works around odd behaviors in TWRP on system-as-root devices, but retains working fallback using /system/system/build.prop if getprop also fails - simplify unmount_all stderr redirection Please see the above linked commit for further details. Thanks to nathanchance for reporting, the device-specific workaround, and much testing
2018-07-16backend: Break out of device check loop if a match is foundNathan Chancellor
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-07-16backend: Break out of device check loop if a blank value is foundNathan Chancellor
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-07-16backend: Cache build.prop values in device check blockNathan Chancellor
These values are static, we don't need to keep getting them with getprop. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-07-03AK2+Backend: move system_root setup and tear down to backendosm0sis
- abstract out unmounting and expand to support undoing system_root - also preserve and restore LD_PRELOAD
2018-05-29Backend: misc fixesosm0sis
- remove "kernel" from "Installing" wording since AK2 is also used on recoveries, and multi-partition Treble devices and this could be misleading - fix getprop build.prop fallback on /system/system devices
2018-03-23Backend: fix modules support regression for /vendorosm0sis
thanks @nathanchance for the quick heads-up
2018-03-23Backend: fix modules support regression on /system/system devicesosm0sis
2018-03-20Backend: Add mkdir for modules (#23)Zackptg5
2018-02-26Backend: touch up install whitespace now that we have banner/version displayosm0sis
2018-02-26Backend: add custom kernel version display supportosm0sis
- place version text in a file named "version" in the root of the zip and it will display after the kernel.string when flashing - useful in conjunction with build scripts, i.e. a generated version file not actually part of the kernel AK2 repo
2018-02-26Backend: add custom kernel banner supportosm0sis
- place text or line-art in a file named "banner" in the root of the zip and it will display ahead of the kernel.string when flashing
2018-02-25Backend: fix vendor unmountingosm0sis
2018-01-19Backend: only replace getprop if needed (and do so more robustly)osm0sis
2018-01-08Backend: Only apply contexts to new modulesNathan Chancellor
After working on the OnePlus 5/T with custom ROMs on Android 8.1.0, I have noticed that several of them have modules in /system/lib/modules with a context of "u:object_r:vendor_file:s0", which goes against the assumption made in commit 6b11373 ("update-binary: Change how we handle modules"). Because the context is changed, there is an SELinux denial when trying to load the module during init. While it would be nice for ROMs to fix that on their own, I suspect they are not entirely at fault. Google's documentation does state that all modules should be loaded from vendor whenever possible so I would guess Google decided to force *.ko objects to have a vendor_file context. This is all speculation as I haven't cared to do research into the subject. Easiest way around this is to just worry about applying contexts to new modules. cp does not override contexts so if the module was already present, we can assume it has the correct context to begin with. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-01-02update-binary: Change how we handle modulesNathan Chancellor
As of Oreo, Google is requiring that kernel modules be used whenever possible and that their location be in /vendor. With Lineage 15.1, devices without a separate /vendor partition will use /system/vendor, which symlinked to /vendor. To make this more flexible and future proof, allow developers to specify where each module needs to go by setting the path in the modules folder. If a module needs to go to /system/vendor/lib/modules, then the module should be placed in modules/system/vendor/lib/modules. Contexts and permissions will still be updated automatically. Android documentation: https://source.android.com/devices/architecture/kernel/modular-kernels Lineage 15.1 commit: https://github.com/LineageOS/android_vendor_lineage/commit/bf38db2a5e358a5449458b3dee2dd9d4015b8147 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2017-12-03AK2+Backend: misc fixesosm0sis
- hide some expected stderr for AK2 mods with no additional ramdisk files - fix U-Boot support by passing correct repacked ramdisk filename - fix multi-compression support during repack derp - fix cleanup on successful flash not working due to double match from cleanuponabort