Fix bootable ISOs by reverting shrink logic (#82)

This commit is contained in:
Nindi Gill 2023-08-23 22:15:51 +10:00 committed by GitHub
parent 55ad1f84ce
commit a82a9ebb65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 15 deletions

View file

@ -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)

View file

@ -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)