]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/cstart.sh
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / cstart.sh
index 71f4200a43d7d1205bcfcc09ca5a2b8baccdec0a..1b958df536f5143defd77f9a63c9925a5359a092 100755 (executable)
@@ -1,5 +1,13 @@
 #!/bin/bash -e
 
+if [ -e CMakeCache.txt ]; then
+    [ -z "$CEPH_BIN" ] && CEPH_BIN=bin
+fi
+
+if [ -z "$CEPHADM" ]; then
+    CEPHADM="${CEPH_BIN}/cephadm"
+fi
+
 image_base="quay.io/ceph-ci/ceph"
 
 if which podman 2>&1 > /dev/null; then
@@ -18,6 +26,7 @@ fi
 echo "fsid $fsid"
 
 shortid=`echo $fsid | cut -c 1-8`
+echo $shortid > shortid
 echo "shortid $shortid"
 
 # ip
@@ -35,33 +44,41 @@ fi
 echo "ip $ip"
 
 # port
-if [ -z "$port" ]; then
+if [ -e port ] ; then
+    port=`cat port`
+else
     while [ true ]
     do
         port="$(echo $(( RANDOM % 1000 + 40000 )))"
-        ss -a -n | grep LISTEN | grep "${ip}:${port} " 1>/dev/null 2>&1 || break
+        ss -a -n | grep LISTEN | grep "${ip}:${port} " 2>&1 >/dev/null || break
     done
+    echo $port > port
 fi
-echo "port $port"
+echo "mon port $port"
+
 
 # make sure we have an image
-if ! $runtime image inspect $image_base:$shortid 2>/dev/null; then
+if ! sudo $runtime image inspect $image_base:$shortid 1>/dev/null 2>/dev/null; then
     echo "building initial $image_base:$shortid image..."
     sudo ../src/script/cpatch -t $image_base:$shortid
 fi
 
-sudo ../src/cephadm/cephadm rm-cluster --force --fsid $fsid
-sudo ../src/cephadm/cephadm --image ${image_base}:${shortid} bootstrap \
+sudo $CEPHADM rm-cluster --force --fsid $fsid
+sudo $CEPHADM --image ${image_base}:${shortid} bootstrap \
      --skip-pull \
      --fsid $fsid \
      --mon-addrv "[v2:$ip:$port]" \
      --output-dir . \
-     --allow-overwrite
+     --allow-overwrite \
+     $@
 
 # kludge to make 'bin/ceph ...' work
 sudo chmod 755 ceph.client.admin.keyring
 echo 'keyring = ceph.client.admin.keyring' >> ceph.conf
 
+# don't use repo digests; this implicitly does a pull and we don't want that
+${CEPH_BIN}/ceph config set mgr mgr/cephadm/use_repo_digest false
+
 echo
 echo "sudo ../src/script/cpatch -t $image_base:$shortid"
 echo