none
Persistentce of Registry RRS feed

  • Question

  • Hi,

    I am working on BeagleBone Black. I needs to implement registry persistent. I also due to customer requirement dismount Boot Partition after launch of Kernel.

    I tried to give different names to Hive directory, everything seems to be created only inside Boot partition. Since Hive directory is inside Boot partition, Flushing of Registry is failing resulting in registry being not persistent.

    Any help to move Hive registry directory from Boot partition to another partition of EMMC will be very useful.

    Thanks and Regards,

    Syed Ahmed M

    Thursday, August 29, 2019 6:57 AM

Answers

    1. Remove ""Flags"=dword:1000" from [HKEY_LOCAL_MACHINE\Drivers\Builtin\SDBusDriver]
    2. Remove "MountAsBootable"=dword:1 from [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\eMMC\Part00]
    3. Add [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\eMMC\Part01] key, set folder name and add "MountAsBootable"=dword:1
    4. Make sure no other profile sets MountAsBootable (open NK.bin in Visual Studio and inspect the registry to make absolutely sure)

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Thursday, August 29, 2019 4:21 PM
    Moderator
  • See my answer above. In short; yes, all is good now. You just need to specify Flags=dword:1000 on the SDHC interface you want to store the hive on (so it loads in bootphase 1) and then specify MountAsBootable on the partition on that SDHC interface you want to store the hive on.

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Thursday, August 29, 2019 4:23 PM
    Moderator

