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 <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35961>
This commit is contained in:
Vignesh Raman
2025-07-08 11:15:22 +05:30
committed by Marge Bot
parent 89ff124263
commit 54fcb0e443

View File

@@ -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