Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +92 to +99

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--no-anchored means that bin also matches usr/bin. This was suggested by @helsaawy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the suggestion is valid (at least partially). we're not cleaning up /tmp/base-rootfs, so it will persist between runs and may incorrectly resolve to usr-merged for non usr-merged. so mktemp -d approach is reasonable here. feedback on readlink is secondary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are cleaning it up before running tar -xf

mkdir -p rootfs/info/
cp bin/init rootfs/
cp bin/vsockexec rootfs/bin/
Expand Down
Loading