dermotbradley / create-alpine-disk-image

Create cloud-init enabled Alpine disk images for physical machines (PCs & RPIs), VMs, and Cloud servers
GNU General Public License v2.0
93 stars 11 forks source link

Erronous check for `/dev/loop-control` #42

Closed Forza-tng closed 1 year ago

Forza-tng commented 1 year ago

The image script uses the folowing test

write_log "Ensuring that loop driver is loaded (if necessary)" 2
if [ ! -f /dev/loop-control ]; then

However, -f tests for regular files and not character devices, which loop-control is.

# ls -l /dev/loop-control
crw-rw---- 1 root root 10, 237 Jul 15 11:24 /dev/loop-control

Therefore the script should be using -e insteadn

write_log "Ensuring that loop driver is loaded (if necessary)" 2
if [ ! -e /dev/loop-control ]; then
dermotbradley commented 1 year ago

Fixed by #44 using "-c" rather than "-e".