feat: Improve installation robustness (#1807)

This commit is contained in:
Kroese
2026-07-06 07:46:01 +02:00
committed by GitHub
parent cfc44829f8
commit da032a401e
2 changed files with 26 additions and 9 deletions
+22 -8
View File
@@ -598,7 +598,7 @@ extractImage() {
if ! enabled "${UNPACK:-}"; then if ! enabled "${UNPACK:-}"; then
LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p') LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p') || LABEL=""
else else
@@ -612,8 +612,8 @@ extractImage() {
error "Failed to extract archive!" && return 1 error "Failed to extract archive!" && return 1
fi fi
LABEL=$(isoinfo -d -i "$file" | sed -n 's/Volume id: //p') LABEL=$(isoinfo -d -i "$file" | sed -n 's/Volume id: //p') || LABEL=""
rm -f "$file" rm -f "$file" || warn "Failed to remove temporary ISO file: $file"
fi fi
@@ -1126,11 +1126,19 @@ updateImage() {
if ! enabled "$MANUAL"; then if ! enabled "$MANUAL"; then
xml=$(basename "$asset") xml=$(basename "$asset")
local answer="$tmp/$xml"
info "Adding $xml for automatic installation..." info "Adding $xml for automatic installation..."
local answer="$tmp/$xml" if ! cp "$asset" "$answer"; then
cp "$asset" "$answer" error "Failed to copy answer file to $answer."
updateXML "$answer" "$language" return 1
fi
if ! updateXML "$answer" "$language"; then
error "Failed to update answer file: $answer"
return 1
fi
if ! wimlib-imagex update "$wim" "$index" --command "add $answer /$file" > /dev/null; then if ! wimlib-imagex update "$wim" "$index" --command "add $answer /$file" > /dev/null; then
MANUAL="Y" MANUAL="Y"
@@ -1159,9 +1167,15 @@ updateImage() {
if [ -f "$path" ]; then if [ -f "$path" ]; then
if ! enabled "$MANUAL"; then if ! enabled "$MANUAL"; then
mv -f "$path" "${path%.*}.org" if ! mv -f "$path" "${path%.*}.org"; then
error "Failed to rename answer file: $path"
return 1
fi
else else
mv -f "$path" "${path%.*}.xml" if ! mv -f "$path" "${path%.*}.xml"; then
error "Failed to rename answer file: $path"
return 1
fi
fi fi
fi fi
+4 -1
View File
@@ -539,7 +539,10 @@ getESD() {
if [[ "$file" == *".xml" ]]; then if [[ "$file" == *".xml" ]]; then
mv -f "$dir/$file" "$dir/$xFile" if ! mv -f "$dir/$file" "$dir/$xFile"; then
error "Failed to rename $file to $xFile."
return 1
fi
else else