2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-14 01:29:23 +00:00

Various fixes to imageboot.sh

This commit is contained in:
Jarrod Johnson 2021-07-23 18:43:57 -04:00
parent 4928f50332
commit 9eb6f38bf1

View File

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