mirror of
https://github.com/dockur/macos.git
synced 2026-03-11 08:34:24 +00:00
fix: Use temporary file when extracting ROM (#352)
This commit is contained in:
parent
fb7cd67691
commit
6672deb920
1 changed files with 7 additions and 4 deletions
11
src/boot.sh
11
src/boot.sh
|
|
@ -45,15 +45,18 @@ DEST="$STORAGE/$DEST"
|
|||
|
||||
if [ ! -s "$DEST.rom" ] || [ ! -f "$DEST.rom" ]; then
|
||||
[ ! -s "$OVMF/$ROM" ] || [ ! -f "$OVMF/$ROM" ] && error "UEFI boot file ($OVMF/$ROM) not found!" && exit 44
|
||||
cp "$OVMF/$ROM" "$DEST.rom"
|
||||
if [[ "${LOGO:-}" != [Nn]* ]]; then
|
||||
/run/utk.bin "$DEST.rom" replace_ffs LogoDXE "/var/www/img/macos.ffs" save "$DEST.rom"
|
||||
if [[ "${LOGO:-}" == [Nn]* ]]; then
|
||||
cp "$OVMF/$ROM" "$DEST.tmp"
|
||||
else
|
||||
/run/utk.bin "$OVMF/$ROM" replace_ffs LogoDXE "/var/www/img/${PROCESS,,}.ffs" save "$DEST.tmp"
|
||||
fi
|
||||
mv "$DEST.tmp" "$DEST.rom"
|
||||
fi
|
||||
|
||||
if [ ! -s "$DEST.vars" ] || [ ! -f "$DEST.vars" ]; then
|
||||
[ ! -s "$OVMF/$VARS" ] || [ ! -f "$OVMF/$VARS" ]&& error "UEFI vars file ($OVMF/$VARS) not found!" && exit 45
|
||||
cp "$OVMF/$VARS" "$DEST.vars"
|
||||
cp "$OVMF/$VARS" "$DEST.tmp"
|
||||
mv "$DEST.tmp" "$DEST.vars"
|
||||
fi
|
||||
|
||||
BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$DEST.rom"
|
||||
|
|
|
|||
Loading…
Reference in a new issue