mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-23 22:49:43 -05:00
28 lines
722 B
Bash
28 lines
722 B
Bash
#!/usr/bin/env bash
|
|
# Copyright (c) Edgeless Systems GmbH
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
set -euo pipefail
|
|
shopt -s extglob nullglob
|
|
|
|
GCP_STATE_DISK_SYMLINK="/dev/disk/by-id/google-state-disk"
|
|
|
|
# hack: google nvme udev rules are never executed. Create symlinks for the nvme devices manually.
|
|
while [ ! -L "${GCP_STATE_DISK_SYMLINK}" ]
|
|
do
|
|
for nvmedisk in /dev/nvme0n+([0-9])
|
|
do
|
|
/usr/lib/udev/google_nvme_id -s -d "${nvmedisk}" || true
|
|
done
|
|
if [ -L "${GCP_STATE_DISK_SYMLINK}" ]; then
|
|
break
|
|
fi
|
|
echo "Waiting for state disk to appear.."
|
|
sleep 2
|
|
done
|
|
|
|
echo "Google state disk found"
|
|
echo ${GCP_STATE_DISK_SYMLINK} → $(readlink -f "${GCP_STATE_DISK_SYMLINK}")
|
|
sleep 2
|