mirror of
https://github.com/dockur/windows.git
synced 2026-08-24 07:39:00 +01:00
fix: Allow ESD images without descriptions (#2087)
This commit is contained in:
+20
-19
@@ -669,10 +669,13 @@ createSetupImage() {
|
|||||||
local msg="Writing overlay image..."
|
local msg="Writing overlay image..."
|
||||||
info "$msg" && html "$msg"
|
info "$msg" && html "$msg"
|
||||||
|
|
||||||
# Build and verify a temporary FAT32 image before replacing the active setup
|
# Build and verify a temporary FAT32 image before publishing it as setup
|
||||||
# image, so a partial write never becomes boot media.
|
# media, so a partial write never becomes boot media.
|
||||||
|
|
||||||
rm -f -- "$tmp" || return 1
|
rm -f -- "$tmp" || return 1
|
||||||
|
|
||||||
|
checkFreeSpace "$(dirname "$image")" "$size" || return 1
|
||||||
|
|
||||||
if ! mformat -i "$tmp" -C -F -T "$sectors" -v "SETUP" ::; then
|
if ! mformat -i "$tmp" -C -F -T "$sectors" -v "SETUP" ::; then
|
||||||
rm -f -- "$tmp"
|
rm -f -- "$tmp"
|
||||||
error "Failed to format setup image!"
|
error "Failed to format setup image!"
|
||||||
@@ -1410,9 +1413,10 @@ extractESD() {
|
|||||||
|
|
||||||
local installSize size edition imgEdition
|
local installSize size edition imgEdition
|
||||||
local bootTotal bootLinks wimTotal wimLinks
|
local bootTotal bootLinks wimTotal wimLinks
|
||||||
local bootWim installWim bootSize wimSize xml
|
local bootWim installWim bootSize wimSize
|
||||||
local image index line ret metadata count output
|
local image index line ret metadata count
|
||||||
local result resultCount resultEdition installXml
|
local resultCount resultIndex resultEdition
|
||||||
|
local xml installXml output result
|
||||||
local -a detected fields
|
local -a detected fields
|
||||||
|
|
||||||
local minSize=100000000
|
local minSize=100000000
|
||||||
@@ -1581,18 +1585,7 @@ extractESD() {
|
|||||||
|
|
||||||
index="${detected[1]:-}"
|
index="${detected[1]:-}"
|
||||||
|
|
||||||
for line in "${fields[@]:5}"; do
|
if [ -z "$index" ]; then
|
||||||
|
|
||||||
IFS=$'\t' read -r image imgEdition <<< "$line"
|
|
||||||
|
|
||||||
[[ "$image" == "$index" ]] || continue
|
|
||||||
|
|
||||||
edition="$imgEdition"
|
|
||||||
break
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$index" ] || [ -z "$edition" ]; then
|
|
||||||
error "Failed to select an installation image from install.esd!"
|
error "Failed to select an installation image from install.esd!"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -1665,6 +1658,7 @@ extractESD() {
|
|||||||
|
|
||||||
if ! metadata=$(xmlstarlet sel -t \
|
if ! metadata=$(xmlstarlet sel -t \
|
||||||
-v 'count(/WIM/IMAGE)' -n \
|
-v 'count(/WIM/IMAGE)' -n \
|
||||||
|
-v 'count(/WIM/IMAGE[@INDEX="1"])' -n \
|
||||||
-v 'normalize-space(/WIM/IMAGE[@INDEX="1"]/DESCRIPTION)' -n \
|
-v 'normalize-space(/WIM/IMAGE[@INDEX="1"]/DESCRIPTION)' -n \
|
||||||
<<< "$result" 2>/dev/null); then
|
<<< "$result" 2>/dev/null); then
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
@@ -1675,9 +1669,16 @@ extractESD() {
|
|||||||
mapfile -t fields <<< "$metadata"
|
mapfile -t fields <<< "$metadata"
|
||||||
|
|
||||||
resultCount="${fields[0]:-}"
|
resultCount="${fields[0]:-}"
|
||||||
resultEdition="${fields[1]:-}"
|
resultIndex="${fields[1]:-}"
|
||||||
|
resultEdition="${fields[2]:-}"
|
||||||
|
|
||||||
if [[ "$resultCount" != "1" ]] ||
|
if [[ "$resultCount" != "1" ]] || [[ "$resultIndex" != "1" ]]; then
|
||||||
|
fKill "progress.sh"
|
||||||
|
error "Prepared install.esd does not contain exactly one image at index 1!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${version,,}" != "http"* ]] &&
|
||||||
[[ "${resultEdition,,}" != "${edition,,}" ]]; then
|
[[ "${resultEdition,,}" != "${edition,,}" ]]; then
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
error "Prepared install.esd does not contain only '$edition' at index 1!"
|
error "Prepared install.esd does not contain only '$edition' at index 1!"
|
||||||
|
|||||||
Reference in New Issue
Block a user