2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-02 07:26:04 +00:00

Continue to tweak the Media based image boot of a confluent diskless

This commit is contained in:
Jarrod Johnson
2026-08-27 15:47:53 -04:00
parent 34e7a10cfc
commit b6d10e5e9b
@@ -5,6 +5,9 @@ if [ -n "$1" ] && [ -d "$1" ]; then
if [ -e "$mbimntpoint/confluent/rootimg.sfs" ]; then
rootimg="$mbimntpoint/confluent/rootimg.sfs"
fi
if [ -e "$mbimntpoint/confluent/private/rootimg.key" ]; then
cp "$mbimntpoint/confluent/private/rootimg.key" /tmp/rootimg.key
fi
fi
if [ -z "$rootimg" ]; then
for addr in $(grep ^MANAGER: /etc/confluent/confluent.info|awk '{print $2}'|sed -e s/%/%25/); do
@@ -33,10 +36,12 @@ export mountsrc=$loopdev
losetup -r $loopdev /mnt/remoteimg/rootimg.sfs
confluent_nodename=$(grep ^NODENAME: /etc/confluent/confluent.info |awk '{print $2}')
if grep '^Format: confluent_crypted' /tmp/rootimg.info > /dev/null; then
while ! curl -sf -H "CONFLUENT_NODENAME: $confluent_nodename" -H "CONFLUENT_APIKEY: $(cat /etc/confluent/confluent.apikey)" https://$confluent_mgr/confluent-api/self/profileprivate/pending/rootimg.key > /tmp/rootimg.key; do
echo "Unable to retrieve private key from $confluent_mgr (verify that confluent can access /var/lib/confluent/private/os/$confluent_profile/pending/rootimg.key)"
sleep 1
done
if [ ! -s /tmp/rootimg.key ]; then
while ! curl -sf -H "CONFLUENT_NODENAME: $confluent_nodename" -H "CONFLUENT_APIKEY: $(cat /etc/confluent/confluent.apikey)" https://$confluent_mgr/confluent-api/self/profileprivate/pending/rootimg.key > /tmp/rootimg.key; do
echo "Unable to retrieve private key from $confluent_mgr (verify that confluent can access /var/lib/confluent/private/os/$confluent_profile/pending/rootimg.key)"
sleep 1
done
fi
cipher=$(head -n 1 /tmp/rootimg.key)
key=$(tail -n 1 /tmp/rootimg.key)
len=$(ls -l /mnt/remoteimg/rootimg.sfs | awk '{print $3}')