From 9eb6f38bf1c9d2c5cf5992ced39b1fb714e3ef37 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 23 Jul 2021 18:43:57 -0400 Subject: [PATCH] Various fixes to imageboot.sh --- .../el8-diskless/profiles/default/scripts/imageboot.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh index 5da17989..b96dcd2a 100644 --- a/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh @@ -12,11 +12,11 @@ loopdev=$(losetup -f) mountsrc=$loopdev losetup -r $loopdev /mnt/remoteimg/rootimg.sfs if grep '^Format: confluent_crypted' /tmp/rootimg.info > /dev/null; then - curl -sf -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $(cat /etc/confluent/confluent.apikey)" https://$confluent_mgr/confluent-api/self//profileprivate/pending/rootimg.key' > /tmp/rootimg.key + curl -sf -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $(cat /etc/confluent/confluent.apikey)" https://$confluent_mgr/confluent-api/self/profileprivate/pending/rootimg.key > /tmp/rootimg.key cipher=$(head -n 1 /tmp/rootimg.key) - key=$(head -n 1 /tmp/rootimg.key) - len=$(stat -c %s /mnt/remoteimg/rootimg.sfs) - len=$(((i-4096)/512)) + key=$(tail -n 1 /tmp/rootimg.key) + len=$(wc -c /mnt/remoteimg/rootimg.sfs | awk '{print $1}') + len=$(((len-4096)/512)) dmsetup create cryptimg --table "0 $len crypt $cipher $key 0 $loopdev 8" /opt/confluent/bin/confluent_imginfo /dev/mapper/cryptimg > /tmp/rootimg.info mntsrc=/dev/mapper/cryptimg