Commit b687eb2c authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Add new WINDOWS_TIMEZONE variable

This can be used to specify the time zone in the answer file that will
be injected to the Windows Image.
parent c6c27147
......@@ -12,8 +12,8 @@ dist_os_SCRIPTS = ${srcdir}/create ${srcdir}/import ${srcdir}/export \
dist_os_DATA = ${srcdir}/ganeti_api_version ${srcdir}/parameters.list \
${srcdir}/variants.list ${srcdir}/xen-common.sh \
${srcdir}/kvm-common.sh ${srcdir}/unattend.xml \
${srcdir}/sysprep.inf
${srcdir}/kvm-common.sh ${srcdir}/unattend.xml.in \
${srcdir}/sysprep.inf.in ${srcdir}/ms-timezone-indexes.txt
dist_xenscripts_SCRIPTS = ${srcdir}/vif-snf-image
......
......@@ -210,10 +210,18 @@ EOF
}
create_floppy() {
local img target
local img target IFS index name tm
img=$1
IFS=$'\t' read index name tm <<< \
"$(grep -Pi "^[0-9]{3}\\t$WINDOWS_TIMEZONE\\t" \
ms-timezone-indexes.txt || true)"
if [[ ! "$index" =~ [0-9]{3} ]]; then
log_error "Invalid value for WINDOWS_TIMEZONE (=$WINDOWS_TIMEZONE) variable"
fi
target=$(mktemp -d)
add_cleanup rmdir "$target"
......@@ -230,10 +238,10 @@ create_floppy() {
exit 1
fi
else
cat unattend.xml > "$target/unattend.xml"
sed -e "s/@TIMEZONE@/$name/g" unattend.xml.in > "$target/unattend.xml"
fi
cat sysprep.inf > "$target/sysprep.inf"
sed -e "s/@TIMEZONE_INDEX@/$index/g" sysprep.inf.in > "$target/sysprep.inf"
# Put all the NIC info in the floppy
set | egrep ^NIC_ | sed -e 's/^/export SNF_IMAGE_/' >> "$target/rules"
umount "$target"
......@@ -446,6 +454,7 @@ fi
: ${PITHOS_ARCHIPELAGO_CONF:="@sysconfdir@/archipelago/archipelago.conf"}
: ${PROGRESS_MONITOR:="@PROGRESS_MONITOR@"}
: ${UNATTEND:="@UNATTEND@"}
: ${WINDOWS_TIMEZONE:="GMT Standard Time"}
: ${XEN_SCRIPTS_DIR="@sysconfdir@/xen/scripts"}
: ${MULTISTRAP_CONFIG:="@MULTISTRAP_CONFIG@"}
: ${MULTISTRAP_APTPREFDIR:="@MULTISTRAP_APTPREFDIR@"}
......
......@@ -114,6 +114,15 @@
# are doing.
# UNATTEND="@UNATTEND@"
# WINDOWS_TIMEZONE: This variable is used to specify the time zone when
# deploying a Windows image. This will only work if you are using snf-image's
# default OS answer file. If the Windows image already contains an answer file,
# which should by itself specify a time zone in order to have an unattended
# Windows customization process, this variable will be completely ignored. For
# a list of available time zones, check here:
# https://msdn.microsoft.com/en-us/library/ms912391%28v=winembedded.11%29.aspx
# WINDOWS_TIMEZONE="GMT Standard Time"
# Paths for needed programs. Uncomment and change the variables below if you
# don't want to use the default one.
# MD5SUM="md5sum"
......
000 Dateline Standard Time (GMT-12:00) International Date Line West
001 Samoa Standard Time (GMT-11:00) Midway Island, Samoa
002 Hawaiian Standard Time (GMT-10:00) Hawaii
003 Alaskan Standard Time (GMT-09:00) Alaska
004 Pacific Standard Time (GMT-08:00) Pacific Time (US and Canada); Tijuana
010 Mountain Standard Time (GMT-07:00) Mountain Time (US and Canada)
013 Mexico Standard Time 2 (GMT-07:00) Chihuahua, La Paz, Mazatlan
015 U.S. Mountain Standard Time (GMT-07:00) Arizona
020 Central Standard Time (GMT-06:00) Central Time (US and Canada
025 Canada Central Standard Time (GMT-06:00) Saskatchewan
030 Mexico Standard Time (GMT-06:00) Guadalajara, Mexico City, Monterrey
033 Central America Standard Time (GMT-06:00) Central America
035 Eastern Standard Time (GMT-05:00) Eastern Time (US and Canada)
040 U.S. Eastern Standard Time (GMT-05:00) Indiana (East)
045 S.A. Pacific Standard Time (GMT-05:00) Bogota, Lima, Quito
050 Atlantic Standard Time (GMT-04:00) Atlantic Time (Canada)
055 S.A. Western Standard Time (GMT-04:00) Caracas, La Paz
056 Pacific S.A. Standard Time (GMT-04:00) Santiago
060 Newfoundland and Labrador Standard Time (GMT-03:30) Newfoundland and Labrador
065 E. South America Standard Time (GMT-03:00) Brasilia
070 S.A. Eastern Standard Time (GMT-03:00) Buenos Aires, Georgetown
073 Greenland Standard Time (GMT-03:00) Greenland
075 Mid-Atlantic Standard Time (GMT-02:00) Mid-Atlantic
080 Azores Standard Time (GMT-01:00) Azores
083 Cape Verde Standard Time (GMT-01:00) Cape Verde Islands
085 GMT Standard Time (GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London
090 Greenwich Standard Time (GMT) Casablanca, Monrovia
095 Central Europe Standard Time (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
100 Central European Standard Time (GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb
105 Romance Standard Time (GMT+01:00) Brussels, Copenhagen, Madrid, Paris
110 W. Europe Standard Time (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
113 W. Central Africa Standard Time (GMT+01:00) West Central Africa
115 E. Europe Standard Time (GMT+02:00) Bucharest
120 Egypt Standard Time (GMT+02:00) Cairo
125 FLE Standard Time (GMT+02:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius
130 GTB Standard Time (GMT+02:00) Athens, Istanbul, Minsk
135 Israel Standard Time (GMT+02:00) Jerusalem
140 South Africa Standard Time (GMT+02:00) Harare, Pretoria
145 Russian Standard Time (GMT+03:00) Moscow, St. Petersburg, Volgograd
150 Arab Standard Time (GMT+03:00) Kuwait, Riyadh
155 E. Africa Standard Time (GMT+03:00) Nairobi
158 Arabic Standard Time (GMT+03:00) Baghdad
160 Iran Standard Time (GMT+03:30) Tehran
165 Arabian Standard Time (GMT+04:00) Abu Dhabi, Muscat
170 Caucasus Standard Time (GMT+04:00) Baku, Tbilisi, Yerevan
175 Transitional Islamic State of Afghanistan Standard Time (GMT+04:30) Kabul
180 Ekaterinburg Standard Time (GMT+05:00) Ekaterinburg
185 West Asia Standard Time (GMT+05:00) Islamabad, Karachi, Tashkent
190 India Standard Time (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi
193 Nepal Standard Time (GMT+05:45) Kathmandu
195 Central Asia Standard Time (GMT+06:00) Astana, Dhaka
200 Sri Lanka Standard Time (GMT+06:00) Sri Jayawardenepura
201 N. Central Asia Standard Time (GMT+06:00) Almaty, Novosibirsk
203 Myanmar Standard Time (GMT+06:30) Yangon Rangoon
205 S.E. Asia Standard Time (GMT+07:00) Bangkok, Hanoi, Jakarta
207 North Asia Standard Time (GMT+07:00) Krasnoyarsk
210 China Standard Time (GMT+08:00) Beijing, Chongqing, Hong Kong SAR, Urumqi
215 Singapore Standard Time (GMT+08:00) Kuala Lumpur, Singapore
220 Taipei Standard Time (GMT+08:00) Taipei
225 W. Australia Standard Time (GMT+08:00) Perth
227 North Asia East Standard Time (GMT+08:00) Irkutsk, Ulaanbaatar
230 Korea Standard Time (GMT+09:00) Seoul
235 Tokyo Standard Time (GMT+09:00) Osaka, Sapporo, Tokyo
240 Yakutsk Standard Time (GMT+09:00) Yakutsk
245 A.U.S. Central Standard Time (GMT+09:30) Darwin
250 Cen. Australia Standard Time (GMT+09:30) Adelaide
255 A.U.S. Eastern Standard Time (GMT+10:00) Canberra, Melbourne, Sydney
260 E. Australia Standard Time (GMT+10:00) Brisbane
265 Tasmania Standard Time (GMT+10:00) Hobart
270 Vladivostok Standard Time (GMT+10:00) Vladivostok
275 West Pacific Standard Time (GMT+10:00) Guam, Port Moresby
280 Central Pacific Standard Time (GMT+11:00) Magadan, Solomon Islands, New Caledonia
285 Fiji Islands Standard Time (GMT+12:00) Fiji Islands, Kamchatka, Marshall Islands
290 New Zealand Standard Time (GMT+12:00) Auckland, Wellington
300 Tonga Standard Time (GMT+13:00) Nuku'alofa
......@@ -5,7 +5,7 @@
[GuiUnattended]
OEMSkipRegional=1
TimeZone=130
TimeZone=@TIMEZONE_INDEX@
OemSkipWelcome=1
[UserData]
......
......@@ -3,14 +3,14 @@
<settings pass="specialize">
<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">
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<TimeZone>GTB Standard Time</TimeZone>
<TimeZone>@TIMEZONE@</TimeZone>
<ComputerName>*</ComputerName>
<RegisteredOrganization>Microsoft</RegisteredOrganization>
<RegisteredOwner>AutoBVT</RegisteredOwner>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<TimeZone>GTB Standard Time</TimeZone>
<TimeZone>@TIMEZONE@</TimeZone>
<ComputerName>*</ComputerName>
<RegisteredOrganization>Microsoft</RegisteredOrganization>
<RegisteredOwner>AutoBVT</RegisteredOwner>
......@@ -50,14 +50,14 @@
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>el-GR</UserLocale>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>el-GR</UserLocale>
<UserLocale>en-US</UserLocale>
</component>
<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">
<Display>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment