Removed bmap-tools from depends as the check on line 96 looks for bmaptools and would use it if available if not continue to build, but have it as a depend check made the check null and if someone is on a kernel/file-system that does not support SEEK_HOLE and SEEK_DATA the script just fails.
Fixed bmap-tools check as the line which bmaptool >/dev/null 2>&1 does not return 0 so it kept ending at this line, if bmap-tools were not installed
The original code below looks for sparse to be 0 and if which bmaptool >/dev/null 2>&1 returns 0 to use bmap-tools, but I think its the reverse so swapped the last then and else sections as it would then look if sparse is 0 and which bmaptool >/dev/null 2>&1 is 0 to not use bmap-tools, but if it is 1 to use bmap-tools. If tool is available = 1 use bmap-tools, if tools is unavailable=0 do not use bmap-tools:
if [ "${OPT_SPARSE}" -eq 0 ];
then
which bmaptool >/dev/null 2>&1
if [ $? -eq 0 ];
then
echo "[+] Defaulting to sparse image generation as bmaptool is available"
OPT_SPARSE=1
Removed bmap-tools from depends as the check on line 96 looks for bmaptools and would use it if available if not continue to build, but have it as a depend check made the check null and if someone is on a kernel/file-system that does not support SEEK_HOLE and SEEK_DATA the script just fails.
Fixed bmap-tools check as the line which bmaptool >/dev/null 2>&1 does not return 0 so it kept ending at this line, if bmap-tools were not installed
The original code below looks for sparse to be 0 and if which bmaptool >/dev/null 2>&1 returns 0 to use bmap-tools, but I think its the reverse so swapped the last then and else sections as it would then look if sparse is 0 and which bmaptool >/dev/null 2>&1 is 0 to not use bmap-tools, but if it is 1 to use bmap-tools. If tool is available = 1 use bmap-tools, if tools is unavailable=0 do not use bmap-tools:
if [ "${OPT_SPARSE}" -eq 0 ];
then
which bmaptool >/dev/null 2>&1
if [ $? -eq 0 ];
then
echo "[+] Defaulting to sparse image generation as bmaptool is available"
OPT_SPARSE=1