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" pinfo "Direktil Local Server store already unlocked"
else else
pinfo "Unlocking the DLS store ..." 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" pinfo "Admin access token is $DLS_ADM_TOKEN"
echo $DLS_ADM_TOKEN > $tknfile echo $DLS_ADM_TOKEN > $tknfile
chmod 444 $tknfile chmod 444 $tknfile
@ -94,7 +94,7 @@ get_hosts() {
get_parts() { get_parts() {
for host in ${!hosts[*]}; do for host in ${!hosts[*]}; do
mkdir -p $ctxdir/data/$host mkdir -p $ctxdir/data/$host
for part in kernel initrd-v2 for part in kernel initrd
do do
partfile=$ctxdir/data/$host/$part partfile=$ctxdir/data/$host/$part
test -f $partfile || { pinfo "Downloading $part for host $host" && dls /hosts/$host/$part -o $partfile; } 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 \ -e HTTPS_PROXY=$HTTPS_PROXY \
-v .:/var/lib/direktil \ -v .:/var/lib/direktil \
$DLS_IMG & $DLS_IMG &
# -auto-unlock 'N0v!T'
sleep 2 sleep 2
} }

View File

@ -33,7 +33,7 @@ setup_network_qemu() {
if ! test -d /etc/qemu; then if ! test -d /etc/qemu; then
mkdir -p /etc/qemu mkdir -p /etc/qemu
fi 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 echo "allow $QEMU_BR_NAME" >> /etc/qemu/bridge.conf
fi fi
} }
@ -46,7 +46,7 @@ run_qemu() {
pinfo "Starting host $host with ip ${hosts[$host]}" pinfo "Starting host $host with ip ${hosts[$host]}"
qemu-system-x86_64 -enable-kvm -smp $QEMU_VM_CPU -m $QEMU_VM_MEM \ 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} \ -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 & -drive format=raw,file=$ctxdir/data/$host/disk &
echo $! >$ctxdir/data/$host/pid echo $! >$ctxdir/data/$host/pid
((++id)) ((++id))

View File

@ -1,14 +1,14 @@
## Vars ## Vars
# Admin token to unlock the DLS store # Admin token to unlock the DLS store, replace it!
DLS_UNLOCK_TOKEN=changeme DLS_UNLOCK_TOKEN=changeme
# Docker container name for dir2config # 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 D2C_CTR_NAME=dir2config
# Docker container name for direktil local server # 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 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 # 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 # Allocated CPUs to QEMU VMs
QEMU_VM_CPU=4 QEMU_VM_CPU=4
# Allocated Memory to QEMU VMs # Allocated Memory to QEMU VMs
QEMU_VM_MEM=8096 QEMU_VM_MEM=4096
################ ################
# Token file for dls # Token file for dls