Installing bootloader fails when install target is /dev/sdXNN

Issue #36 resolved
Moises Henriquez created an issue

I tried an installation where my install target was /dev/sda11. Bootloader failed to install. The exception raised revealed the installer was thought /dev/sda1 was reporting to be mounted, but it was in fact not mounted.

Located the offending code in backend/utils.py

def is_mounted(device):
    """Returns true if device is mounted.

    """
    with open("/proc/mounts") as mounted:
        if device in mounted.read():
            return True
        else:
            return False

The if device in mounted.read() line is too ambiguous. In this case, /proc/mounts did not have an entry for /dev/sda1, but did have one for /dev/sda11. This test is only testing if '/dev/sda1/ is somewhere in that /proc/mounts file. The testing needs to be more specific and match the actual device argument to an entry in /proc/mounts

Comments (2)

  1. Log in to comment