From a82a9ebb65d4fbc03a80e136159a097168c374e8 Mon Sep 17 00:00:00 2001 From: Nindi Gill Date: Wed, 23 Aug 2023 22:15:51 +1000 Subject: [PATCH] Fix bootable ISOs by reverting shrink logic (#82) --- Mist/Helpers/DiskImageCreator.swift | 8 ++------ Mist/Helpers/TaskManager.swift | 11 ++--------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Mist/Helpers/DiskImageCreator.swift b/Mist/Helpers/DiskImageCreator.swift index 8e7f2e0..d8d2fba 100644 --- a/Mist/Helpers/DiskImageCreator.swift +++ b/Mist/Helpers/DiskImageCreator.swift @@ -24,9 +24,7 @@ struct DiskImageCreator { "-fs", "JHFS+", "-layout", "SPUD", "-size", "\(size)g", - "-volname", url - .lastPathComponent.replacingOccurrences(of: ".resized", with: "") - .replacingOccurrences(of: ".dmg", with: ""), + "-volname", url.lastPathComponent.replacingOccurrences(of: ".dmg", with: ""), url.path ] try await create(url, with: arguments) @@ -45,9 +43,7 @@ struct DiskImageCreator { "hdiutil", "create", "-fs", "HFS+", "-srcFolder", source.path, - "-volname", url - .lastPathComponent.replacingOccurrences(of: ".resized", with: "") - .replacingOccurrences(of: ".dmg", with: ""), + "-volname", url.lastPathComponent.replacingOccurrences(of: ".dmg", with: ""), url.path ] try await create(url, with: arguments) diff --git a/Mist/Helpers/TaskManager.swift b/Mist/Helpers/TaskManager.swift index 9cf28d9..2e150ee 100644 --- a/Mist/Helpers/TaskManager.swift +++ b/Mist/Helpers/TaskManager.swift @@ -430,7 +430,6 @@ class TaskManager: ObservableObject { let temporaryImageURL: URL = temporaryDirectoryURL.appendingPathComponent("\(installer.id).dmg") let createInstallMediaURL: URL = installer.temporaryInstallerURL.appendingPathComponent("/Contents/Resources/createinstallmedia") - let temporaryResizedImageURL: URL = temporaryDirectoryURL.appendingPathComponent("\(installer.id).resized.dmg") let temporaryCDRURL: URL = temporaryDirectoryURL.appendingPathComponent("\(installer.id).cdr") let isoURL: URL = destinationURL.appendingPathComponent(filename.stringWithSubstitutions(name: installer.name, version: installer.version, build: installer.build)) @@ -444,9 +443,6 @@ class TaskManager: ObservableObject { MistTask(type: .create, description: "macOS Installer in temporary Disk Image") { try await InstallMediaCreator.create(createInstallMediaURL, mountPoint: installer.temporaryISOMountPointURL, sierraOrOlder: installer.sierraOrOlder) }, - MistTask(type: .create, description: "resized Disk Image") { - try await DiskImageCreator.create(temporaryResizedImageURL, from: installer.temporaryISOMountPointURL) - }, MistTask(type: .unmount, description: "temporary Disk Image") { if FileManager.default.fileExists(atPath: installer.temporaryISOMountPointURL.path) { try await DiskImageUnmounter.unmount(installer.temporaryISOMountPointURL) @@ -462,11 +458,8 @@ class TaskManager: ObservableObject { try await DiskImageUnmounter.unmount(url) } }, - MistTask(type: .remove, description: "temporary Disk Image") { - try FileManager.default.removeItem(at: temporaryImageURL) - }, - MistTask(type: .convert, description: "resized Disk Image to ISO") { - try await ISOConverter.convert(temporaryResizedImageURL, destination: temporaryCDRURL) + MistTask(type: .convert, description: "temporary Disk Image to ISO") { + try await ISOConverter.convert(temporaryImageURL, destination: temporaryCDRURL) }, MistTask(type: .save, description: "ISO to destination") { try await FileMover.move(temporaryCDRURL, to: isoURL)