* build.sh: Unmount intermediates on trap
Iterate through image files which might be in use and detach them
Avoid silent failures - let the user know whether the build failed
* common: update unmount_image
Use udevadm settle instead of sleep if possible
Use losetup's -j option to find the loop device associated with a give image file
* build.sh: update clean-up trap term
---------
Co-authored-by: Serge Schneider <serge@raspberrypi.com>
* Compare mount output using base of dirname
If you're building from a bind-mounted directory, the build will
fail as it will find two entries to unmount, but a single unmount
will remove them both causing an error. Adding a space means that
the mountpoint will only match with a single mount entry ; the
expected path, rather than the pre bind-mount.
* Switch to awk instead of mount, grep, cut pipes
Retry unmount 5 times and give up, letting the user know that they need to resolve the issue manually
---------
Co-authored-by: David Peverley <pev@analogue-micro.com>
Co-authored-by: Serge Schneider <serge@raspberrypi.com>
Although the loop block device is created before attaching the image
to it, the devices for the partition that the image contains are still
not created. This patch creates those devices as well, when they are
not already available.
Fixes#482
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
Format the root partition with the metadata_csum option
Format the boot partition with 4 sectors per cluster for a slight performance boost
Remove 'flush' mount option from the boot partition
When building on a native ARM platform, binfmt_misc is not
required to be loaded. This change checks the machine type
and if it's a ARM platform, skip the binfmt_misc validation.
* Tidy up and simplify function code
* Allow to pass extra arguments to debootstrap, e.g. `--variant minbase`
* Preserve compatibility with existing function calls