2025-09-25 22:29:24 -03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
unset LANGUAGE LC_ALL LC_CTYPE LC_NUMERIC LC_COLLATE LC_TIME LC_MESSAGES LC_MONETARY LC_ADDRESS LC_IDENTIFICATION LC_MEASUREMENT LC_PAPER LC_TELEPHONE LC_NAME LANG 2>/dev/null # perl, calm down
|
|
|
|
|
PATH=$MICROVM_CLOSURE/sw/bin
|
|
|
|
|
|
|
|
|
|
echo "=> Initializing microVM environment"
|
|
|
|
|
|
|
|
|
|
mkdir /run/log
|
|
|
|
|
|
|
|
|
|
# Prepare mounts for paths that activation writes to
|
|
|
|
|
mount -t tmpfs tmpfs /etc
|
|
|
|
|
cp /run/muvm-host/etc/resolv.conf /etc/resolv.conf
|
|
|
|
|
mount -t tmpfs tmpfs /usr/bin
|
|
|
|
|
cp /run/muvm-host/usr/bin/munix-init-user /usr/bin/munix-init-user
|
|
|
|
|
mount -t tmpfs tmpfs /dev/shm # tries to remount, fails on virtiofs due to unexpected opts
|
|
|
|
|
|
|
|
|
|
$MICROVM_CLOSURE/activate >/run/log/activate.spam 2>&1
|
|
|
|
|
|
|
|
|
|
umount /dev/shm # restore the original virtiofs dax shm though
|
|
|
|
|
|
2025-09-25 22:29:24 -03:00
|
|
|
chown $MICROVM_UID:$MICROVM_GID /run /dev # avoid "Detected unsafe path transition"
|
2025-09-25 22:29:24 -03:00
|
|
|
systemd-tmpfiles --create >/run/log/tmpfiles.spam 2>&1
|
|
|
|
|
|
|
|
|
|
systemd-machine-id-setup >/dev/null 2>&1
|
|
|
|
|
|
|
|
|
|
$MICROVM_CLOSURE/sw/lib/systemd/systemd-udevd >/run/log/udevd.spam 2>&1 &
|
|
|
|
|
|
|
|
|
|
echo "=> microVM environment ready!"
|