Commit Graph
46 Commits
Author SHA1 Message Date
Zackptg5 722da17775 Backend: Add mkdir for modules (#23) 2018-03-20 22:18:51 -03: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 7b09dd8b66 Backend: fix vendor unmounting 2018-02-25 13:54:45 -04:00
osm0sis 83df1e3df1 Backend: only replace getprop if needed (and do so more robustly) 2018-01-19 01:58:49 -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
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 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 65019b0f49 Backend: fix -debugging functionality on abort, clean up abort 2017-09-22 00:18:31 -03:00
osm0sis e6d3b4271e Backend: miscellaneous fixes
- fix busybox getting permissions on some devices where chmod does not accept -R to recurse
- use busybox for more possibly non-standard broken recovery shell commands
- silence some more generally expected/inconsequential stderr
2017-08-20 01:00:45 -03:00
Chris Renshaw db7cb4f306 Backend: fix module copying on devices with links
- symlinks under /system/lib/modules were getting broken, so follow them instead to replace the target file, avoiding issues with multiple versions of the same module and running out of free space (e.g. OnePlus devices link /system/lib/modules/wlan.ko to /system/lib/modules/qca_cld3/qca_cld3_wlan.ko)
- set contexts on copied modules (following symlinks) to system_file to avoid SELinux issues where unlabeled module files might not be allowed to load
2017-08-14 02:46:18 -03:00
osm0sis c4d0ed8f9c Backend: add developer option to create a debugging archive
- to make it easier to diagnose issues with patches, image creation or flashing, adding "-debugging" to the end of the AK2 zip filename will enable the creation of a tar.gz of the entire /tmp directory after the installation process (but before cleanup, of course), this includes recovery.log, boot.img, boot-new.img and any other remnants to allow more thorough, direct debugging at a later time
2017-05-28 18:44:46 -03:00
osm0sis 633e042fc6 AK2+Backend: tidy up remaining intentional stderr
- no need to see these when there is an expected error during normal use
2017-05-26 22:57:13 -03:00
osm0sis 2fcc7e6c21 Backend: don't check anykernel.sh before it's been extracted
- if it does not exist yet (i.e. hasn't been extracted) then assume cleanuponabort=1 since there wouldn't be anything to see on a failed extraction
- hide any missing file errors from file_getprop here now that we've taken care of that case
2017-05-26 22:30:54 -03:00
osm0sis 9e3135e8d9 Backend: ensure we've got a POSIX accepting chown via our busybox
- per https://github.com/osm0sis/AnyKernel2/pull/10#issuecomment-283771783
2017-03-02 16:35:38 -04:00
axxx007xxxz aaef99b696 META-INF: update-binary: Remove deprecated chown command
"Some older scripts may still use ‘.’ in place of the ‘:’ separator. POSIX 1003.1-2001 does not require support for that, but for backward compatibility GNU chown supports ‘.’ so long as no ambiguity results. New scripts should avoid the use of ‘.’ because it is not portable, and because it has undesirable results if the entire owner‘.’group happens to identify a user whose name contains ‘.’."
Source: http://gnu.org/software/coreutils/manual/html_node/chown-invocation.html#chown-invocation.
2017-03-02 21:10:31 +01:00
osm0sis b663e79a19 Backend: remove init.d directory creation
- fairly pointless and seemed to confuse new adopters, who thought it alone added init.d support to a ROM
2017-02-27 16:11:35 -04:00
axxx007xxxz f7992be0a3 Introduce cleanuponabort
This option allow to remove the working directory in case of abort; disabled by default.
2017-02-27 16:06:04 -04:00
axxx007xxxz 2129ee98e2 META-INF: update-binary: Clean up before starting the flashing process
In this way if there were files left from previous installations they get deleted.
2017-02-27 16:06:03 -04:00
axxx007xxxz 7aebdb2efd META-INF: update-binary: Make cleanup a function 2017-02-27 16:06:01 -04:00
osm0sis a16879e4ca Backend: support /system/system (Pixel layout) for do.initd+do.modules 2017-01-16 15:18:21 -04:00
osm0sis 8f5c3287a7 Backend: actually fix Nougat toybox mount a la 0ab42ee3ec
- sigh.. option order also matters
2016-12-12 15:58:19 -04:00
osm0sis 0ab42ee3ec Backend: Fixes for mount on certain Nougat+ toybox implementations 2016-11-30 21:24:07 -04:00
osm0sis f0bc44a8db Backend: use included busybox to create install environment symlinks
- fixes flashing slowdown in TWRP 3.0.0: TWRP3 (currently) appears to have a bugged busybox/ln command which takes an excessive amount of time, no reason not to use our own instead
2016-02-23 17:00:19 -04:00
osm0sis cbcbc49e13 Backend: Add check for whether busybox symlink setup succeeded, fixes
- fail on recoveries where symlinking our busybox environment doesn't work (CM Recovery on some devices)
- use the included busybox for awk since toybox is lacking (CM Recovery)
2016-02-16 16:42:18 -04:00
osm0sis 408d06aff0 Backend+AK2: misc fixes
- fix fallback broken unzip detection now that we create a subdirectory prior
- probably best to execute the bump/loki/whatever script using our included ash shell instead of the recovery sh.
2016-01-24 13:32:13 -04:00
osm0sis c79016cd39 Backend: workaround toybox inclusion in Cyanogen Recovery
- add busybox to the zip to provide a uniform expected environment
- set up busybox symlinks in /tmp and execute anykernel.sh from a shell created with these at the front of the path, overriding the recovery applets
2016-01-24 13:31:55 -04:00
osm0sis bd4ba60cc5 AnyKernel2: custom user script support, fixes
- fix copy of any subdirectories under modules/
- adjust display of modules installation text to match the others
- add support for custom user scripts (at /data/custom_boot_image_patch.sh - same as latest SuperSU zips) to automatically execute before reflashing the rebuilt boot image for bump, loki etc. modifications
2015-12-23 13:19:32 -04:00
osm0sis af7a85316b Backend fixes: unzip error catching, only mount system rw if necessary
- initial unzip verification to catch it early on broken recoveries/zips
- display the matching name during the devicecheck while installing
- mount /system ro for the off-chance getprop relies on build.prop (older recoveries), and only remount rw if init.d or modules need to be setup/installed to fix/workaround TWRP's "mount only as ro" feature being finicky and allow /system to remain untouched on devices supporting systemless root.
- add signing documentation to README
2015-12-04 10:16:13 -04:00
osm0sis 5112f2e4ae AnyKernel2: various fixes, new features
- fix insert_line to perform more as expected by adding a newline automatically
- add updated arm mkbootimg+unpackbootimg binaries from my AIK Build Farm, see my repos for changes
- rewrite backend to use proper exit codes from anykernel.sh now that it is shell
- fix ui_print and specific error messages by passing the outfd to anykernel.sh from the backend
- add error messages for unpacking and repacking ramdisk, and make resulting image size check into its own error message
- fix for cpio overwriting AK2 ramdisk files on some recoveries by using a tmp directory
- add further ramdisk unpack verification by checking that there are actually files in the ramdisk directory prior to moving the tmp files back
- add insert_file function to make multi-line additions easier
- add patch_fstab function to greatly simplify mount option/flag changes (thanks @Khaon for the idea)
2015-11-17 11:05:58 -04:00
Christian Oder 10da80703d Fix flashing of zips inside directories with spaces in their names
It seems like the " in Line 6 are not enough, unzip still refused to unpack files inside a directory with a space in it's name.
The new " fix that and now allow us to flash zips inside folders with spaces in their names.
2015-07-28 22:45:49 +02:00
osm0sis 611804253b AnyKernel 2.0: shell update-binary, new features
- rewrite update-script as a shell script update-binary replacement, making the zip architecture independent (tools are still dependent)
- add fall-back to included zImage to allow for ramdisk-only injections
2015-01-07 15:23:10 -04:00
osm0sis bcfd2e0ff2 AnyKernel 2.0: more new features
- add support for up to 5 device.name properties for variants
- add support for custom dtb swapping (falls back to included if none found in zip root)
- fix ramdisk extraction when there is none in the zip (ie. nothing to be added)
2014-10-14 16:37:48 -03:00
osm0sis 7ffb3bb1aa anykernel.sh: add basic exit statuses
- add exit codes to trigger the abort in the updater-script if something goes wrong
- add ui_print function to write error message directly back to recovery
- compare size of dumped image and new image and abort if the new image is oversized for the partition
2014-08-27 02:24:58 -03:00
osm0sis b7a0960e1d AnyKernel 2.0: add new features
- add new do.modules property
- add new remove_line method
- update insert_line with ability to change insertion point to before or after the matched line
- rearrange properties into the order they are executed
- fix minor cpio warnings (only visible when run manually)
- clean up sed syntax formatting
- README updates for new features and fix zip command to exclude README and any previous zip present.
2014-08-27 02:22:53 -03:00
osm0sis 7e80ad9fa2 updater-script: TWRP fixes
- fix output and line spacing on TWRP
- fix broken unpack/repack on TWRP due to binaries in /tmp not being
allowed to execute unless /system was mounted (weird)
2014-05-15 20:07:00 -03:00
osm0sis ad031d587e AnyKernel 2.0: allow for ramdisk modifications 2014-02-28 21:50:22 -04:00
n-i-x 99dd30cb81 Send the correct arguments for the bundled version of unpackbootimg 2011-07-15 15:21:02 -07:00
Koushik Dutta 8bbe6b3589 Edited META-INF/com/google/android/updater-script via GitHub 2011-05-01 22:54:00 -07:00
Koushik Dutta a09a6f16d9 Changes to work on MMC and BML devices. 2010-12-21 09:46:05 -08:00
Koushik Dutta b0e8859ad8 generic update-binary 2010-05-01 21:11:18 -07:00
Koushik Dutta 8fef580ac7 fix more bugssss 2010-04-20 00:05:56 -07:00
Koushik Dutta 84231181e8 bug fixes 2010-04-19 23:43:39 -07:00
Koushik Dutta 2f5b3be9e1 Use the outputted cmdline and base files, so specifying it is not necessary. 2010-04-16 14:27:06 -07:00
Koushik K. Dutta 891a9bc01a initial commit 2010-04-12 11:18:07 -07:00