Skip to content

Commit ec23188

Browse files
committed
ci: Update
Signed-off-by: Zhang fei <zhangfei@iscas.ac.cn>
1 parent 9b1a8d7 commit ec23188

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.github/workflows/_linux-build.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,27 @@ jobs:
290290
TOTAL_MEMORY_WITH_SWAP=$(("${TOTAL_AVAILABLE_MEMORY_IN_GB%.*}" + 3))
291291
292292
if [[ ${BUILD_ENVIRONMENT} == *"riscv64"* ]]; then
293-
for i in {1..3}; do
294-
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
295-
sleep 2
296-
done
297-
298-
sleep 5
299-
ls -la /proc/sys/fs/binfmt_misc/
300-
cat /proc/sys/fs/binfmt_misc/qemu-riscv64 2>/dev/null || echo "qemu-riscv64 registration failed"
293+
# EC2 specific setup for RISC-V emulation
294+
# Ensure binfmt_misc is available
295+
echo "Mounting binfmt_misc filesystem"
296+
sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc 2>/dev/null || true
297+
298+
echo "QEMU registration: multiarch/qemu-user-static"
299+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes || true
300+
sleep 3
301+
302+
# Final verification
303+
echo "Checking binfmt_misc status:"
304+
ls -la /proc/sys/fs/binfmt_misc/ 2>/dev/null || echo "Cannot access binfmt_misc directory"
305+
306+
if [ -f /proc/sys/fs/binfmt_misc/qemu-riscv64 ]; then
307+
echo "qemu-riscv64 registration successful"
308+
cat /proc/sys/fs/binfmt_misc/qemu-riscv64 | head -3
309+
else
310+
echo "qemu-riscv64 registration failed - proceeding without emulation"
311+
echo "This may cause RISC-V builds to fail"
312+
fi
313+
301314
RISCV_DOCKER_ARGS="--privileged"
302315
else
303316
RISCV_DOCKER_ARGS=

0 commit comments

Comments
 (0)