From fe11650e5ae25eaf07d25f76a98a80da317728ff Mon Sep 17 00:00:00 2001 From: Dominic Ayre Date: Thu, 24 Jul 2025 08:21:33 +0000 Subject: [PATCH] Makefile: Support usr-merged root filesystems Without this UVM built with this Makefile doesn't boot when using Azure Linux rootfs. This is a new version of https://github.com/microsoft/hcsshim/pull/2485 Signed-off-by: Dominic Ayre Co-authored-by: Tingmao Wang Signed-off-by: Tingmao Wang --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0c46422266..6507e29d10 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,14 @@ out/delta-snp.tar.gz: out/delta.tar.gz bin/internal/tools/snp-report boot/startu out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools bin/cmd/hooks/wait-paths Makefile @mkdir -p out rm -rf rootfs - mkdir -p rootfs/bin/ + rm -rf /tmp/base-rootfs && mkdir -p /tmp/base-rootfs + tar -xf $(BASE) -C /tmp/base-rootfs --no-anchored --no-recursion bin + if [ "$$(readlink -f /tmp/base-rootfs/bin)" = "/tmp/base-rootfs/usr/bin" ]; then \ + mkdir -p rootfs/usr/bin; \ + ln -s usr/bin rootfs/bin; \ + else \ + mkdir -p rootfs/bin; \ + fi mkdir -p rootfs/info/ cp bin/init rootfs/ cp bin/vsockexec rootfs/bin/