From 54fcb0e44302fd9195c976546bf8bf840f94fa5a Mon Sep 17 00:00:00 2001 From: Vignesh Raman Date: Tue, 8 Jul 2025 11:15:22 +0530 Subject: [PATCH] ci/init-stage1: avoid duplicate mounts Check if filesystems are mounted before attempting to mount them, and use mkdir -p to prevent errors if directories already exist. Signed-off-by: Vignesh Raman Part-of: --- .gitlab-ci/common/init-stage1.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci/common/init-stage1.sh b/.gitlab-ci/common/init-stage1.sh index c270d633531..5fbe638a5b5 100755 --- a/.gitlab-ci/common/init-stage1.sh +++ b/.gitlab-ci/common/init-stage1.sh @@ -13,13 +13,13 @@ cd / findmnt --mountpoint /proc || mount -t proc none /proc findmnt --mountpoint /sys || mount -t sysfs none /sys -mount -t debugfs none /sys/kernel/debug +findmnt --mountpoint /sys/kernel/debug || mount -t debugfs none /sys/kernel/debug findmnt --mountpoint /dev || mount -t devtmpfs none /dev mkdir -p /dev/pts -mount -t devpts devpts /dev/pts -mkdir /dev/shm -mount -t tmpfs -o noexec,nodev,nosuid tmpfs /dev/shm -mount -t tmpfs tmpfs /tmp +findmnt --mountpoint /dev/pts || mount -t devpts devpts /dev/pts +mkdir -p /dev/shm +findmnt --mountpoint /dev/shm || mount -t tmpfs -o noexec,nodev,nosuid tmpfs /dev/shm +findmnt --mountpoint /tmp || mount -t tmpfs tmpfs /tmp echo "nameserver 8.8.8.8" > /etc/resolv.conf [ -z "$NFS_SERVER_IP" ] || echo "$NFS_SERVER_IP caching-proxy" >> /etc/hosts