Merge pull request #158 from doraskayo/losetup-partitions

Add -P to the losetup command
This commit is contained in:
Andrius Štikonas 2022-05-10 20:41:22 +01:00 committed by GitHub
commit 937964fd4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,7 @@ def create_disk(image, disk_type, fs_type, size):
run('truncate', '-s', size, image)
# First find the device we will use, then actually use it
loop_dev = run('sudo', 'losetup', '-f', capture_output=True).stdout.decode().strip()
run('sudo', 'losetup', loop_dev, image)
run('sudo', 'losetup', '-P', loop_dev, image)
# Create the partition
run('sudo', 'parted', '--script', image, 'mklabel', disk_type, 'mkpart',
'primary', 'ext4', '0%', '100%')