diff options
author | osm0sis <osm0sis@outlook.com> | 2015-01-07 15:11:36 -0400 |
---|---|---|
committer | osm0sis <osm0sis@outlook.com> | 2015-01-07 15:23:10 -0400 |
commit | 611804253ba54b6b9b58ee3aa7c50ed836cace4f (patch) | |
tree | 4bed4f16348a8536927692a0e1a8e00f5297adb0 /anykernel.sh | |
parent | bcfd2e0ff24e8740b36dfdda9221b87c7d7c0dfd (diff) |
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
Diffstat (limited to 'anykernel.sh')
-rwxr-xr-x | anykernel.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/anykernel.sh b/anykernel.sh index d65ca13..db207c6 100755 --- a/anykernel.sh +++ b/anykernel.sh @@ -61,6 +61,12 @@ write_boot() { secondoff=`cat *-secondoff`; secondoff="--second_offset $secondoff"; fi; + if [ -f /tmp/anykernel/zImage ]; then + kernel=/tmp/anykernel/zImage; + else + kernel=`ls *-zImage`; + kernel=$split_img/$kernel; + fi; if [ -f /tmp/anykernel/dtb ]; then dtb="--dt /tmp/anykernel/dtb"; elif [ -f *-dtb ]; then @@ -69,7 +75,7 @@ write_boot() { fi; cd $ramdisk; find . | cpio -H newc -o | gzip > /tmp/anykernel/ramdisk-new.cpio.gz; - $bin/mkbootimg --kernel /tmp/anykernel/zImage --ramdisk /tmp/anykernel/ramdisk-new.cpio.gz $second --cmdline "$cmdline" --board "$board" --base $base --pagesize $pagesize --kernel_offset $kerneloff --ramdisk_offset $ramdiskoff $secondoff --tags_offset $tagsoff $dtb --output /tmp/anykernel/boot-new.img; + $bin/mkbootimg --kernel $kernel --ramdisk /tmp/anykernel/ramdisk-new.cpio.gz $second --cmdline "$cmdline" --board "$board" --base $base --pagesize $pagesize --kernel_offset $kerneloff --ramdisk_offset $ramdiskoff $secondoff --tags_offset $tagsoff $dtb --output /tmp/anykernel/boot-new.img; if [ $? != 0 -o `wc -c < /tmp/anykernel/boot-new.img` -gt `wc -c < /tmp/anykernel/boot.img` ]; then ui_print " "; ui_print "Repacking image failed. Aborting..."; echo 1 > /tmp/anykernel/exitcode; exit; |