Compare commits

..

No commits in common. "8f48d1a811587022a27257b034ad7192e6c62791" and "c0377de00c1ca86da46dd97f1a4b4f4bca748fde" have entirely different histories.

2 changed files with 16 additions and 51 deletions

View File

@ -339,9 +339,7 @@ extractESD() {
local dir="$2"
local version="$3"
local desc="$4"
local size size_gb sizes space space_gb
local desc total total1 total2 total3 total4
local imageIndex links links1 links2 links3 links4
local size size_gb space space_gb desc
local msg="Extracting $desc bootdisk"
info "$msg..." && html "$msg..."
@ -353,7 +351,7 @@ extractESD() {
rm -rf "$dir"
mkdir -p "$dir"
size=9606127360
size=16106127360
size_gb=$(formatBytes "$size")
space=$(df --output=avail -B 1 "$dir" | tail -n 1)
space_gb=$(formatBytes "$space")
@ -369,22 +367,9 @@ extractESD() {
error "Cannot read the image count in ESD file!" && return 1
fi
sizes=$(wimlib-imagex info "$iso" | grep "Total Bytes:")
links=$(wimlib-imagex info "$iso" | grep "Hard Link Bytes:")
/run/progress.sh "$dir" "0" "$msg ([P])..." &
total1=$(awk "NR==1{ print; }" <<< "$sizes" | cut -d':' -f2 | sed 's/^ *//')
links1=$(awk "NR==1{ print; }" <<< "$links" | cut -d':' -f2 | sed 's/^ *//')
total=$(( total1 - links1 ))
total3=$(awk "NR==3{ print; }" <<< "$sizes" | cut -d':' -f2 | sed 's/^ *//')
links3=$(awk "NR==3{ print; }" <<< "$links" | cut -d':' -f2 | sed 's/^ *//')
total3=$(( total3 - links3 ))
total3=$(( total3 + 60000000 ))
/run/progress.sh "$dir" "$total" "$msg ([P])..." &
imageIndex="1"
wimlib-imagex apply "$iso" "$imageIndex" "$dir" --quiet 2>/dev/null || {
wimlib-imagex apply "$iso" 1 "$dir" --quiet 2>/dev/null || {
retVal=$?
fKill "progress.sh"
error "Extracting $desc bootdisk failed ($retVal)" && return 1
@ -397,23 +382,21 @@ extractESD() {
local msg="Extracting $desc environment"
info "$msg..." && html "$msg..."
/run/progress.sh "$bootWimFile" "0" "$msg ([P])..." &
imageIndex="2"
/run/progress.sh "$bootWimFile" "$total3" "$msg ([P])..." &
wimlib-imagex export "$iso" "$imageIndex" "$bootWimFile" --compress=none --quiet || {
wimlib-imagex export "$iso" 2 "$bootWimFile" --compress=none --quiet || {
retVal=$?
fKill "progress.sh"
error "Adding WinPE failed ($retVal)" && return 1
}
fKill "progress.sh"
local msg="Extracting $desc setup"
info "$msg..."
info "$msg..." && html "$msg..."
/run/progress.sh "$bootWimFile" "0" "$msg ([P])..." &
imageIndex="3"
/run/progress.sh "$bootWimFile" "$total3" "$msg ([P])..." &
wimlib-imagex export "$iso" "$imageIndex" "$bootWimFile" --compress=none --boot --quiet || {
wimlib-imagex export "$iso" 3 "$bootWimFile" --compress=none --boot --quiet || {
retVal=$?
fKill "progress.sh"
error "Adding Windows Setup failed ($retVal)" && return 1
@ -430,32 +413,25 @@ extractESD() {
local msg="Extracting $desc image"
info "$msg..." && html "$msg..."
local edition imageEdition
local edition imageIndex imageEdition
edition=$(getCatalog "$version" "name")
if [ -z "$edition" ]; then
error "Invalid VERSION specified, value \"$version\" is not recognized!" && return 1
fi
/run/progress.sh "$installWimFile" "0" "$msg ([P])..." &
for (( imageIndex=4; imageIndex<=esdImageCount; imageIndex++ )); do
imageEdition=$(wimlib-imagex info "$iso" "$imageIndex" | grep '^Description:' | sed 's/Description:[ \t]*//')
imageEdition=$(wimlib-imagex info "$iso" ${imageIndex} | grep '^Description:' | sed 's/Description:[ \t]*//')
[[ "${imageEdition,,}" != "${edition,,}" ]] && continue
total4=$(du -sb "$iso" | cut -f1)
total4=$(( total4 + 3000000 ))
/run/progress.sh "$installWimFile" "$total4" "$msg ([P])..." &
wimlib-imagex export "$iso" "$imageIndex" "$installWimFile" --compress=LZMS --chunk-size 128K --quiet || {
wimlib-imagex export "$iso" ${imageIndex} "$installWimFile" --compress=LZMS --chunk-size 128K --quiet || {
retVal=$?
fKill "progress.sh"
error "Addition of $imageIndex to the $desc image failed ($retVal)" && return 1
}
fKill "progress.sh"
return 0
done
fKill "progress.sh"

View File

@ -74,7 +74,6 @@ ready() {
finish() {
local pid
local cnt=0
local reason=$1
touch "$QEMU_END"
@ -86,20 +85,10 @@ finish() {
{ kill -15 "$pid" || true; } 2>/dev/null
while isAlive "$pid"; do
sleep 1
cnt=$((cnt+1))
# Workaround for zombie pid
[ ! -s "$QEMU_PID" ] && break
if [ "$cnt" == "5" ]; then
error "QEMU did not terminate itself, forcefully killing process..."
{ kill -9 "$pid" || true; } 2>/dev/null
fi
done
fi
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then