One of the issues I've had with install profiles is the fact that packages (ie: themes/modules) stored within the profiles/$profile folder are often not available during install time, leading to lots of nasty hacks from within install profiles.
An example (in Drupal 6) would be that if you stored your theme in profiles/hostmaster/themes/eldir, the theme_list() would be generated by drupal_maintenance_theme before you could load the install_profile table, and you would not be able to set the theme to eldir, because after completing the system there would be no system table entry for your theme.
This issue also crops up in drush, when we want to provide a listing of all the commands that are active for the site. We are unable to find the commands until we have a full Drupal bootstrap.
The plugin manager would also need to be able to find out which sites are running a specific install profile that is going to be updated, without needing to connect to each individual site's database.
The reason this is a problem, is because this information needs to be available before bootstrap.
The attached patch adds an additional line to the default.settings.php file, which defines the $installed_profile global, from the installer. The global was already defined in the bootstrap.inc, but wasn't being used anywhere.
I was also able to remove some of the conditional code from module_listing, which merely existed as a workaround to the fact that the profile value needs to be available already.
PASSED: [[SimpleTest]]: [MySQL] 25,320 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 25,307 pass(es). View
FAILED: [[SimpleTest]]: [MySQL] 25,295 pass(es), 4 fail(s), and 2 exception(es). View
FAILED: [[SimpleTest]]: [MySQL] 23,295 pass(es), 0 fail(s), and 1 exception(es). View