debug: bundle

This commit is contained in:
mustard 2025-10-20 17:09:44 +02:00
parent 1e3ecf5bc6
commit b5cd4af457

View file

@ -18,13 +18,20 @@ check-dom0 = $(error this target must be run in dom0)
check-domu = @true
endif
BUNDLEOUT := .bundles/dom0.bundle
BUNDLEIN := .bundles/domu.bundle
BUNDLEIN := .bundles/qubes-mgmt-salt
clean-workdir = git init -q -b $* && git diff --quiet && git diff --cached --quiet || (echo 'dirty tree; check git status' && false)
create-bundle = git show-ref --verify --quiet refs/remotes/$(1)/$* \
|| git bundle create $(BUNDLEOUT) $(1)/$*
.PHONY: guard-domu
guard-domu:
@ if [ "`hostname`" != "`qubesdb-read /name`" ]; then \
echo "This task must be run in a guest domain"; \
exit 1; \
fi
create-bundle: guard-domu
mkdir -p .bundles
git bundle create - --all > .bundles/qubes-mgmt-salt
.PHONY: pull pull/%
pull: pull/$(shell git branch --show-current)
@ -35,9 +42,9 @@ pull/%:
$(clean-workdir)
echo "creating bundle"
qvm-run -p $(GUEST) "cd $(GUEST_REPO) && $(call create-bundle,dom0)" </dev/null
qvm-run -p $(GUEST) "cd $(GUEST_REPO) && $(call create-bundle)" </dev/null
qvm-run -p $(GUEST) "cat $(GUEST_REPO)/$(BUNDLEIN)" </dev/null >$(BUNDLEIN)
qvm-run -p $(GUEST) "cat $(GUEST_REPO)/qubes-mgmt-salt" </dev/null >$(BUNDLEIN)
git remote add $(GUEST) $(BUNDLEIN) || true