This checks for /sys/modules/loop before modprobing the loop module. My understanding is that if this module is built into the kernel, that this directory is still created. For a kernel without loop built in, losetup.py will try to load the module using modprobe.
This commit is contained in:
parent
ec77bdb1d3
commit
4204a86992
|
@ -27,7 +27,8 @@ import pmb.chroot
|
|||
|
||||
|
||||
def init(args):
|
||||
pmb.helpers.run.root(args, ["modprobe", "loop"])
|
||||
if not os.path.isdir("/sys/module/loop"):
|
||||
pmb.helpers.run.root(args, ["modprobe", "loop"])
|
||||
loopdevices = [loopdev for loopdev in glob.glob("/dev/loop*") if not os.path.isdir(loopdev)]
|
||||
for loopdev in loopdevices:
|
||||
pmb.helpers.mount.bind_blockdevice(args, loopdev,
|
||||
|
|
Loading…
Reference in New Issue