Skip to content

Commit 333948e

Browse files
authored
fix: Inherit owner from parent folder (#359)
1 parent dd59b97 commit 333948e

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
146146
```
147147

148148
> [!IMPORTANT]
149-
> 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.
149+
> 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.
150150

151151
### How do I assign an individual IP address to the container?
152152

src/boot.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ if [ ! -s "$DEST.rom" ] || [ ! -f "$DEST.rom" ]; then
5151
/run/utk.bin "$OVMF/$ROM" replace_ffs LogoDXE "/var/www/img/${PROCESS,,}.ffs" save "$DEST.tmp"
5252
fi
5353
mv "$DEST.tmp" "$DEST.rom"
54+
! setOwner "$DEST.rom" && error "Failed to set the owner for \"$DEST.rom\" !"
5455
fi
5556

5657
if [ ! -s "$DEST.vars" ] || [ ! -f "$DEST.vars" ]; then
5758
[ ! -s "$OVMF/$VARS" ] || [ ! -f "$OVMF/$VARS" ]&& error "UEFI vars file ($OVMF/$VARS) not found!" && exit 45
5859
cp "$OVMF/$VARS" "$DEST.tmp"
5960
mv "$DEST.tmp" "$DEST.vars"
61+
! setOwner "$DEST.vars" && error "Failed to set the owner for \"$DEST.vars\" !"
6062
fi
6163

6264
BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$DEST.rom"
@@ -158,6 +160,8 @@ if [ ! -f "$IMG" ]; then
158160

159161
fi
160162

163+
! setOwner "$IMG" && error "Failed to set the owner for \"$IMG\" !"
164+
161165
BOOT_DRIVE_ID="OpenCore"
162166

163167
DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},bus=pcie.0,addr=0x5,bootindex=$BOOT_INDEX"

src/install.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ install() {
155155
esac
156156

157157
rm -f "$dest"
158-
mkdir -p "$STORAGE"
158+
159+
if ! makeDir "$STORAGE"; then
160+
error "Failed to create directory \"$STORAGE\" !" && return 1
161+
fi
159162

160163
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete
161164
find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'macos.*' \) -delete
@@ -191,7 +194,9 @@ generateID() {
191194
UUID=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random)
192195
UUID="${UUID^^}"
193196
UUID="${UUID//[![:print:]]/}"
197+
194198
echo "$UUID" > "$file"
199+
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
195200

196201
return 0
197202
}
@@ -208,7 +213,9 @@ generateAddress() {
208213
# Generate Apple MAC address based on Docker container ID in hostname
209214
MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/00:16:cb:\3:\4:\5/')
210215
MAC="${MAC^^}"
216+
211217
echo "$MAC" > "$file"
218+
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
212219

213220
return 0
214221
}
@@ -239,6 +246,9 @@ generateSerial() {
239246
echo "$SN" > "$file"
240247
echo "$MLB" > "$file2"
241248

249+
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
250+
! setOwner "$file2" && error "Failed to set the owner for \"$file2\" !"
251+
242252
return 0
243253
}
244254

@@ -262,6 +272,7 @@ if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
262272

263273
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
264274
! install "$VERSION" "$BASE_IMG" && exit 34
275+
! setOwner "$BASE_IMG" && error "Failed to set the owner for \"$BASE_IMG\" !"
265276
fi
266277

267278
fi

0 commit comments

Comments
 (0)