mirror of
https://github.com/dockur/windows.git
synced 2025-10-28 11:45:50 +00:00
fix: Check if file is writeable
This commit is contained in:
parent
566ea4cb61
commit
2f8c4e38a1
1 changed files with 8 additions and 4 deletions
|
|
@ -257,9 +257,11 @@ finishInstall() {
|
||||||
local iso="$1"
|
local iso="$1"
|
||||||
local aborted="$2"
|
local aborted="$2"
|
||||||
|
|
||||||
# Mark ISO as prepared via magic byte
|
if [ -w "$iso" ]; then
|
||||||
if ! printf '\x16' | dd of="$iso" bs=1 seek=0 count=1 conv=notrunc status=none; then
|
# Mark ISO as prepared via magic byte
|
||||||
error "Failed to set magic byte!"
|
if ! printf '\x16' | dd of="$iso" bs=1 seek=0 count=1 conv=notrunc status=none; then
|
||||||
|
error "Failed to set magic byte!"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$STORAGE/windows.boot"
|
rm -f "$STORAGE/windows.boot"
|
||||||
|
|
@ -1170,7 +1172,9 @@ if ! updateImage "$ISO" "$DIR" "$XML"; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! rm -f "$ISO" 2> /dev/null; then
|
if [ -w "$ISO" ]; then
|
||||||
|
rm -f "$ISO"
|
||||||
|
else
|
||||||
BASE="windows.iso"
|
BASE="windows.iso"
|
||||||
ISO="$STORAGE/$BASE"
|
ISO="$STORAGE/$BASE"
|
||||||
rm -f "$ISO"
|
rm -f "$ISO"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue