#!/bin/bash # exit 1 until qemu-nbd is running [ -f /tmp/qemu-nbd.pid ] || exit 1 # if nbd-client --systemd-mark --persist 127.0.0.1 2000 /dev/nbd0; then ln -sf /dev/nbd0 /dev/root exit 0 else exit 1 fi