Revision 86ddc018

b/Makefile.am
13 13

  
14 14
dist_os_SCRIPTS = create import export rename verify
15 15
dist_tools_SCRIPTS = tools/*
16
dist_os_DATA = ganeti_api_version parameters.list common_linux.sh
16
dist_os_DATA = ganeti_api_version parameters.list common_linux.sh common_windows.sh
17 17
if WINSUPPORT
18
dist_os_DATA += common_windows.sh
18
dist_os_DATA += unattend.xml
19 19
endif
20 20
dist_config_DATA = variants.list
21 21
os_DATA = common.sh
b/common_linux.sh
193 193
    esac
194 194
}
195 195

  
196
linux_filesystem_check() {
196
linux_epilogue() {
197 197
    local target=$1
198 198
    if [ -z "$target" ] ; then
199
        log_error "target not set for filesystem_check"
199
        log_error "target not set"
200 200
        exit 1
201 201
    fi
202 202

  
b/common_windows.sh
32 32
    echo "Serial console for windows is not supported..."
33 33
}
34 34

  
35
windows_filesystem_check() {
36
    # Nothing to do for now....
37
    echo "No filesystem check needed..."
35
windows_epilogue() {
36
    local target=$1
37
    if [ -z "$target" ] ; then
38
        log_error "target not set"
39
        exit 1;
40
    fi
41

  
42
    # Write the initial Unattend.xml to %SystemDrive%
43
    cat unattend.xml > "$target/Unattend.xml"
44

  
45
    #TODO: I need to add code here that configures Windows to remove
46
    # Unattend.xml after the setup finishes. Leaving Unattend.xml in place
47
    # raises security concerns
38 48
}
49

  
b/create
137 137
        ${OS_FAMILY}_setup_console $TARGET
138 138
    fi
139 139

  
140
    ${OS_FAMILY}_filesystem_check $TARGET
140
    ${OS_FAMILY}_epilogue $TARGET
141 141

  
142 142
    RUN_PARTS=`which run-parts`
143 143

  
b/example/hooks/windows/admin_passwd
1
#!/bin/bash
2

  
3
set -e
4
. common.sh
5
. common_windows.sh
6

  
7
debug set -x
8

  
9
CLEANUP=( )
10

  
11
NEW_UNATTEND=`mktemp` || exit 1
12
CLEANUP+=("rm $NEW_UNATTEND")
13

  
14
echo -n "Executing admin_passwd hook..."
15

  
16
NAMESPACE="urn:schemas-microsoft-com:unattend"
17

  
18
$XMLSTARLET ed -N x=$NAMESPACE -u "/x:unattend/x:settings/x:component/x:UserAccounts/x:AdministratorPassword/x:Value" -v $IMG_PASSWD "$TARGET/Unattend.xml" > $NEW_UNATTEND
19

  
20
cat $NEW_UNATTEND > "$TARGET/Unattend.xml"
21

  
22
echo "done"
23

  
24
# execute cleaups
25
cleanup
26
trap - EXIT
27

  
28
echo "done"
29
exit 0
b/unattend.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<unattend xmlns="urn:schemas-microsoft-com:unattend">
3
    <settings pass="specialize">
4
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5
            <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
6
            <TimeZone>GTB Standard Time</TimeZone>
7
        </component>
8
        <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
9
            <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
10
        </component>
11
        <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
12
            <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
13
        </component>
14
    </settings>
15
    <settings pass="oobeSystem">
16
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
17
            <Display>
18
                <ColorDepth>32</ColorDepth>
19
                <HorizontalResolution>1024</HorizontalResolution>
20
                <VerticalResolution>768</VerticalResolution>
21
            </Display>
22
            <OOBE>
23
                <HideEULAPage>true</HideEULAPage>
24
            </OOBE>
25
            <UserAccounts>
26
                <AdministratorPassword>
27
                    <Value>Admin1</Value>
28
                    <PlainText>true</PlainText>
29
                </AdministratorPassword>
30
            </UserAccounts>
31
        </component>
32
    </settings>
33
    <cpi:offlineImage cpi:source="catalog:d:/sources/install_windows server 2008 r2 serverstandard.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
34
</unattend>

Also available in: Unified diff