fix: Inherit owner from parent folder (#359)

This commit is contained in:
Kroese 2025-10-22 04:03:24 +02:00 committed by GitHub
parent dd59b97af6
commit 333948ef19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 2 deletions

View file

@ -146,7 +146,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
```
> [!IMPORTANT]
> If your system has an AMD processor it is generally not advisable to enable multiple cores (at least not until macOS is installed and running correctly). It might introduce stability and performance problems, so proceed with caution.
> If your system has an AMD processor (instead of Intel), it is not advisable to enable multiple cores before the installation is completed and you have verified that everything runs stable for a while. Because in many cases it will introduce issues, which are difficult to pinpoint if you do not have experience with its behavior on a single core first.
### How do I assign an individual IP address to the container?

View file

@ -51,12 +51,14 @@ if [ ! -s "$DEST.rom" ] || [ ! -f "$DEST.rom" ]; then
/run/utk.bin "$OVMF/$ROM" replace_ffs LogoDXE "/var/www/img/${PROCESS,,}.ffs" save "$DEST.tmp"
fi
mv "$DEST.tmp" "$DEST.rom"
! setOwner "$DEST.rom" && error "Failed to set the owner for \"$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.tmp"
mv "$DEST.tmp" "$DEST.vars"
! setOwner "$DEST.vars" && error "Failed to set the owner for \"$DEST.vars\" !"
fi
BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$DEST.rom"
@ -158,6 +160,8 @@ if [ ! -f "$IMG" ]; then
fi
! setOwner "$IMG" && error "Failed to set the owner for \"$IMG\" !"
BOOT_DRIVE_ID="OpenCore"
DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},bus=pcie.0,addr=0x5,bootindex=$BOOT_INDEX"

View file

@ -155,7 +155,10 @@ install() {
esac
rm -f "$dest"
mkdir -p "$STORAGE"
if ! makeDir "$STORAGE"; then
error "Failed to create directory \"$STORAGE\" !" && return 1
fi
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete
find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'macos.*' \) -delete
@ -191,7 +194,9 @@ generateID() {
UUID=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random)
UUID="${UUID^^}"
UUID="${UUID//[![:print:]]/}"
echo "$UUID" > "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
return 0
}
@ -208,7 +213,9 @@ generateAddress() {
# Generate Apple MAC address based on Docker container ID in hostname
MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/00:16:cb:\3:\4:\5/')
MAC="${MAC^^}"
echo "$MAC" > "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
return 0
}
@ -239,6 +246,9 @@ generateSerial() {
echo "$SN" > "$file"
echo "$MLB" > "$file2"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
! setOwner "$file2" && error "Failed to set the owner for \"$file2\" !"
return 0
}
@ -262,6 +272,7 @@ if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
! install "$VERSION" "$BASE_IMG" && exit 34
! setOwner "$BASE_IMG" && error "Failed to set the owner for \"$BASE_IMG\" !"
fi
fi