Statistics
| Branch: | Revision:

root / common_windows.sh @ df47d312

History | View | Annotate | Download (1.6 kB)

1

    
2
if [ "x$windows_support" != "xyes" ] ; then
3
    log_error "Windows support is disabled."
4
    exit 1;
5
fi
6

    
7
windows_format_disk0() {
8
    # 
9
    # The -f is needed, because we use an optimal alignment and sfdisk complains
10
    # about partitions not ending on clylinder boundary.
11
    #
12
    local sfdisk_cmd="$SFDISK -uS -H 255 -S 63 -f --quiet --Linux --DOS $1"
13

    
14
    if [ "${BOOT}" = "yes" ]; then
15
        #One boot partition 100M and the rest %SYSTEMDRIVE%
16
#        $sfdisk_cmd > /dev/null <<EOF
17
#2048,206847,7,*
18
#,,7
19
#EOF
20
        log_error "We do not support windows boot partitions yet."
21
        exit 1;
22
    else # "${BOOT}" = "no"
23
        $sfdisk_cmd > /dev/null <<EOF
24
2048,,7,*
25
EOF
26
    fi
27
}
28

    
29
windows_setup_console() {
30
    # OK, well, I don't support windows serial consoles yet. I don't really plan
31
    # to do it in the future either, but you never know...
32
    echo "Serial console for windows is not supported..."
33
}
34

    
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 a diskpart script to %SystemDrive%\Windows\SnfScripts. Sysprep will
43
    # try to execute this script during the specialize pass.
44
    mkdir -p "$target/Windows/SnfScripts"
45
    cat > "$target/Windows/SnfScripts/ExtendFilesystem" <<EOF
46
select disk 0
47
select volume 1
48
extend filesystem
49
exit
50
EOF
51

    
52
    # Write the initial Unattend.xml to %SystemDrive%
53
    cat unattend.xml > "$target/Unattend.xml"
54

    
55
    # Make sure Unattend.xml is removed after setup has finished
56
    mkdir -p "$target/Windows/Setup/Scripts"
57
    echo "del /Q /F C:\Unattend.xml" > "$target/Windows/Setup/Scripts/SetupComplete.cmd"
58
}
59