mirror of
https://github.com/dockur/windows.git
synced 2025-11-06 14:53:49 +00:00
Compare commits
No commits in common. "8f48d1a811587022a27257b034ad7192e6c62791" and "c0377de00c1ca86da46dd97f1a4b4f4bca748fde" have entirely different histories.
8f48d1a811
...
c0377de00c
@ -339,9 +339,7 @@ extractESD() {
|
|||||||
local dir="$2"
|
local dir="$2"
|
||||||
local version="$3"
|
local version="$3"
|
||||||
local desc="$4"
|
local desc="$4"
|
||||||
local size size_gb sizes space space_gb
|
local size size_gb space space_gb desc
|
||||||
local desc total total1 total2 total3 total4
|
|
||||||
local imageIndex links links1 links2 links3 links4
|
|
||||||
|
|
||||||
local msg="Extracting $desc bootdisk"
|
local msg="Extracting $desc bootdisk"
|
||||||
info "$msg..." && html "$msg..."
|
info "$msg..." && html "$msg..."
|
||||||
@ -353,7 +351,7 @@ extractESD() {
|
|||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
mkdir -p "$dir"
|
mkdir -p "$dir"
|
||||||
|
|
||||||
size=9606127360
|
size=16106127360
|
||||||
size_gb=$(formatBytes "$size")
|
size_gb=$(formatBytes "$size")
|
||||||
space=$(df --output=avail -B 1 "$dir" | tail -n 1)
|
space=$(df --output=avail -B 1 "$dir" | tail -n 1)
|
||||||
space_gb=$(formatBytes "$space")
|
space_gb=$(formatBytes "$space")
|
||||||
@ -369,22 +367,9 @@ extractESD() {
|
|||||||
error "Cannot read the image count in ESD file!" && return 1
|
error "Cannot read the image count in ESD file!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sizes=$(wimlib-imagex info "$iso" | grep "Total Bytes:")
|
/run/progress.sh "$dir" "0" "$msg ([P])..." &
|
||||||
links=$(wimlib-imagex info "$iso" | grep "Hard Link Bytes:")
|
|
||||||
|
|
||||||
total1=$(awk "NR==1{ print; }" <<< "$sizes" | cut -d':' -f2 | sed 's/^ *//')
|
wimlib-imagex apply "$iso" 1 "$dir" --quiet 2>/dev/null || {
|
||||||
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 || {
|
|
||||||
retVal=$?
|
retVal=$?
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
error "Extracting $desc bootdisk failed ($retVal)" && return 1
|
error "Extracting $desc bootdisk failed ($retVal)" && return 1
|
||||||
@ -397,23 +382,21 @@ extractESD() {
|
|||||||
|
|
||||||
local msg="Extracting $desc environment"
|
local msg="Extracting $desc environment"
|
||||||
info "$msg..." && html "$msg..."
|
info "$msg..." && html "$msg..."
|
||||||
|
/run/progress.sh "$bootWimFile" "0" "$msg ([P])..." &
|
||||||
|
|
||||||
imageIndex="2"
|
wimlib-imagex export "$iso" 2 "$bootWimFile" --compress=none --quiet || {
|
||||||
/run/progress.sh "$bootWimFile" "$total3" "$msg ([P])..." &
|
|
||||||
|
|
||||||
wimlib-imagex export "$iso" "$imageIndex" "$bootWimFile" --compress=none --quiet || {
|
|
||||||
retVal=$?
|
retVal=$?
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
error "Adding WinPE failed ($retVal)" && return 1
|
error "Adding WinPE failed ($retVal)" && return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fKill "progress.sh"
|
||||||
|
|
||||||
local msg="Extracting $desc setup"
|
local msg="Extracting $desc setup"
|
||||||
info "$msg..."
|
info "$msg..." && html "$msg..."
|
||||||
|
/run/progress.sh "$bootWimFile" "0" "$msg ([P])..." &
|
||||||
|
|
||||||
imageIndex="3"
|
wimlib-imagex export "$iso" 3 "$bootWimFile" --compress=none --boot --quiet || {
|
||||||
/run/progress.sh "$bootWimFile" "$total3" "$msg ([P])..." &
|
|
||||||
|
|
||||||
wimlib-imagex export "$iso" "$imageIndex" "$bootWimFile" --compress=none --boot --quiet || {
|
|
||||||
retVal=$?
|
retVal=$?
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
error "Adding Windows Setup failed ($retVal)" && return 1
|
error "Adding Windows Setup failed ($retVal)" && return 1
|
||||||
@ -430,32 +413,25 @@ extractESD() {
|
|||||||
local msg="Extracting $desc image"
|
local msg="Extracting $desc image"
|
||||||
info "$msg..." && html "$msg..."
|
info "$msg..." && html "$msg..."
|
||||||
|
|
||||||
local edition imageEdition
|
local edition imageIndex imageEdition
|
||||||
edition=$(getCatalog "$version" "name")
|
edition=$(getCatalog "$version" "name")
|
||||||
|
|
||||||
if [ -z "$edition" ]; then
|
if [ -z "$edition" ]; then
|
||||||
error "Invalid VERSION specified, value \"$version\" is not recognized!" && return 1
|
error "Invalid VERSION specified, value \"$version\" is not recognized!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
/run/progress.sh "$installWimFile" "0" "$msg ([P])..." &
|
||||||
|
|
||||||
for (( imageIndex=4; imageIndex<=esdImageCount; imageIndex++ )); do
|
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
|
[[ "${imageEdition,,}" != "${edition,,}" ]] && continue
|
||||||
|
wimlib-imagex export "$iso" ${imageIndex} "$installWimFile" --compress=LZMS --chunk-size 128K --quiet || {
|
||||||
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 || {
|
|
||||||
retVal=$?
|
retVal=$?
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
error "Addition of $imageIndex to the $desc image failed ($retVal)" && return 1
|
error "Addition of $imageIndex to the $desc image failed ($retVal)" && return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
|
|||||||
11
src/power.sh
11
src/power.sh
@ -74,7 +74,6 @@ ready() {
|
|||||||
finish() {
|
finish() {
|
||||||
|
|
||||||
local pid
|
local pid
|
||||||
local cnt=0
|
|
||||||
local reason=$1
|
local reason=$1
|
||||||
|
|
||||||
touch "$QEMU_END"
|
touch "$QEMU_END"
|
||||||
@ -86,20 +85,10 @@ finish() {
|
|||||||
{ kill -15 "$pid" || true; } 2>/dev/null
|
{ kill -15 "$pid" || true; } 2>/dev/null
|
||||||
|
|
||||||
while isAlive "$pid"; do
|
while isAlive "$pid"; do
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
cnt=$((cnt+1))
|
|
||||||
|
|
||||||
# Workaround for zombie pid
|
# Workaround for zombie pid
|
||||||
[ ! -s "$QEMU_PID" ] && break
|
[ ! -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
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then
|
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user