mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 19:35: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"
|
7z x "$ISO" -o"$DIR"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
FB="falling back to manual installation!"
|
||||||
|
|
||||||
if [[ "$EXTERNAL" != [Yy1]* ]]; then
|
if [[ "$EXTERNAL" != [Yy1]* ]]; then
|
||||||
|
|
||||||
XML="$VERSION.xml"
|
XML="$VERSION.xml"
|
||||||
|
|
@ -154,10 +156,10 @@ else
|
||||||
echo "Detected image of type '$DETECTED', will apply unattended.xml file."
|
echo "Detected image of type '$DETECTED', will apply unattended.xml file."
|
||||||
|
|
||||||
else
|
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
|
fi
|
||||||
else
|
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
|
fi
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
@ -173,44 +175,39 @@ if [[ "$MANUAL" != [Yy1]* ]]; then
|
||||||
wimlib-imagex update "$LOC" 2 --command "add /run/assets/$XML /autounattend.xml"
|
wimlib-imagex update "$LOC" 2 --command "add /run/assets/$XML /autounattend.xml"
|
||||||
|
|
||||||
else
|
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
|
fi
|
||||||
else
|
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
|
fi
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LABEL="${BASE%.*}"
|
|
||||||
LABEL="${LABEL::32}"
|
|
||||||
|
|
||||||
ISO="$TMP/$LABEL.tmp"
|
|
||||||
rm -f "$ISO"
|
|
||||||
|
|
||||||
CAT="BOOT.CAT"
|
CAT="BOOT.CAT"
|
||||||
ETFS="boot/etfsboot.com"
|
ETFS="boot/etfsboot.com"
|
||||||
EFISYS="efi/microsoft/boot/efisys_noprompt.bin"
|
EFISYS="efi/microsoft/boot/efisys_noprompt.bin"
|
||||||
|
|
||||||
if [ ! -f "$DIR/$CAT" ]; then
|
if [ -f "$DIR/$CAT" ]; then
|
||||||
error "Failed to locate file '$(basename "$CAT")' in ISO image!" && exit 63
|
if [ -f "$DIR/$ETFS" ]; then
|
||||||
fi
|
if [ -f "$DIR/$EFISYS" ]; then
|
||||||
|
|
||||||
if [ ! -f "$DIR/$ETFS" ]; then
|
LABEL="${BASE%.*}"
|
||||||
error "Failed to locate file '$(basename "$ETFS")' in ISO image!" && exit 64
|
LABEL="${LABEL::32}"
|
||||||
fi
|
ISO="$TMP/$LABEL.tmp"
|
||||||
|
rm -f "$ISO"
|
||||||
|
|
||||||
if [ ! -f "$DIR/$EFISYS" ]; then
|
genisoimage -b "$ETFS" -no-emul-boot -c "$CAT" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -v -V "$LABEL" -udf \
|
||||||
EFISYS="efi/microsoft/boot/efisys.bin"
|
-boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -o "$ISO" -allow-limited-size "$DIR"
|
||||||
if [ -f "$DIR/$EFISYS" ]; then
|
else
|
||||||
error "Failed to locate file 'efisys_noprompt' in ISO image!"
|
error "Failed to locate file '"$(basename "$EFISYS")"' in ISO image, $FB"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
error "Failed to locate file 'efisys.bin' in ISO image!" && exit 65
|
error "Failed to locate file '"$(basename "$ETFS")"' in ISO image, $FB"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
error "Failed to locate file '"$(basename "$CAT")"' in ISO image, $FB"
|
||||||
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 \
|
|
||||||
-boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -o "$ISO" -allow-limited-size "$DIR"
|
|
||||||
|
|
||||||
mv "$ISO" "$STORAGE/$BASE"
|
mv "$ISO" "$STORAGE/$BASE"
|
||||||
rm -rf "$TMP"
|
rm -rf "$TMP"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue