mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-27 04:49:18 +00:00
Use truncate instead of dd
This commit is contained in:
parent
a2a323cdb8
commit
c2c0d5cbf7
@ -221,7 +221,7 @@ function createDrive() {
|
|||||||
|
|
||||||
if [ ! -f $drivePath ]; then
|
if [ ! -f $drivePath ]; then
|
||||||
echo "Creating a ${driveSize}MB Drive"
|
echo "Creating a ${driveSize}MB Drive"
|
||||||
dd if=/dev/zero of=$drivePath bs=1M count=$driveSize
|
truncate --size ${driveSize}m $drivePath
|
||||||
|
|
||||||
echo "Formatting drive with HFS"
|
echo "Formatting drive with HFS"
|
||||||
formatDrive "$drivePath" "$driveName"
|
formatDrive "$drivePath" "$driveName"
|
||||||
|
@ -17,7 +17,7 @@ def create_new_image(file_name, type, size):
|
|||||||
file_name = file_name + "." + type
|
file_name = file_name + "." + type
|
||||||
|
|
||||||
return subprocess.run(
|
return subprocess.run(
|
||||||
["dd", "if=/dev/zero", "of=" + base_dir + file_name, "bs=1M", "count=" + size],
|
["truncate", "--size", f"{size}m", f"{base_dir}{file_name}"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user