Commit Graph
532 Commits
Author SHA1 Message Date
osm0sis e686f1f76c README: document multi-partition setup and auto slot detection 2018-03-23 12:31:00 -03:00
osm0sis 19a49f1f34 AK2: allow is_slot_device=auto (#21)
- for use with broad, device non-specific AK2-based mod zips
2018-03-23 12:19:08 -03:00
osm0sis 79b4c2c593 Backend: fix modules support regression on /system/system devices 2018-03-23 11:51:48 -03:00
osm0sis 966cea0d57 AK2: more multi-partition support improvements
- check for and remove patch for multi-partition/reset_ak (so removal of ramdisk/ and patch/ with the addition of $(basename block)-files is now the full trigger)
- wipe $(basename block)-files/ramdisk to ensure proper copied output, as the original contents are retained in the copied rdtmp
- for ramdisk-only changes that don't require added files or patch snippets, create the $(basename block)-files subfolder for proper output backup with reset_ak
2018-03-23 11:32:59 -03:00
osm0sis d7c56e9c06 AK2: improve/expand multi-partition use cases
- if no ramdisk is found in the zip, check for and copy files in from "$(basename $block)-files", e.g. boot-files + recovery-files subfolders, each which can contain their own zImage, and ramdisk and patch subfolders, etc.
- as part of the reset_ak command, copy the output files back to the corresponding *-files subfolder for use in debugging
* when ak2-core.sh gets run again by reset_ak after changing block= in anykernel.sh the above process begins again
2018-03-22 18:51:01 -03:00
osm0sis 1176e19406 AK2: only AVB sign if dumped original dumped image is signed (#20)
- avoids issues for broad AK2-based mod zips on devices where AVB 1.0 signed images cause issues, while maintaining signing on AVB 1.0 devices
2018-03-22 14:14:23 -03:00
osm0sis a4332bda2a README: document restore_file, add mkbootfs warning, fixes 2018-03-22 13:51:43 -03:00
osm0sis 4a7014d5aa AK2: add restore_file for use with ramdisk-only in a restore zip (#19)
thanks @Zackptg5
2018-03-22 13:42:57 -03:00
Zackptg5 722da17775 Backend: Add mkdir for modules (#23) 2018-03-20 22:18:51 -03:00
osm0sis 3baf2a564a README: update now that elftool is available in AIK-mobile 2018-03-20 00:11:23 -03:00
osm0sis ab830140ca README: add support thread 2018-03-17 13:41:27 -03:00
osm0sis 0acab592bb README: update for file_getprop 2018-03-07 15:17:12 -04:00
osm0sis 865564032d AK2: add file_getprop
- was only available in the update-binary, so allow in anykernel.sh as well, for use with checking /system/build.prop, /default.prop, $ramdisk/default.prop, etc.
2018-03-07 15:15:41 -04:00
osm0sis 07cc7c31ce AK2: fix section functions with "" for next-blank-line end search 2018-03-07 14:24:39 -04:00
osm0sis 55ab97f6ec AK2: improve section functions, improve size check
- clean up false error output where sections are already removed on repeat flashes
- move size check to just before flash since we must compare against the fully repacked, signed boot-new.img
2018-03-07 10:52:14 -04:00
osm0sis c81b3d5658 AK2: add Nook HD+ and Nook Tablet signing loader support 2018-03-05 17:09:51 -04:00
osm0sis 1e3d48355e README: update for banner and version file support 2018-02-28 09:14:35 -04:00
Chris Renshaw 14e73ecbec AK2: fix cpio extraction with busybox 1.28+
"cpio: skipping unsafe symlink to '/system/vendor' in archive, set EXTRACT_UNSAFE_SYMLINKS=1 to extract", introduced by https://git.busybox.net/busybox/commit/?id=bc9bbeb2b81001e8731cd2ae501c8fccc8d87cc7 
Thanks @nathanchance for the quick heads up
2018-02-27 00:47:57 -04:00
osm0sis 12289267c5 Backend: touch up install whitespace now that we have banner/version display 2018-02-26 13:03:50 -04:00
osm0sis efa4623689 Backend: add custom kernel version display support
- 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-26 12:22:58 -04:00
osm0sis b0a2cae9cd Backend: add custom kernel banner support
- 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-26 11:18:35 -04:00
osm0sis 7391ede9b9 tools: update to latest busybox (1.28.1)
Compiled from my own updated fork:
https://github.com/osm0sis/android-busybox-ndk

ARM binary; see my Odds & Ends for other architectures:
https://forum.xda-developers.com/showthread.php?t=2239421
2018-02-25 13:56:31 -04:00
osm0sis 7b09dd8b66 Backend: fix vendor unmounting 2018-02-25 13:54:45 -04:00
osm0sis e32f6915ef AK2: fix insert_line wc/ash bad number error when missing file 2018-02-25 13:54:43 -04:00
Chris Renshaw 893aef6df2 Merge pull request #16 from Tomoms/master
ak2-core.sh: fix repacking of Sony ELF kernels
2018-01-25 18:31:41 -04:00
Tommaso Fonda e12304ece6 ak2-core.sh: fix repacking of Sony ELF kernels
elftool fails to repack the ELF boot image on Sony devices when a custom dtb file is not provided within the AnyKernel2 zip, because the "dtb" variable, that contains the name of the dtb file, is overridden before the dtb filename is actually passed to the "rpm" variable. Swapping these two lines of code fixes the issue (tested by me on a Sony Xperia SP).
2018-01-25 20:01:40 +01:00
osm0sis 153567dcaf README: document new patch_cmdline usage 2018-01-19 03:00:29 -04:00
osm0sis 2b7501710d AK2: clarify new patch_cmdline usage 2018-01-19 03:00:04 -04:00
osm0sis 83df1e3df1 Backend: only replace getprop if needed (and do so more robustly) 2018-01-19 01:58:49 -04:00
Chris Renshaw 4308266480 Merge pull request #15 from nathanchance/insert-line-offset
AK2: Fix insert_line line validation
2018-01-18 02:01:41 -04:00
Nathan Chancellor 96bc564d58 AK2: Fix insert_line line validation
Currently, trying to use insert_line to insert something on the second
to last line fails and places it on the last line.

AK2 line:

insert_line test "sched_boost 0" after "on property:sys.boot_completed=1" "    write /proc/sys/kernel/sched_boost 0"

Before:

on property:sys.boot_completed=1
    bootchart stop

After:

on property:sys.boot_completed=1
    bootchart stop
    write /proc/sys/kernel/sched_boost 0

Expected result:

on property:sys.boot_completed=1
    write /proc/sys/kernel/sched_boost 0
    bootchart stop

In this example, the file length is 2 but the line we're inserting
at is also 2, which is perfectly fine because everything will get
shifted down by 1. Only if the file length is less than the desired
position (in this example, 3) should be handled by >>. All three
cases are now handled fine by insert_line (position 1, 2, and 3).

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-01-17 16:31:39 -07:00
osm0sis d4f81e628e AK2: add reset_ak(), fix patch_cmdline(), improve AVBv1 signing
- introduce reset_ak function to reset the /tmp/anykernel directory to allow for multi-partition mods; use after changing the AK2 shell (block, etc.) variables again
- make patch_cmdline more intuitive; match the string, and if it doesn't exist add the replacement string, and if so replace with it
- allow AVBv1 signing of recovery by adding simple partition type detection based on name
- restore LD_LIBRARY_PATH after AVBv1 signing to be friendly to recovery when flashed in between other zips
2018-01-15 02:41:23 -04:00
osm0sis 79f1c391ea AK2: allow U-Boot uImage without ramdisk 2018-01-13 17:47:37 -04:00
osm0sis c3ca17f3cf README: update for elftool 2018-01-13 17:47:27 -04:00
osm0sis fb44ff18e1 AK2: add support for repacking as Sony ELF
- add built-in support for elftool for older Sony devices which don't support AOSP boot.img repacks (see: #3, https://forum.xda-developers.com/xperia-j-e/development/arm-elftool-pack-unpack-boot-image-sony-t2146022)
2018-01-13 17:15:51 -04:00
Chris Renshaw 4e31cbd461 Merge pull request #14 from nathanchance/module-contexts
Backend: Only apply contexts to new modules
2018-01-08 12:36:12 -04:00
Nathan Chancellor b0b754c094 Backend: Only apply contexts to new modules
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-08 07:27:12 -07:00
Chris Renshaw d0648af3a5 Merge pull request #13 from nathanchance/moar-modules
Backend: Allow multiple module directories
2018-01-02 09:05:36 -05:00
Nathan Chancellor a0b6db2784 example: Update modules folder for new location handling
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-01-02 06:45:40 -07:00
Nathan Chancellor 218b5774d2 README: Update documentation for modules
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-01-02 06:43:59 -07:00
Nathan Chancellor 6b11373d4a update-binary: Change how we handle modules
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>
2018-01-02 06:38:00 -07:00
osm0sis 81066ed3d7 README: document "OG AK" mode 2017-12-14 13:19:08 -04:00
osm0sis 7f47e21362 AK2: add "OG AK" mode by making the unpack/repack procedure more granular
- split dump_boot into split_boot + unpack_ramdisk and write_boot into repack_ramdisk + flash_boot
- fully backwards compatible as dump_boot and write_boot still exist and call these new functions (i.e. no changes needed to anykernel.sh)
- those that wish to do zImage-only AK2 packages can now use split_boot intead of dump_boot and and flash_boot instead of repack_ramdisk in their anykernel.sh
- add failsafe check for failed boot-new.img creation to ensure abort before wiping target partition in edge cases
2017-12-14 13:03:23 -04:00
osm0sis 13f2018ee3 tools: update to latest builds
Compiled from my own updated forks:
https://github.com/osm0sis/mkbootimg

ARM binaries; see AIK-mobile v3.0 for other architectures and optional binaries:
https://forum.xda-developers.com/showthread.php?t=2073775
2017-12-14 11:45:44 -04:00
osm0sis 79df8fcf0b AK2+Backend: misc fixes
- 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
2017-12-03 08:50:51 -04:00
osm0sis df1999911b README: update for dtbo support 2017-11-29 13:50:02 -04:00
osm0sis 3269b51d28 AK2: add dtbo and Pixel 2 slot prop support
- dtbo may be added as dtbo or dtbo.img to the base of the zip
- new Pixel 2 ro.boot.slot doesn't contain _ like Pixel ro.boot.slot_suffix does

Thanks @nathanchance for the majority of the work and research on this one, via #12
2017-11-29 13:34:51 -04:00
osm0sis 5da00cb54d Example: remove AK2 attribute command confusing to new adopters
DO NOT MERGE if you have already updated your ramdisk properly for your device
2017-11-26 18:19:10 -04:00
osm0sis c578db07ff anykernel: underp ownership, thanks @attack11 2017-11-26 18:14:11 -04:00
osm0sis 45766e2afc AK2: tidy up compression support a little more 2017-11-22 19:31:34 -04:00