aviral2552 / macOS-toolkit

A collection of macOS utilities and workarounds that may interest a developer/power user who is using the platform.
GNU General Public License v3.0
63 stars 22 forks source link

Could not recognize "/tmp/osx-image.A8E/input_mount/BaseSystem.dmg" as an image file #4

Open 418910232 opened 4 years ago

418910232 commented 4 years ago

Hi, it reports below error:

-e Restoring BaseSystem.dmg... Validating target...done Validating source... Could not recognize "/tmp/osx-image.A8E/input_mount/BaseSystem.dmg" as an image file Could not validate source - Invalid argument -e Could not mount BaseSystem.dmg.

Platform:macOS 10.13.6

aviral2552 commented 3 years ago

@418910232 I am not sure if this is still relevant but please try the following:

  1. Ensure that you have enough disk space available (>6 GB for High Sierra).
  2. Put the script in a known folder such as Desktop and then execute it.
  3. If that still doesn't work, download the installation image from the App Store again.

Let me know if it still doesn't work and I will try to investigate what's going on. Cheers!

wolfferine commented 2 years ago

Hi,

The issue ( "Could not recognize "/tmp/osx-image.Mxx/input_mount/BaseSystem.dmg" as an image file" ) as mentioned by @418910232, still occurs, see below :

_Following 2 macOS/OS X installer(s) found. Please Select:

1) macOS 10.13 (High Sierra) 2) macOS 10.14 (High Mojave)

0) Specifiy InstallESD.dmg path

q) Quit

Enter a number or 'q': 1 Enter the output directory (default: /Users/sysman/Desktop): Attaching InstallESD.dmg... /dev/disk7 GUID_partition_scheme
/dev/disk7s1 EFI
/dev/disk7s2 Apple_HFS /private/tmp/osx-image.Mxx/input_mount Creating sparse image... created: /tmp/osx-image.Mxx/osx.sparseimage Mounting sparse image... /dev/disk8 Apple_partition_scheme
/dev/disk8s1 Apple_partition_map
/dev/disk8s2 Apple_HFS /private/tmp/osx-image.Mxx/build_mount Restoring BaseSystem.dmg... Validating target...done Validating source... Could not recognize "/tmp/osx-image.Mxx/inputmount/BaseSystem.dmg" as an image file Could not validate source - Invalid argument Could not mount BaseSystem.dmg. "disk8" ejected. "disk7" ejected.

aviral2552 commented 2 years ago

Hi @wolfferine,

It seems like that the script is failing at

asr restore -source "${INPUT_MOUNT}/BaseSystem.dmg" -target "${BUILD_MOUNT}" -noprompt -noverify -erase

At first glance, I think this has something to do with BaseSystem.dmg file. Could you trying manually deleting the BaseSystem.dmg file and then running the script again?

I unfortunately do not have a macOS system handy with me to test it out.