mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 11:25:49 +00:00
feat: Verify system files
This commit is contained in:
parent
6291b426f3
commit
0ee39f93bb
1 changed files with 21 additions and 24 deletions
|
|
@ -122,6 +122,8 @@ rm -rf "$DIR"
|
|||
7z x "$ISO" -o"$DIR"
|
||||
echo
|
||||
|
||||
FB="falling back to manual installation!"
|
||||
|
||||
if [[ "$EXTERNAL" != [Yy1]* ]]; then
|
||||
|
||||
XML="$VERSION.xml"
|
||||
|
|
@ -154,10 +156,10 @@ else
|
|||
echo "Detected image of type '$DETECTED', will apply unattended.xml file."
|
||||
|
||||
else
|
||||
error "Warning: failed to detect Windows version from '$NAME', falling back to manual installation!"
|
||||
error "Warning: failed to detect Windows version from '$NAME', $FB"
|
||||
fi
|
||||
else
|
||||
error "Warning: failed to locate 'install.wim' or 'install.esd' in ISO image, falling back to manual installation!"
|
||||
error "Warning: failed to locate 'install.wim' or 'install.esd' in ISO image, $FB"
|
||||
fi
|
||||
echo
|
||||
fi
|
||||
|
|
@ -173,43 +175,38 @@ if [[ "$MANUAL" != [Yy1]* ]]; then
|
|||
wimlib-imagex update "$LOC" 2 --command "add /run/assets/$XML /autounattend.xml"
|
||||
|
||||
else
|
||||
error "Warning: failed to locate 'boot.wim' or 'boot.esd' in ISO image, falling back to manual installation!"
|
||||
error "Warning: failed to locate 'boot.wim' or 'boot.esd' in ISO image, $FB"
|
||||
fi
|
||||
else
|
||||
[ -n "$XML" ] && error "Warning: XML file '$XML' does not exist, falling back to manual installation!"
|
||||
[ -n "$XML" ] && error "Warning: XML file '$XML' does not exist, $FB"
|
||||
fi
|
||||
echo
|
||||
fi
|
||||
|
||||
LABEL="${BASE%.*}"
|
||||
LABEL="${LABEL::32}"
|
||||
|
||||
ISO="$TMP/$LABEL.tmp"
|
||||
rm -f "$ISO"
|
||||
|
||||
CAT="BOOT.CAT"
|
||||
ETFS="boot/etfsboot.com"
|
||||
EFISYS="efi/microsoft/boot/efisys_noprompt.bin"
|
||||
|
||||
if [ ! -f "$DIR/$CAT" ]; then
|
||||
error "Failed to locate file '$(basename "$CAT")' in ISO image!" && exit 63
|
||||
fi
|
||||
|
||||
if [ ! -f "$DIR/$ETFS" ]; then
|
||||
error "Failed to locate file '$(basename "$ETFS")' in ISO image!" && exit 64
|
||||
fi
|
||||
|
||||
if [ ! -f "$DIR/$EFISYS" ]; then
|
||||
EFISYS="efi/microsoft/boot/efisys.bin"
|
||||
if [ -f "$DIR/$CAT" ]; then
|
||||
if [ -f "$DIR/$ETFS" ]; then
|
||||
if [ -f "$DIR/$EFISYS" ]; then
|
||||
error "Failed to locate file 'efisys_noprompt' in ISO image!"
|
||||
else
|
||||
error "Failed to locate file 'efisys.bin' in ISO image!" && exit 65
|
||||
fi
|
||||
fi
|
||||
|
||||
genisoimage -b "$ETFS" -no-emul-boot -c "$CAT" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -v -V "$LABEL" -udf \
|
||||
LABEL="${BASE%.*}"
|
||||
LABEL="${LABEL::32}"
|
||||
ISO="$TMP/$LABEL.tmp"
|
||||
rm -f "$ISO"
|
||||
|
||||
genisoimage -b "$ETFS" -no-emul-boot -c "$CAT" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -v -V "$LABEL" -udf \
|
||||
-boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -o "$ISO" -allow-limited-size "$DIR"
|
||||
else
|
||||
error "Failed to locate file '"$(basename "$EFISYS")"' in ISO image, $FB"
|
||||
fi
|
||||
else
|
||||
error "Failed to locate file '"$(basename "$ETFS")"' in ISO image, $FB"
|
||||
fi
|
||||
else
|
||||
error "Failed to locate file '"$(basename "$CAT")"' in ISO image, $FB"
|
||||
fi
|
||||
|
||||
mv "$ISO" "$STORAGE/$BASE"
|
||||
rm -rf "$TMP"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue