diff --git a/tools-image/Dockerfile b/tools-image/Dockerfile index 2413f2b7d..f53dc114a 100644 --- a/tools-image/Dockerfile +++ b/tools-image/Dockerfile @@ -114,7 +114,11 @@ RUN set -eux; \ /tools-rootfs/agentenv/bin/busybox --list | grep -qx 'runsv' || \ { echo "BusyBox runsv applet missing; rebuild with CONFIG_RUNSV=y" >&2; exit 1; }; \ /tools-rootfs/agentenv/bin/busybox --list | grep -qx 'svlogd' || \ - { echo "BusyBox svlogd applet missing; rebuild with CONFIG_SVLOGD=y" >&2; exit 1; } + { echo "BusyBox svlogd applet missing; rebuild with CONFIG_SVLOGD=y" >&2; exit 1; }; \ + /tools-rootfs/agentenv/bin/busybox --list | grep -qx 'nice' || \ + { echo "BusyBox nice applet missing; rebuild with CONFIG_NICE=y" >&2; exit 1; }; \ + /tools-rootfs/agentenv/bin/busybox --list | grep -qx 'ionice' || \ + { echo "BusyBox ionice applet missing; rebuild with CONFIG_IONICE=y" >&2; exit 1; } # --------------------------------------------------------------------------- # Stage 3: materialize the rootfs as an ext4 disk image. diff --git a/tools-image/pivot-init b/tools-image/pivot-init index 8803b3713..ddad3ebc8 100644 --- a/tools-image/pivot-init +++ b/tools-image/pivot-init @@ -95,13 +95,17 @@ fi # Expose envd as a stable guest command. $BB ln -sf /agentenv/envd /usr/local/bin/envd -# envd 0.5.x starts guest processes through /usr/bin/nice. Minimal user images -# do not always ship coreutils, so provide a BusyBox-backed fallback without -# overriding an image that already has a real nice(1). +# envd wraps guest processes in `/usr/bin/ionice ... /usr/bin/nice ...`. Minimal +# user images (Alpine/musl, distroless, FROM scratch) do not always ship +# coreutils or util-linux, so provide BusyBox-backed fallbacks without +# overriding an image that already has real nice(1)/ionice(1). $BB mkdir -p /usr/bin if [ ! -x /usr/bin/nice ]; then $BB ln -sf /agentenv/bin/busybox /usr/bin/nice fi +if [ ! -x /usr/bin/ionice ]; then + $BB ln -sf /agentenv/bin/busybox /usr/bin/ionice +fi # Prepare remaining runtime directories envd and the guest init commonly # expect (/run is already mounted above as a tmpfs).