Initial commit
This commit is contained in:
commit
4602228be9
13 changed files with 451 additions and 0 deletions
27
munix-init-root
Executable file
27
munix-init-root
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/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
|
||||
|
||||
chown 1001:1001 /run /dev # avoid "Detected unsafe path transition"
|
||||
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!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue