mirror of
https://github.com/dockur/windows.git
synced 2026-08-03 12:37:20 +01:00
feat: Added option to prevent rebuild of the image (#1970)
This commit is contained in:
@@ -1557,49 +1557,4 @@ legacyInstall() {
|
||||
return 0
|
||||
}
|
||||
|
||||
legacyPrepare() {
|
||||
|
||||
local iso="$1"
|
||||
local dir="$2"
|
||||
local desc="$3"
|
||||
|
||||
local tmp="$TMP/boot-images"
|
||||
local image="$tmp/eltorito_img1_bios.img"
|
||||
|
||||
ETFS="boot.img"
|
||||
[ -f "$dir/$ETFS" ] && [ -s "$dir/$ETFS" ] && return 0
|
||||
|
||||
rm -f "$dir/$ETFS" || return 1
|
||||
rm -rf "$tmp" || return 1
|
||||
|
||||
LC_ALL=C xorriso \
|
||||
-no_rc \
|
||||
-osirrox on \
|
||||
-indev "$iso" \
|
||||
-extract_boot_images "$tmp" >/dev/null 2>&1 || {
|
||||
local rc=$?
|
||||
rm -rf "$tmp" || true
|
||||
|
||||
(( rc > 128 )) && exit "$rc"
|
||||
|
||||
error "Failed to extract boot image from $desc ISO!"
|
||||
return 1
|
||||
}
|
||||
|
||||
if [ ! -s "$image" ]; then
|
||||
rm -rf "$tmp" || true
|
||||
error "Failed to locate BIOS boot image in $desc ISO!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! mv -f "$image" "$dir/$ETFS"; then
|
||||
rm -rf "$tmp" || true
|
||||
error "Failed to save boot image from $desc ISO!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
rm -rf "$tmp" || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user