From e4497f231eeeb9ae4ce1c40bda48e22b8c48483a Mon Sep 17 00:00:00 2001 From: osm0sis Date: Fri, 7 Jun 2019 23:27:55 -0300 Subject: [PATCH] AK3: clean up "OG AK" mode stderr on images with no kernel/ramdisk present --- tools/ak3-core.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index 531ca00..d789055 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -232,15 +232,15 @@ flash_boot() { $bin/mkmtkhdr --kernel $kernel; kernel=$kernel-mtk; fi; - elif [ "$(ls $split_img/kernel*)" ]; then + elif [ "$(ls $split_img/kernel* 2>/dev/null)" ]; then kernel=$(ls $split_img/kernel* | grep -v 'kernel_dtb' | tail -n1); fi; - if [ "$(ls ramdisk-new.cpio*)" ]; then + if [ "$(ls ramdisk-new.cpio* 2>/dev/null)" ]; then ramdisk=$home/$(ls ramdisk-new.cpio* | tail -n1); elif [ -f "$bin/mkmtkhdr" -a -f "$split_img/boot.img-base" ]; then ramdisk=$split_img/ramdisk.cpio.gz-mtk; else - ramdisk=$(ls $split_img/ramdisk.cpio* | tail -n1); + ramdisk=$(ls $split_img/ramdisk.cpio* 2>/dev/null | tail -n1); fi; for fdt in dt recovery_dtbo dtb; do for i in $home/$fdt $home/$fdt.img $split_img/$fdt; do @@ -274,8 +274,8 @@ flash_boot() { test "$dt" && dt="--dt $dt"; $bin/mkbootimg --kernel $kernel --ramdisk $ramdisk --cmdline "$cmdline" --base $home --pagesize $pagesize --kernel_offset $kerneloff --ramdisk_offset $ramdiskoff --tags_offset "$tagsoff" $dt --output $home/boot-new.img; else - cp -f $kernel kernel; - cp -f $ramdisk ramdisk.cpio; + test "$kernel" && cp -f $kernel kernel; + test "$ramdisk" && cp -f $ramdisk ramdisk.cpio; case $kernel in *-dtb) rm -f kernel_dtb;; esac;