diff --git a/pmb/helpers/mount.py b/pmb/helpers/mount.py index 1403ebc0..f80b3525 100644 --- a/pmb/helpers/mount.py +++ b/pmb/helpers/mount.py @@ -66,10 +66,10 @@ def bind(args, source, destination, create_folders=True, umount=False): raise RuntimeError("Mount failed: " + source + " -> " + destination) -def bind_blockdevice(args, source, destination): +def bind_file(args, source, destination): """ - Mount a blockdevice with the --bind option, and create the destination - file, if necessary. + Mount a file with the --bind option, and create the destination file, + if necessary. """ # Skip existing mountpoint if ismount(destination): diff --git a/pmb/install/blockdevice.py b/pmb/install/blockdevice.py index 6491141d..13f13aab 100644 --- a/pmb/install/blockdevice.py +++ b/pmb/install/blockdevice.py @@ -36,8 +36,8 @@ def previous_install(args): if not os.path.exists(blockdevice_outside): continue blockdevice_inside = "/dev/sdcardp1" - pmb.helpers.mount.bind_blockdevice(args, blockdevice_outside, - args.work + "/chroot_native" + blockdevice_inside) + pmb.helpers.mount.bind_file(args, blockdevice_outside, + args.work + "/chroot_native" + blockdevice_inside) label = pmb.chroot.root(args, ["blkid", "-s", "LABEL", "-o", "value", blockdevice_inside], output_return=True) pmb.helpers.run.root(args, ["umount", args.work + "/chroot_native" + blockdevice_inside]) @@ -57,8 +57,8 @@ def mount_sdcard(args): raise RuntimeError(path + " is mounted! We will not attempt" " to format this!") logging.info("(native) mount /dev/install (host: " + args.sdcard + ")") - pmb.helpers.mount.bind_blockdevice(args, args.sdcard, - args.work + "/chroot_native/dev/install") + pmb.helpers.mount.bind_file(args, args.sdcard, + args.work + "/chroot_native/dev/install") if previous_install(args): if not pmb.helpers.cli.confirm(args, "WARNING: This device has a" " previous installation of pmOS." @@ -123,8 +123,8 @@ def create_and_mount_image(args, size_boot, size_root): " (" + os.path.basename(img_path) + ")") pmb.install.losetup.mount(args, img_path) device = pmb.install.losetup.device_by_back_file(args, img_path) - pmb.helpers.mount.bind_blockdevice(args, device, args.work + - "/chroot_native" + mount_point) + pmb.helpers.mount.bind_file(args, device, + args.work + "/chroot_native" + mount_point) def create(args, size_boot, size_root): diff --git a/pmb/install/losetup.py b/pmb/install/losetup.py index d11edef4..7c804a34 100644 --- a/pmb/install/losetup.py +++ b/pmb/install/losetup.py @@ -32,8 +32,8 @@ def init(args): 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, - args.work + "/chroot_native/" + loopdev) + pmb.helpers.mount.bind_file(args, loopdev, + args.work + "/chroot_native/" + loopdev) def mount(args, img_path): diff --git a/pmb/install/partition.py b/pmb/install/partition.py index 03afccf8..00e7fbcd 100644 --- a/pmb/install/partition.py +++ b/pmb/install/partition.py @@ -54,7 +54,7 @@ def partitions_mount(args): for i in [1, 2]: source = prefix + partition_prefix + str(i) target = args.work + "/chroot_native/dev/installp" + str(i) - pmb.helpers.mount.bind_blockdevice(args, source, target) + pmb.helpers.mount.bind_file(args, source, target) def partition(args, size_boot):