Compare commits

..

3 Commits

Author SHA1 Message Date
Kroese 8e1d0eac2d Update legacy.sh 2026-08-24 19:58:08 +02:00
Kroese 2a25cede86 Update legacy.sh 2026-08-24 15:29:07 +02:00
Kroese f31e9addd6 feat: Install SVGA drivers on 2000/XP/2003 2026-08-24 15:26:06 +02:00
2 changed files with 49 additions and 35 deletions
+3
View File
@@ -31,6 +31,9 @@ setMachine() {
"winnt4" )
writeState "vga" "cirrus" || return 1 ;;
"win2k"* | "winxp"* | "win2003"* )
writeState "vga" "vmware" || return 1 ;;
*) writeState "vga" "std" || return 1 ;;
esac
+46 -35
View File
@@ -46,9 +46,14 @@ SIFInstall() {
"2k" )
# Windows 2000 keeps its existing storage/network path, but still needs
# the QBochs display package staged for Plug and Play setup.
# its display driver packages staged for Plug and Play setup.
extractDrivers "$drivers" || return 1
if ! addVMSVGADriver "$dir" "$driver" "$arch" "$drivers"; then
rm -rf "$drivers" || :
return 1
fi
if ! addDisplayDriver "$dir" "$driver" "$arch" "$drivers"; then
rm -rf "$drivers" || :
return 1
@@ -183,6 +188,7 @@ addLegacyDrivers() {
copyStorageDriver "$dir" "$target" "$driver" "$arch" "$drivers" || return 1
addNetworkDriver "$dir" "$driver" "$arch" "$drivers" || return 1
addQXLDriver "$dir" "$driver" "$arch" "$drivers" || return 1
addVMSVGADriver "$dir" "$driver" "$arch" "$drivers" || return 1
addDisplayDriver "$dir" "$driver" "$arch" "$drivers" || return 1
disableGenericDisplay "$target" "$driver" "$arch" "$drivers" || return 1
addBalloonDriver "$dir" "$driver" "$arch" "$drivers" || return 1
@@ -287,6 +293,44 @@ addQXLDriver() {
return 0
}
addVMSVGADriver() {
local dir="$1"
local driver="$2"
local arch="$3"
local drivers="$4"
local vmsvga_arch="$arch"
[[ "${vmsvga_arch,,}" == "amd64" ]] && vmsvga_arch="x64"
local source="$drivers/vmsvga/$driver/$vmsvga_arch"
local destination="$dir/\$OEM\$/\$1/Drivers/VMSVGA"
if [ ! -d "$source" ]; then
error "Failed to locate required VMware SVGA display driver directory: $source"
return 1
fi
local files="vmx_svgaver.dll vmx_svga.cat vmx_mode.dll vmx_svga.sys vmwogl32.dll vmx_fb.dll vmx_svga.inf"
[[ "$vmsvga_arch" == "x64" ]] && files+=" vmwogl64.dll"
local file
for file in $files; do
if [ ! -f "$source/$file" ]; then
error "Failed to locate required VMware SVGA display driver file: $file"
return 1
fi
done
mkdir -p "$destination" || return 1
cp -Lr "$source/." "$destination" || return 1
return 0
}
addDisplayDriver() {
local dir="$1"
@@ -771,7 +815,7 @@ writeSIF() {
' WaitForReboot="No"' \
' DriverSigningPolicy="Ignore"' \
' NonDriverSigningPolicy="Ignore"' \
' OemPnPDriversPath="Drivers\viostor;Drivers\NetKVM;Drivers\sata;Drivers\QXL;Drivers\QBochs;Drivers\Balloon"' \
' OemPnPDriversPath="Drivers\viostor;Drivers\NetKVM;Drivers\sata;Drivers\QXL;Drivers\VMSVGA;Drivers\QBochs;Drivers\Balloon"' \
' NoWaitAfterTextMode=1' \
' NoWaitAfterGUIMode=1' \
' FileSystem=ConvertNTFS' \
@@ -1077,39 +1121,6 @@ writeVBS() {
} | unix2dos > "$dir/\$OEM\$/install.vbs" || return 1
if [[ "$driver" == "xp" || "$driver" == "2k3" ]]; then
# Windows XP and Server 2003 store the automatic recovery menu timeout
# in byte 0x09 of bootstat.dat. Patch only that byte and leave the boot
# success/shutdown state in the rest of the file untouched.
{
printf '%s\n' \
'On Error Resume Next' \
'BootStatPath = WshShell.ExpandEnvironmentStrings("%SystemRoot%\bootstat.dat")' \
'Set BootStatStream = WScript.CreateObject("ADODB.Stream")' \
'Set BootStatXML = WScript.CreateObject("Msxml2.DOMDocument.3.0")' \
'Set BootStatByte = BootStatXML.CreateElement("byte")' \
'BootStatByte.DataType = "bin.base64"' \
'BootStatByte.Text = "Aw=="' \
'If IsObject(BootStatStream) And IsObject(BootStatByte) Then' \
' BootStatStream.Type = 1' \
' BootStatStream.Open' \
' Err.Clear' \
' BootStatStream.LoadFromFile BootStatPath' \
' If Err.Number = 0 Then' \
' If BootStatStream.Size > 9 Then' \
' BootStatStream.Position = 9' \
' BootStatStream.Write BootStatByte.NodeTypedValue' \
' BootStatStream.SaveToFile BootStatPath, 2' \
' End If' \
' End If' \
' BootStatStream.Close' \
'End If' \
'Set BootStatByte = Nothing' \
'Set BootStatXML = Nothing' \
'Set BootStatStream = Nothing' \
'On Error GoTo 0' \
''
} | unix2dos >> "$dir/\$OEM\$/install.vbs" || return 1
mkdir -p "$(dirname "$power")" || return 1
{