Update install.sh

This commit is contained in:
Kroese 2024-01-25 08:06:02 +01:00 committed by GitHub
parent 4ad0fdc5c8
commit 8ffea86f1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -261,7 +261,7 @@ extractImage() {
local iso="$1" local iso="$1"
local dir="$2" local dir="$2"
local size size_gb space space_gb len offset local size size_gb space space_gb
local msg="Extracting downloaded ISO image..." local msg="Extracting downloaded ISO image..."
[ -n "$CUSTOM" ] && msg="Extracting local ISO image..." [ -n "$CUSTOM" ] && msg="Extracting local ISO image..."
@ -287,15 +287,6 @@ extractImage() {
exit 66 exit 66
fi fi
#ETFS="boot.img"
#len=$(isoinfo -d -i "$iso" | grep "Nsect " | grep -o "[^ ]*$")
#offset=$(isoinfo -d -i "$iso" | grep "Bootoff " | grep -o "[^ ]*$")
#if ! dd if="$ISO" of="$dir/boot.img" bs=2048 "count=$len" "skip=$offset" status=none; then
# error "Failed to extract boot image from ISO!"
# exit 67
#fi
if [ ! -f "$dir/$ETFS" ] || [ ! -f "$dir/$EFISYS" ]; then if [ ! -f "$dir/$ETFS" ] || [ ! -f "$dir/$EFISYS" ]; then
if [ ! -f "$dir/$ETFS" ]; then if [ ! -f "$dir/$ETFS" ]; then
@ -390,8 +381,9 @@ selectXML() {
updateImage() { updateImage() {
local dir="$1" local iso="$1"
local asset="$2" local dir="$2"
local asset="/run/assets/$3"
local index result local index result
[ ! -f "$asset" ] && return 0 [ ! -f "$asset" ] && return 0
@ -420,6 +412,22 @@ updateImage() {
return 1 return 1
fi fi
if [[ "$2" == "win7x64-ultimate.xml" ]]; then
ETFS="boot.img"
BOOT_MODE="windows_legacy"
local len offset
len=$(isoinfo -d -i "$iso" | grep "Nsect " | grep -o "[^ ]*$")
offset=$(isoinfo -d -i "$iso" | grep "Bootoff " | grep -o "[^ ]*$")
if ! dd "if=$iso" "of=$dir/boot.img" bs=2048 "count=$len" "skip=$offset" status=none; then
error "Failed to extract boot image from ISO!"
exit 67
fi
fi
return 0 return 0
} }
@ -501,7 +509,7 @@ if ! selectXML "$DIR"; then
return 0 return 0
fi fi
if ! updateImage "$DIR" "/run/assets/$XML"; then if ! updateImage "$ISO" "$DIR" "$XML"; then
abortInstall "$ISO" abortInstall "$ISO"
return 0 return 0
fi fi