Hello,
First of all, I’m LOVING AutoDMG - Thank you so much for creating it!!
I’ve come across a small glitch in the newest 1.3.2 version that is preventing me from building my image. It seems to come from the code that calculates the installed size of packages, so I didn’t have this problem in earlier versions.
Basically, I’m trying to add an PKG for Print drivers for the Canon ImageRunner 1025if downloaded from the following site:
http://www.usa.canon.com/cusa/support/office/b_w_imagerunner_copiers/imageRUNNER_1025_1025n_1025if/imagerunner_1025if#DriversAndSoftware
Unfortunately, when I take a closer look at this Package, it literally contains about 225 small sub-packages (WTF), which causes the installer command to fail, which in turn causes AutoDMG to fail... The error I get is as follows:
28 mars 2014 11:29:37 AM UTC−7 /Volumes/Passport/AutoDMG/Packages/Printing/Printing-Canon-UFRII_LT_LIPS_LX_Installer.mpkg
28 mars 2014 11:29:43 AM UTC−7 installer -pkginfo -pkg '/Volumes/Passport/AutoDMG/Packages/Printing/Printing-Canon-UFRII_LT_LIPS_LX_Installer.mpkg' failed with exit code -11
28 mars 2014 11:29:43 AM UTC−7 Build failed: Failed to determine installed size
28 mars 2014 11:29:43 AM UTC−7 Unable to determine installation size requirements for /Volumes/Passport/AutoDMG/Packages/Printing/Printing-Canon-UFRII_LT_LIPS_LX_Installer.mpkg
Interestingly, Greg Neagle has dealt with the exact same issue with Munki, with the exact same Installer Package — I found that conversation and his resolution here: https://groups.google.com/forum/#!topic/munki-dev/mfash_Bu0Pc
After some tracking down, the affected code seems to be in IEDUtil.py, under the getInstalledPkgSize_(cos, pkgPath): section…
The command to use installer to get the size (/usr/sbin/installer pkginfo -verbose -plist -pkg /path/to/package) literally causes a segmentation fault, even when run directly from Terminal, like so:
1 0x7fff8de82bae JSGlobalContextCreateInGroup
2 0x10524396e IFJS_GlobalContextCreate
3 0x105215ea9 -[IFDJavaScriptEngine initWithScript:allowInsecure:]
4 0x10521ee42 -[IFDCustomizationController(Private) _createItemsFromDistribution]
5 0x10521eb4e -[IFDCustomizationController reset]
6 0x10521ea1c -[IFDCustomizationController(DistributionPrivate) initWithInstallController:andTarget:]
7 0x1052704f7 -[IFDInstallController(Private) customizationControllerForTarget:ignoringContents:]
8 0x105201fc0
9 0x1052020fb
10 0x105200edd
11 0x1051ff2d9
12 0x10520485c
13 0x105204a73
14 0x7fff9025a5fd start
Segmentation fault: 11
Normally I'd probably just rebuild the installer package, but with 225 sub-packages and some logic it's way more complex then it should be.
Instead, for now I’ve managed to bypass the issue by tweaking the error handling in the code where it deals with the return code of the subprocess.Popen command. I’ve never really done any coding in Python, so I’m sure this could be done much more gracefully - for now I’ve basically commented out the part that logs the error, instead I'm directly calling your getPackageSize_ code, as seen below:
if p.returncode != 0:
mountPoints = IEDMountInfo.getMountPoints()
fsInfo = mountPoints[cls.findMountPoint_(pkgPath)]
if not fsInfo[u"islocal"]:
LogWarning(u"Estimating package size since installer -pkginfo " \
u"failed and '%@' is on a remote (%@) filesystem",
pkgPath, fsInfo[u"fstypename"])
return cls.getPackageSize_(pkgPath) * 2
else:
#LogError(u"installer -pkginfo -pkg '%@' failed with exit code %d", pkgPath, p.returncode)
#return None
LogWarning(u"Estimating package size since installer -pkginfo " \
u"crashed trying to calculate '%@'",
pkgPath)
return cls.getPackageSize_(pkgPath) * 2
I’d love to see a fix in the main stream of AutoDMG, as I really don’t want to have to port this fix back to every updated version ;).