Skip to content

Commit 3eb0a18

Browse files
miczyg1Autosync Dev
authored andcommitted
build.sh: Fix permissions when building with GH actions
The GH runners have UID 1001, while user coreboot in SDK has id 1000. This creates a mismatch of IDs and causes permission problems when mounting coreboot git repository under /home/coreboot/coreboot in the container, because the /home/coreboot is a HOME directory of different user. To fix the problem, move the mountpoint to a "neutral" place, where permissions should not be a an issue. The /build directory is chosen so that it does not collide with any HOME directory or system directory. Upstream-Status: Inappropriate [Dasharo CI] Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
1 parent 190a324 commit 3eb0a18

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

build.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ BUILD_TIMELESS=${BUILD_TIMELESS:-0}
4848
AIRGAP=${AIRGAP:-0}
4949

5050
function sdk_run {
51-
docker run --rm -t -u $UID -v $PWD:/home/coreboot/coreboot \
51+
docker run --rm -t -u $UID \
52+
-v $PWD:/build/coreboot \
5253
-v $HOME/.ssh:/home/coreboot/.ssh \
5354
-e BUILD_TIMELESS=${BUILD_TIMELESS} \
54-
-w /home/coreboot/coreboot ${DASHARO_SDK} \
55+
-w /build/coreboot ${DASHARO_SDK} \
5556
"$@"
5657
}
5758

@@ -221,11 +222,9 @@ function build_novacustom_v5x0tu {
221222
wget -O novacustom_v54x_mtl_v0.9.0.rom https://dl.3mdeb.com/open-source-firmware/Dasharo/novacustom_v54x_mtl/v0.9.0/novacustom_v54x_mtl_v0.9.0.rom
222223

223224
# Extract and transfer LAN ROM blob
224-
docker run --rm -t -u $UID -v $PWD:/home/coreboot/coreboot \
225-
-v $HOME/.ssh:/home/coreboot/.ssh \
226-
-w /home/coreboot/coreboot ${DASHARO_SDK} \
227-
/bin/bash -c "make -C util/cbfstool && \
228-
util/cbfstool/cbfstool novacustom_v54x_mtl_v0.9.0.rom extract -r COREBOOT -f payload -n fallback/payload -m x86"
225+
sdk_run /bin/bash -c "make -C util/cbfstool && \
226+
util/cbfstool/cbfstool novacustom_v54x_mtl_v0.9.0.rom extract \
227+
-r COREBOOT -f payload -n fallback/payload -m x86"
229228

230229
./uefiextract payload DEB917C0-C56A-4860-A05B-BF2F22EBB717
231230
mkdir -p 3rdparty/blobs/mainboard/novacustom/mtl-h

0 commit comments

Comments
 (0)