mmgen / mmgen-geek-tools

Random scripts to make a geek’s life easier
GNU General Public License v3.0
15 stars 5 forks source link

Target is busy #9

Closed AntoninHuaut closed 1 year ago

AntoninHuaut commented 1 year ago

Hi, I try this script on a Banana Pi M5 with the Armbian_22.08.7_Bananapim5_bullseye_edge_5.19.16_xfce_desktop image.

I tested the script on the SD card, it works if I indicate the -C parameter, otherwise I get errors on the cleanup at the end on the umount commands (target is busy).

However, I would like to do it on the eMMC: after the partitions are created via fdisk, the script crashes:

umount: /home/<user>/Downloads/armbian_rootenc_build/boot: target is busy
armbian_rootenc_setup.sh:652: _add_state_file() failed at command 'umount $BOOT_ROOT'
Host script exiting with error (32)

Parameters used:

AntoninHuaut commented 1 year ago

I was able to get the script to work on the eMMC, re-running the script 5-6 times on each crash with the same settings. Since it retains its state of progress, this allowed me to do a few steps each time. I don't know if it is possible to make umount optional, or to wait until the target is not busy anymore? By the way, thanks a lot for this script!

mmgen commented 1 year ago

Given that the script fails inconsistently, this could be a timing issue: adding a delay before the umount might fix it.

I don't have a Banana Pi M5 to test with, unfortunately, but good to know that the script works (sort of) with this board.

AntoninHuaut commented 1 year ago

Given that the script fails inconsistently, this could be a timing issue: adding a delay before the umount might fix it.

I don't have a Banana Pi M5 to test with, unfortunately, but good to know that the script works (sort of) with this board.

I didn't think it would work but adding a sleep 1 before each umount solves the problem. Thanks a lot! I'm going to create a pull request, I think adding a few "sleep 1" isn't a big deal if it increases compatibility.