BUG12445: Fix for Hyper-V stuck 8 minutes at boot

Fix for Bug 12445: There is no proper way to distinguish between MS Azure and a local
Hyper-V installation Procedure: try to get the metadata info from the
internal MS metadata service at IP 169.254.169.254 If this fails the system
is running on an local Hyper-V instance wget takes too long to exit if the IP
is not reachable Added --timeout and --tries param to wget to reduce the
duation from 8 minutes to 9 seconds 9 seconds at one try should be enough

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Thomas Cekal <admin@cekal.org>
This commit is contained in:
Thomas Cekal
2021-04-01 00:42:35 +02:00
committed by Michael Tremer
parent f78eb45c09
commit 5b17fea8e7

View File

@@ -9,7 +9,7 @@ export PATH=/usr/local/sbin:/usr/local/bin:${PATH}
get() {
local file="${1}"
wget -qO - --header="Metadata:true" "http://169.254.169.254/metadata/instance/${file}?api-version=2019-06-01&format=text"
wget --timeout=3 --tries=3 -qO - --header="Metadata:true" "http://169.254.169.254/metadata/instance/${file}?api-version=2019-06-01&format=text"
}
format_mac() {