views:

172

answers:

1

To start with I'll say I've read the post here and I'm still having trouble.

I'm trying to create a CE6 image with a hive-based registry that actually stores results through a reboot.

  • I've ticked the hive settings in the catalog items.
  • In common.reg, I've set the location of the hive ([HKEY_LOCAL_MACHINE\init\BootVars] "SystemHive") to "Hard Drive\Registry" (Note: the flash shows up as a device called "Hard Drive")
  • In common.reg, I've set "Flags"=dword:3 in the same place to get the device manager loaded along with the storage manager
  • I've verified that these settings are wrapped in "; HIVE BOOT SECTION"

This is where it starts to fall over. It all compiles fine, but on the target system, when it boots, I get:

  • A directory, called "Hard Disk" where a registry is put
  • A device, name called "Hard Disk2" where the permanent flash is
  • Any changes made to the registry are lost on a reboot

What am I still missing? Why is the registry not being stored on the flash?

Strangly, if I create a random file/directory in the registry directory, it is still there after a reboot, so even though this directory isn't on the other partition (where I tried to put it), it does appear to be permanent. If it is permanent, why don't registry settings save (ie Ethernet adapter IP addresses?)

I'm not using any specific profiles, so I'm at a loss as to what the last step is to make this hive registry a permanent store.

A: 

First, I hope you are not changing common.reg directly. You should never change public code. If you want to change public registry keys you need set them in your project.reg or platform.reg and they will override the public settings.

SystemHive should be set to the name of the directory to which you want to store the hive files without the name of the device. In your case: "SystemHive"="Registry\\system.hv"
Quote from the MSDN source:

Do not include the name of the file system on which the file is stored. The system will determine which file system to use based on other registry settings.


Update regarding your second comment (source):

If this value is present under HKEY_LOCAL_MACHINE, it indicates that the system hive has been restored successfully. If it is present under HKEY_CURRENT_USER, it indicates that the user hive was successfully restored.

Are you flushing the changes you make?
Check that you don't have a wierd implementation of IOCTL_HAL_GET_HIVE_CLEAN_FLAG (source) - your system might be returning a true value to clean the system registry every boot.


You can add a thread that will periodically flush your registry (though I'd recommend excluding it and let each application flush its own changes) - PRJ_ENABLE_REGFLUSH_THREAD

Shaihi
If the device isn't named, that how would the system know that I wanted the files to be stored on a different device?Also, whilst setting the registry location in this way, (which works for the system partition), the registry settings still do not persist. Any changes I make are being lost during a cold restart.
Psychic
Interestingly, I am finding that "RegPersisted"=dword:1 is being placed within HKEY_CURRENT_USER (meaning that the hive was allegedly restored), but not within HKEY_LOCAL_MACHINE. But, any settings that I place in either of the two hives are lost.
Psychic
Psychic