Follow DLS' breaking changes, init rename and unlock API

This commit is contained in:
Guillaume 2023-11-06 17:17:02 +01:00
parent 01a457ccfe
commit 09e63cf400
4 changed files with 8 additions and 9 deletions

View File

@ -73,7 +73,7 @@ unlock_store() {
pinfo "Direktil Local Server store already unlocked"
else
pinfo "Unlocking the DLS store ..."
DLS_ADM_TOKEN=$(dls /public/unlock-store -d "\"${DLS_UNLOCK_TOKEN}\""|tr -d \")
DLS_ADM_TOKEN=$(dls /public/unlock-store -d '{"Name": "novit", "Passphrase": "'$(echo -n ${DLS_UNLOCK_TOKEN}|base64 -w0)'"}'|tr -d \")
pinfo "Admin access token is $DLS_ADM_TOKEN"
echo $DLS_ADM_TOKEN > $tknfile
chmod 444 $tknfile
@ -94,7 +94,7 @@ get_hosts() {
get_parts() {
for host in ${!hosts[*]}; do
mkdir -p $ctxdir/data/$host
for part in kernel initrd-v2
for part in kernel initrd
do
partfile=$ctxdir/data/$host/$part
test -f $partfile || { pinfo "Downloading $part for host $host" && dls /hosts/$host/$part -o $partfile; }

View File

@ -27,7 +27,6 @@ start_store() {
-e HTTPS_PROXY=$HTTPS_PROXY \
-v .:/var/lib/direktil \
$DLS_IMG &
# -auto-unlock 'N0v!T'
sleep 2
}

View File

@ -33,7 +33,7 @@ setup_network_qemu() {
if ! test -d /etc/qemu; then
mkdir -p /etc/qemu
fi
if ! grep -q "allow $QEMU_BR_NAME" /etc/qemu/bridge.conf; then
if ! grep -qs "allow $QEMU_BR_NAME" /etc/qemu/bridge.conf; then
echo "allow $QEMU_BR_NAME" >> /etc/qemu/bridge.conf
fi
}
@ -46,7 +46,7 @@ run_qemu() {
pinfo "Starting host $host with ip ${hosts[$host]}"
qemu-system-x86_64 -enable-kvm -smp $QEMU_VM_CPU -m $QEMU_VM_MEM \
-nic bridge,br=$QEMU_BR_NAME,mac=42:42:42:42:42:0${id} \
-kernel $ctxdir/data/$host/kernel -initrd $ctxdir/data/$host/initrd-v2 -vga qxl \
-kernel $ctxdir/data/$host/kernel -initrd $ctxdir/data/$host/initrd -vga qxl \
-drive format=raw,file=$ctxdir/data/$host/disk &
echo $! >$ctxdir/data/$host/pid
((++id))

View File

@ -1,14 +1,14 @@
## Vars
# Admin token to unlock the DLS store
# Admin token to unlock the DLS store, replace it!
DLS_UNLOCK_TOKEN=changeme
# Docker container name for dir2config
D2C_IMG=novit.tech/direktil/local-server:b6fa941
D2C_IMG=novit.tech/direktil/local-server:latest
D2C_CTR_NAME=dir2config
# Docker container name for direktil local server
DLS_IMG=novit.tech/direktil/local-server:b6fa941
DLS_IMG=novit.tech/direktil/local-server:latest
DLS_CTR_NAME=dls
# QEMU local bridge name. If you specificy a custom name, you may have to configure qemu bridge helper to allow it
@ -18,7 +18,7 @@ QEMU_DISK_SIZE=30G
# Allocated CPUs to QEMU VMs
QEMU_VM_CPU=4
# Allocated Memory to QEMU VMs
QEMU_VM_MEM=8096
QEMU_VM_MEM=4096
################
# Token file for dls