#!/bin/bash set -Eeuo pipefail if [[ -d "/secrets" ]]; then /usr/local/bin/devbox-template fi # Add some /dev devices [ -e /dev/loop-control ] || mknod /dev/loop-control c 10 237 for i in {0..7}; do [ -e "/dev/loop$i" ] || mknod "/dev/loop$i" b 7 $i done # Allocate a space for containers function overlay_fs() { STORAGE="$1" IMG="$2" SIZE=40G if [ "$(df -PT "$STORAGE" | tail -1 | cut -d' ' -f2)" = "virtiofs" ]; then mkdir -p "$STORAGE" # Create a sparse file for the fs truncate -s "$SIZE" "$IMG" mkfs.ext4 -qF -O dir_index,extent,has_journal "$IMG" LOOP=$(losetup -f --show "$IMG") mount -o noatime "$LOOP" "$STORAGE" mount --make-rshared "$STORAGE" || true fi } overlay_fs "/var/lib/containers/storage" "/var/tmp/containers.img" overlay_fs "/home/dev/.local/share/containers/storage" "/home/dev/.local/share/containers/img" su dev # if [[ -z "${PASEO_PASSWORD:-}" ]]; then # echo "PASEO_PASSWORD is required" >&2 # exit 1 # fi # echo "[devbox] starting Paseo daemon on ${PASEO_LISTEN} (web UI: ${PASEO_WEB_UI_ENABLED})" # exec paseo daemon run exec /bin/bash