mirror of
https://github.com/dockur/windows.git
synced 2025-10-28 03:45:48 +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,10 +257,12 @@ finishInstall() {
|
|||
local iso="$1"
|
||||
local aborted="$2"
|
||||
|
||||
if [ -w "$iso" ]; then
|
||||
# Mark ISO as prepared via 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
|
||||
|
||||
rm -f "$STORAGE/windows.boot"
|
||||
cp /run/version "$STORAGE/windows.ver"
|
||||
|
|
@ -1170,7 +1172,9 @@ if ! updateImage "$ISO" "$DIR" "$XML"; then
|
|||
return 0
|
||||
fi
|
||||
|
||||
if ! rm -f "$ISO" 2> /dev/null; then
|
||||
if [ -w "$ISO" ]; then
|
||||
rm -f "$ISO"
|
||||
else
|
||||
BASE="windows.iso"
|
||||
ISO="$STORAGE/$BASE"
|
||||
rm -f "$ISO"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue