AK2: add KRNL and NOOK signed image support
- add built-in support for rkcrc for Rockchip board devices signed ramdisk image (see: https://github.com/rockchip-linux/rkflashtool) - add built-in detection and support for Barnes & Noble Nook 'Green Loader/Green Recovery' signature
This commit is contained in:
1 parent
c867216f91
commit
66b221ef99
1 file changed
+13
@@ -35,6 +35,11 @@ dump_boot() {
|
||||
else
|
||||
dd if=$block of=/tmp/anykernel/boot.img;
|
||||
fi;
|
||||
if [ "$(strings /tmp/anykernel/boot.img | grep -E 'Green Loader|Green Recovery')" ]; then
|
||||
mv -f /tmp/anykernel/boot.img /tmp/anykernel/boot-orig.img;
|
||||
dd bs=1048576 count=1 conv=notrunc if=/tmp/anykernel/boot-orig.img of=$split_img/boot.img-master_boot.key;
|
||||
dd bs=1048576 skip=1 conv=notrunc if=/tmp/anykernel/boot-orig.img of=/tmp/anykernel/boot.img;
|
||||
fi;
|
||||
if [ -f "$bin/unpackelf" -a "$($bin/unpackelf -i /tmp/anykernel/boot.img -h -q 2>/dev/null; echo $?)" == 0 ]; then
|
||||
$bin/unpackelf -i /tmp/anykernel/boot.img -o $split_img;
|
||||
mv -f $split_img/boot.img-ramdisk.cpio.gz $split_img/boot.img-ramdisk.gz;
|
||||
@@ -55,6 +60,8 @@ dump_boot() {
|
||||
else
|
||||
dumpfail=1;
|
||||
fi;
|
||||
elif [ -f "$bin/rkcrc" ]; then
|
||||
dd bs=4096 skip=8 iflag=skip_bytes conv=notrunc if=/tmp/anykernel/boot.img of=$split_img/boot.img-ramdisk.gz;
|
||||
elif [ -f "$bin/pxa-unpackbootimg" ]; then
|
||||
$bin/pxa-unpackbootimg -i /tmp/anykernel/boot.img -o $split_img;
|
||||
else
|
||||
@@ -173,6 +180,8 @@ write_boot() {
|
||||
fi;
|
||||
if [ -f "$bin/mkimage" ]; then
|
||||
$bin/mkimage -A $arch -O $os -T $type -C $comp -a $addr -e $ep -n "$name" -d $kernel:$ramdisk boot-new.img;
|
||||
elif [ -f "$bin/rkcrc" ]; then
|
||||
$bin/rkcrc -k ramdisk-new.cpio.gz boot-new.img;
|
||||
elif [ -f "$bin/pxa-mkbootimg" ]; then
|
||||
$bin/pxa-mkbootimg --kernel $kernel --ramdisk ramdisk-new.cpio.gz $second --cmdline "$cmdline" --board "$board" --base $base --pagesize $pagesize --kernel_offset $kerneloff --ramdisk_offset $ramdiskoff $secondoff --tags_offset "$tagsoff" --unknown $unknown $dtb --output boot-new.img;
|
||||
else
|
||||
@@ -232,6 +241,10 @@ write_boot() {
|
||||
$bin/dhtbsign -i boot-new.img -o boot-new-signed.img;
|
||||
mv -f boot-new-signed.img boot-new.img;
|
||||
fi;
|
||||
if [ -f "$split_img/boot.img-master_boot.key" ]; then
|
||||
cat $split_img/boot.img-master_boot.key boot-new.img > boot-new-signed.img;
|
||||
mv -f boot-new-signed.img boot-new.img;
|
||||
fi;
|
||||
if [ -f "$bin/flash_erase" -a -f "$bin/nandwrite" ]; then
|
||||
$bin/flash_erase $block 0 0;
|
||||
$bin/nandwrite -p $block /tmp/anykernel/boot-new.img;
|
||||
|
||||
Reference in new issue
Block a user