AK2: misc cleanups

- hide unpackelf test stderr
- accept dtb and dt.img for dt
This commit is contained in:
osm0sis committed 2017-04-10 20:03:33 -03:00
1 parent 39cdd433bd
commit b31389512f
1 file changed
+8 -4
+8 -4
View File
@@ -32,7 +32,7 @@ dump_boot() {
else
dd if=$block of=/tmp/anykernel/boot.img;
fi;
if [ -f "$bin/unpackelf" -a "$($bin/unpackelf -i /tmp/anykernel/boot.img -h -q; echo $?)" == 0 ]; then
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;
else
@@ -102,9 +102,13 @@ write_boot() {
kernel=`ls *-zImage`;
kernel=$split_img/$kernel;
fi;
if [ -f /tmp/anykernel/dtb ]; then
dtb="--dt /tmp/anykernel/dtb";
elif [ -f *-dtb ]; then
for i in dtb dt.img; do
if [ -f /tmp/anykernel/$i ]; then
dtb="--dt /tmp/anykernel/$i";
break;
fi;
done;
if [ ! "$dtb" -a -f *-dtb ]; then
dtb=`ls *-dtb`;
dtb="--dt $split_img/$dtb";
fi;