Windows Embedded Standard 7 - Lost Bcedit Settings



  • Hi,
    I noted that after the backup of WES7 image, fog reset the bcdedit settings to default and EWF function of WES7 does not works fine, because after power loss failure the system restarts and Windows show the recover boot menu !
    I noted that after backup a WES7 System with Fog, it’s necessary restore the BCDedit to “IgnoreShhutdownFailures” manually and configure the EWF with ewfcfg.exe command.

    How I can solve this problem ?
    I need tha Fog does not change the BcdEdit when saves the image !
    With other software ( ghost, clonezilla etc… ), it’s necessary insert only EwfCFg.exe command into OneTimeStartup RegKey and EWF it will setted correctly.
    Fog makes a change into BCD Settings !

    Regards


  • Senior Developer

    @zingaro why? We take a backup then put ours in place. We can’t use bcdedit in Linux as those are Windows tools.



  • @tom-elliott said in Windows Embedded Standard 7 - Lost Bcedit Settings:

    Create a post download script.

    OK,
    but in this case is not sufficient " export " and "import "the BCD Configuration ? "
    https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcdedit-command-line-options ?


  • Moderator

    The pseudo code that Tom discussed is almost realized in this excerpt from a script to locate the windows partition.

    #!/bin/bash
    . /usr/share/fog/lib/funcs.sh
    [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
    case $osid in
        5|6|7|9)
            clear
            [[ ! -d /ntfs ]] && mkdir -p /ntfs
            getHardDisk
            if [[ -z $hd ]]; then
                handleError "Could not find hdd to use"
            fi
            getPartitions $hd
            for part in $parts; do
                umount /ntfs >/dev/null 2>&1
                fsTypeSetting "$part"
                case $fstype in
                    ntfs)
                        dots "Testing partition $part"
                        ntfs-3g -o force,rw $part /ntfs
                        ntfsstatus="$?"
                        if [[ ! $ntfsstatus -eq 0 ]]; then
                            echo "Skipped"
                            continue
                        fi
                        if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                            echo "Not found"
                            umount /ntfs >/dev/null 2>&1
                            continue
                        fi
                        echo "Success"
                        break
                        ;;
                    *)
                        echo " * Partition $part not NTFS filesystem"
                        ;;
                esac
            done
            if [[ ! $ntfsstatus -eq 0 ]]; then
                echo "Failed"
                debugPause
                handleError "Failed to mount $part ($0)\n    Args: $*"
            fi
            echo "Done"
            debugPause
            . ${postdownpath}fog.copydrivers
            # . ${postdownpath}fog.updateunattend
            umount /ntfs
            ;;
        *)
            echo "Non-Windows Deployment"
            debugPause
            return
            ;;
    esac
    

    More specifically you should focus on this section where it tests to see if the Windows directory exists on the partition. Just finish it up with the remainder of the logic that Tom posted.

                        if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                            echo "Not found"
                            umount /ntfs >/dev/null 2>&1
                            continue
                        fi
    

  • Senior Developer

    Create a post download script. We use a specialized bcd drive to allow for generalized hard drives. Without the custom files it’s possible the system will not boot. We do make a backup of the original bcd file before we put ours in place. The intention of doing this wa so those with specialized BCD’s they could continue using theirs, though you can probably guess this isn’t typically a problem for most people. The post unit script would follow a pseudo code similar of:

    Find hdds
        Loop each hdd
            Find hdd partitions
                Loop hdd partitions
                    Search partition for bcd
                    If bcd found
                        Backup new/ or remove
                        Copy or move backup to original name
                        Break partition loop
                    End if
                End partloop
         Endhdd loop
    

 

407
Online

41.6k
Users

12.1k
Topics

114.4k
Posts