18 April 2010

How I Created the "HPM311DP_0410HF5RC1" Installer

As promised, here's how I made the current HPM311DP_0410HF5RC1.pkg installer that automatically configures EFI boot on your Mini 311's internal hard drive, ready for that 10.6.3 Update. But I'm still not feeling so well so I'm afraid you'll have to read up on the Apple Developer site for more details. What you'll see here is a rough narration of how I got the sources and tweaked and repackaged it again.

First off, I didn't exactly start from scratch. The HF4 release contained the sources, well, that is, some of it. The folder structure that should be used was explicitly shown:
So this was the file structure I should implement. I swapped out kexts, boot files, themes, etc. inside that folder that I copied locally to my drive. And working with Package Maker, here's what I had:
I gave the package a name: "HP Mini 311 HF5 RC1". 
I set "User Sees" to "Easy Install Only" to keep it really simple.
And the for "Install Destination", I set it to "System Volume".
Installation of this package was meant to be fool-proof and as straightforward as possible. The user won't be given the chance to stray from what I wanted to happen.
Now for the package content itself. I had created a folder "EFI_Files" and put there everything I got from the HF4 source. The file structure is important, so I had to bear in mind that this EFI_Files folder was to be my project's "root" folder.
I dragged the whole folder in the "Contents" column.
Made sure 'Destination" is set to "/". 
Put a Packager Identifier just for the sake of having one - Package Maker wants this filled up.
I couldn't really care less for Package Version and Restart Action but I did want to have the user authenticate first, hence I enabled "Require admin authentication"
Now looking at the screenshot above, you'll have a better understanding of this "EFI_Files" folder as "root" project folder. At this point, we've made a parallelism between the Install Destination "/" and "EFI_Folder":
"EFI_Folder/Volumes/EFI/Extra/Extensions" becomes "/Volumes/EFI/Extra/Extensions" later on in the actual installation process when the built package is run.
These are the kexts that are gonna be installed.

Now the most important part: Scripts.
Without them, you'll end up building a package that when installed only copies the contents of EFI_Files onto your main "/" directory. Not exactly what we wanted to happen.
This is also why I said earlier that HF4 contained some but not all source. The all important scripts weren't as explicitly indicated as the folder structure for the project. Actually I bet that they were NOT at all meant to available to the general public - keeping code secret is part of human nature. But then HP Mini 311 Darwin Project must be kept alive and so we use Pacifist to extract those scripts.

Of course I exerted effort myself and edited the post install script to implement the changes I wanted to happen during installation. And then I mapped their location - preinstall script goes to "Preinstall" and postinstall script goes to "Postinstall". 
Here are the scripts. You can edit them with a text editor to incorporate the changes you'd like for your own package.

You can edit the interface and include custom background and texts that will be displayed on specific frames as the install process unfolds and the user clicks on buttons on the dialog box.
For detailed instructions to this, please consult the Apple Package Maker documentation.
To end my little narrative, I finished by saving changes to the package, closing the interface editor window.
Once I was back to the main Package Maker window, I clicked on the "Build" icon to create a .pkg file that can be distributed and run.
You'll be asked for the location where to save the resulting .pkg file.
And you're done.





1 comment:

cgdavilab said...
This comment has been removed by the author.