diff --git a/README.md b/README.md index e69de29..55f5d91 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,5 @@ + +todo: +1. specify id for vm disks +2. figure out if we need direct=on on --disk options +3. test on my homelab? diff --git a/host/virtiofsd.service b/host/virtiofsd.service deleted file mode 100644 index 988fe1c..0000000 --- a/host/virtiofsd.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=VirtioFS daemon - -[Service] -Type=simple -ExecStart=/usr/libexec/virtiofsd \ - --socket-path=/run//virtiofs.sock \ - --shared-dir=/srv/vm1-data - -Restart=always -RestartSec=1 - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/image/Makefile b/image/Makefile index 6fabad9..247b32e 100644 --- a/image/Makefile +++ b/image/Makefile @@ -2,7 +2,7 @@ SHELL := /bin/sh # --- configurable ---------------------------------------------------- IMAGE_NAME = alpine-vm -IMAGE_SIZE ?= 2G +IMAGE_SIZE ?= 1G IMAGE_FORMAT = raw ALPINE_BRANCH ?= latest-stable KERNEL_FLAVOR ?= virt diff --git a/image/configure.sh b/image/configure.sh index 96e1a9d..b4c83e8 100755 --- a/image/configure.sh +++ b/image/configure.sh @@ -32,10 +32,16 @@ rc-update add net.eth0 default rc-update add acpid default rc-update add docker default rc-update add cronie default +rc-update add mount boot -step 'Clean up APK cache' +step 'Clean up APK cache and documents' rm -rf /var/cache/apk/* || true +rm -rf \ + /usr/share/man \ + /usr/share/doc \ + /usr/share/info + step 'Setup git user' git config --user.email bearnet+keeper@sab.ee git config --user.name "B.B.K.K.B.K.K" diff --git a/image/overlay/etc/fstab b/image/overlay/etc/fstab index a9c645f..46e34d6 100644 --- a/image/overlay/etc/fstab +++ b/image/overlay/etc/fstab @@ -1,5 +1,4 @@ # /etc/fstab: static file system information # # -/dev/root / ext4 rw,noatime 0 1 -data /data virtiofs rw,noatime,_netdev 0 0 +/dev/vdb /data ext4 rw,noatime 0 1 \ No newline at end of file diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 39b738d..7a8dd6d 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -2,7 +2,9 @@ set -euo pipefail /usr/bin/cloud-hypervisor \ - --kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt --disk path=/image/vm.raw \ + --kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \ + --disk path=/image/vm.raw,image_type=raw \ + --disk path=/image/data.raw,direct=on\ --cmdline "root=/dev/vda rootfstype=ext4 modules=ext4a rw console=hvc0" \ --cpus boot=${CPU_COUNT:-4} \ --memory size=${MEMORY:-4G},shared=on \