mkimage.sh loops forever

I’m trying to follow this tutorial and it looks like mkimage.sh loops forever (I stopped watch when processing system.img reached 9.5GB interestingly du show about 470MB).

[16:22:51] pietrushnic:firefly-rk3288 git:(master*) $ ./mkimage.sh
TARGET_PRODUCT=rk3288
TARGET_HARDWARE=rk30board
system filesysystem is ext4
create boot.img without kernel… done.
create recovery.img with kernel and with out resource… done.
create misc.img… done.
create system.img…

I’m using e2f2ba5dd349 tag: Firefly-RK3288_Android4.4_201504181055. I wonder what is the purpose of loop in mkimage.sh:

              while [ "$ok" = "0" ]; do
                      make_ext4fs -l $system_size $MAKE_EXT4FS_ARGS >/dev/null 2>&1 &&
                      tune2fs -c -1 -i 0 $IMAGE_PATH/system.img >/dev/null 2>&1 &&
                      ok=1 || system_size=$(($system_size + 5242880))
              done

Looks like I’m looping here forever. My system.img from ./out/target/product/rk3288/system.img file size is 399306712.

Any idea how to pass mkimage.sh script ?

Probably your “losetup” device is busy…
Try restarting your machine an see if it can create the image…
It needs to add a loop back device and mount to copy the system image.
Sometimes the loop back device is occupied and it cannot create other loop back device.
Restart and test…

You can get a list of loop back devices currently in use by command “losetup -a”

Thanks for reply.

Ok the key information was that it should create loop device. it need root privileges to to do that.

sudo ./mkimage.sh

Did the trick. Thanks for helping out.

BTW to check loop devices

losetup -a

should be used at least for Debian.

Such an incredible article, I’m thankful for your generosity in sharing it. The AD0-E605 valid test cram sheet file material is top-quality, and it’s available to you free of charge.

Your article really made a difference to me, thank you. This is the HPE7-A01 reliable study notes exam that helped me get promoted and earn a pay raise. It’s available for free today—good luck with your career goals!