Update install.sh

This commit is contained in:
Kroese 2024-05-17 21:42:49 +02:00 committed by GitHub
parent c2fd9c0e60
commit 0f3cb71e9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -586,6 +586,13 @@ prepareImage() {
return 1
}
updateAsset() {
local asset="$1"
return 0
}
updateImage() {
local dir="$1"
@ -645,13 +652,20 @@ updateImage() {
xml=$(basename "$asset")
info "Adding $xml for automatic installation..."
if ! wimlib-imagex update "$loc" "$index" --command "add $asset /$file" > /dev/null; then
local answer="$TMP/$xml"
rm -f "$answer"
cp "$asset" "$answer"
updateAsset "$answer"
if ! wimlib-imagex update "$loc" "$index" --command "add $answer /$file" > /dev/null; then
MANUAL="Y"
warn "failed to add answer file ($xml) to ISO image, $FB"
else
wimlib-imagex update "$loc" "$index" --command "add $asset /$dat" > /dev/null || true
wimlib-imagex update "$loc" "$index" --command "add $answer /$dat" > /dev/null || true
fi
rm -f "$answer"
fi
if [[ "$MANUAL" == [Yy1]* ]]; then
@ -662,9 +676,10 @@ updateImage() {
if ! wimlib-imagex update "$loc" "$index" --command "add $TMP/$org /$file" > /dev/null; then
warn "failed to restore original answer file ($org)."
fi
rm -f "$TMP/$org"
fi
rm -f "$TMP/$org"
fi
local find="$file"