All replies

  • Show us your storage registry settings so we can help.

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Thursday, August 29, 2019 9:26 AM
    Moderator
  • Platform.reg

    ;-------------------------------------------------------------------------------
    ; @CESYSGEN IF FILESYS_FSREGHIVE
    ; HIVE BOOT SECTION
    ;
    ; We want start both storage and device manager. Flags value is combination of
    ;   0x0001  Start storage manager in boot phases 0 and 1 to load the boot
    ;           file system.
    ;   0x0002  Start device manager in boot phase 1 to load the boot file system.
    ;
    [HKEY_LOCAL_MACHINE\init\BootVars]
       "SystemHive"="Documents and Settings\\system.hv"
       "ProfileDir"="Documents and Settings"
       "Flags"=dword:3
       "DefaultUser"="User"
       "Start DevMgr"=dword:1
       "RegistryFlags"=dword:1    ; auto save when modify

    ; END HIVE BOOT SECTION
    ; @CESYSGEN ENDIF FILESYS_FSREGHIVE
    ;-------------------------------------------------------------------------------

    ; @CESYSGEN IF CE_MODULES_SDBUS
    ; HIVE BOOT SECTION
    [HKEY_LOCAL_MACHINE\Drivers\Builtin\SDBusDriver]
    "Order"=dword:15
    "Dll"="SDBus.dll"
    "Prefix"="SDC"
    "Flags"=dword:1000
    "ThreadPriority"=dword:64     ; default thread priority for dispatch thread
    "RequestListDepth"=dword:30   ; pre-allocated requests
    "IClass"=multi_sz:"{20FA98A8-B298-4b32-8D72-C716AEE2FA84}=%b","{6F40791D-300E-44E4-BC38-E0E63CA8375C}=%b"
    ; END HIVE BOOT SECTION
    ; @CESYSGEN ENDIF CE_MODULES_SDBUS


    ; @CESYSGEN IF CE_MODULES_SDMEMORY
    ; HIVE BOOT SECTION

    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMemory]
    IF IMGREGHIVE    
    "MountAsBootable"=dword:1
    "MountPermanent"=dword:1     ; Do not allow un-mounting (else we fail to flush the registry) 
    ENDIF IMGREGHIVE
    ;"Folder"="Storage_Card"
    "Folder"="Storage Card"

    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDHCMemory]
    IF IMGREGHIVE    
    "MountAsBootable"=dword:1
    "MountPermanent"=dword:1     ; Do not allow un-mounting (else we fail to flush the registry) 
    ENDIF IMGREGHIVE
    ;"Folder"="Storage_Card"
    "Folder"="Storage Card"

    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\eMMC]
        "Folder"="Hard Disk"
        "Name"="eMMC Disk"
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\eMMC\Part00]
        "Folder"="BOOT"
    IF IMGREGHIVE    
    "MountAsBootable"=dword:1
    ; "MountPermanent"=dword:1     ; Do not allow un-mounting (else we fail to flush the registry) 
    "MountPermanent"=dword:0
    ENDIF IMGREGHIVE



    ; SD Memory Storage class driver
    [HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class]
    "Dll"="SDMemory.dll"
    "Prefix"="DSK"
    "BlockTransferSize"=dword:40  ; send no more than 64 blocks of data per bus transfer
    ;"SingleBlockWrites"=dword:1  ; alternatively force the driver to use single block access
    ;"IdleTimeout"=dword:7D0      ; 2000 milliseconds
    ;"IdlePowerState"=dword:2     ; 0 == D0, 1 == D1, etc.
    ;"DisablePowerManagement"=""  ; if value present, then disable (remove value to enable)

    "Profile"="SDMemory"
    "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
    "{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

    ; SDHC Memory Storage class driver
    [HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class\High_Capacity]
    "Dll"="SDMemory.dll"
    "Prefix"="DSK"
    "BlockTransferSize"=dword:40  ; send no more than 64 blocks of data per bus transfer
    ;"SingleBlockWrites"=dword:1  ; alternatively force the driver to use single block access
    ;"IdleTimeout"=dword:7D0      ; 2000 milliseconds
    ;"IdlePowerState"=dword:2     ; 0 == D0, 1 == D1, etc.
    ;"DisablePowerManagement"=""  ; if value present, then disable (remove value to enable)

    "Profile"="SDMemory"
    "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
    "{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

    ; MMC Storage Class Driver
    [HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class]
       "Dll"="SDMemory.dll"
       "Prefix"="DSK"
       "BlockTransferSize"=dword:40  ; send no more than 64 blocks of data per bus transfer
       ;"SingleBlockWrites"=dword:1  ; alternatively force the driver to use single block access
       ;"IdleTimeout"=dword:7D0      ; milliseconds
       ;"IdlePowerState"=dword:2     ; 0 == D0, 1 == D1, etc.
       ;"DisablePowerManagement"=""  ; if value present, then disable (remove value to enable)

    ;"Profile"="MMC"
       "Profile"="eMMC"
       "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
                         "{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

    ; eMMC Storage Class Driver
    [HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\eMMC_Class\High_Capacity]
       "Dll"="SDMemory.dll"
       "Prefix"="DSK"
       "BlockTransferSize"=dword:40  ; send no more than 64 blocks of data per bus transfer
       ;"SingleBlockWrites"=dword:1  ; alternatively force the driver to use single block access
       ;"IdleTimeout"=dword:7D0      ; milliseconds
       ;"IdlePowerState"=dword:2     ; 0 == D0, 1 == D1, etc.
       ;"DisablePowerManagement"=""  ; if value present, then disable (remove value to enable)

    ;"Profile"="MMC"
       "Profile"="eMMC"
       "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
                         "{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"
    ; END HIVE BOOT SECTION
    ; @CESYSGEN ENDIF CE_MODULES_SDMEMORY

    SDHC.reg

    ;-------------------------------------------------------------------------------

    IF BSP_SDHC2
    ; @CESYSGEN IF CE_MODULES_SDBUS
    ; HIVE BOOT SECTION
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC2]
        "Prefix"="SHC"
        "Dll"="am33x_sdhc.dll"
        "Index"=dword:2
        "Order"=dword:21
    "Flags"=dword:1000
        "PowerFlags"=dword:00000103         ; send pre/post device state changes

        "SDIOPriority"=dword:d3

        "BaseClockFrequency"=dword:2DC6C00 ; override the max clock rate (48 MHz)
        "SDHighSpeedSupport"=dword:1       ; 1 to enable high speed SD support
    ;    "BaseClockFrequency"=dword:16e3600 ; override the max clock rate (24 MHz default)

        "ReadWriteTimeout"=dword:1000   ; (0x1000 clock ticks default)

        "WakeupSources"=dword:0         ; 0 - no wakeup, 1 - wakeup on SDIO, 
                                        ; 2 - wakeup on card detect, 
                                        ; 3 - wakeup on both

        "FastPath_SDMEM"=dword:0 ; Fast Path Enabled for SD Mem

        "Sdio4BitDisable"=dword:0 ; 1 if SDIO cards must use 1 bit data path, 0 for 4 bit data path
        "SdMem4BitDisable"=dword:0 ; 1 if SD Memory cards must use 1 bit data path, 0 for 4 bit data path
        "MMC8BitMode"=dword:1           ; 1 if 8bit data bus physically connected

        "DmaEnable"=dword:1 ; 1 to enable TX/RX DMA

        "IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; CE_DRIVER_POWER_MANAGEABLE_GENERIC_GUID
    ; END HIVE BOOT SECTION
    ; @CESYSGEN ENDIF CE_MODULES_SDBUS
    ENDIF BSP_SDHC2

    ;-------------------------------------------------------------------------------

    Thanks and Regards,

    Syed Ahmed M

    Thursday, August 29, 2019 9:31 AM
  • I have enabled RAM and ROM Based file System and Hive Based Registry in Catalog. If I didn't dismount BOOT partition, RegFlush is succeeding and registry modifications were pesistent. But, I want them even after dismounting BOOT partition. 

    Is it possible to move Hive Directory to another partition "Hard Disk"?

    Thanks and Regards,

    Syed Ahmed M

    Thursday, August 29, 2019 9:38 AM
  • Hi Michel,

    I saw your reply in one of the forums that If we put "Mount As Bootable" =1 in filesystem we wants registry to be stored, it will store in it. So, here is the changes I did in my Registry. My WINCE images are in BOOT partition but Documents and Settings  folder (Hive Directory) is created in Hard Disk partition. Is the implementation proper? Will it give any issues? 

    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\eMMC\Part00]
        "Folder"="BOOT"
    IF IMGREGHIVE    
    "MountAsBootable"=dword:0
    ; "MountPermanent"=dword:1     ; Do not allow un-mounting (else we fail to flush the registry) 
    "MountPermanent"=dword:0
    ENDIF IMGREGHIVE
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\eMMC\Part01]
    "MountAsBootable"=dword:1

    Thanks and Regards,

    Syed Ahmed M

    Thursday, August 29, 2019 12:50 PM
    1. Remove ""Flags"=dword:1000" from [HKEY_LOCAL_MACHINE\Drivers\Builtin\SDBusDriver]
    2. Remove "MountAsBootable"=dword:1 from [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\eMMC\Part00]
    3. Add [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\eMMC\Part01] key, set folder name and add "MountAsBootable"=dword:1
    4. Make sure no other profile sets MountAsBootable (open NK.bin in Visual Studio and inspect the registry to make absolutely sure)

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Thursday, August 29, 2019 4:21 PM
    Moderator
  • See my answer above. In short; yes, all is good now. You just need to specify Flags=dword:1000 on the SDHC interface you want to store the hive on (so it loads in bootphase 1) and then specify MountAsBootable on the partition on that SDHC interface you want to store the hive on.

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Thursday, August 29, 2019 4:23 PM
    Moderator