This commit is contained in:
Niklas Gollenstede
2025-10-31 22:37:36 +01:00
commit 174fe17e89
197 changed files with 79558 additions and 0 deletions

39
tools/remote.mk Normal file
View File

@@ -0,0 +1,39 @@
# Test your system on real hardware
NETBOOT_LOCAL="/ibr/adm/user-boot/"
NETBOOT_HOST="x1.ibr.cs.tu-bs.de"
NETBOOT_KERNEL="vmlinuz-$$user"
NETBOOT_INITRD="initrd-$$user.img"
# The boot menu shows pairs of `vmlinuz-*` + `initrd-*.img` with owning user and timestamp.
# We just need to choose a name that doesn't overlap with another user's.
netboot: all
$(VERBOSE) \
if [ ! "$$DEPLOY_LOCAL" ] && [ -e "${NETBOOT_LOCAL}" ] ; then DEPLOY_LOCAL=1 ; fi ; \
if [ "$$DEPLOY_LOCAL" = 1 ] ; then \
user=$$USER ; \
else \
user=$$( ssh -G ${NETBOOT_HOST} | grep -oPe '^user \K.*' ) ; \
fi ; \
\
mkdir -p $(BUILDDIR)/netboot ; \
ln -fT ${KERNEL} "$(BUILDDIR)/netboot/${NETBOOT_KERNEL}" ; \
initrd="$(INITRD)" ; if [ -s "$$initrd" ] ; then \
ln -fT $$initrd "$(BUILDDIR)/netboot/${NETBOOT_INITRD}" ; \
else \
echo "(none)" > "$(BUILDDIR)/netboot/${NETBOOT_INITRD}" ; \
fi ; \
\
if [ "$$DEPLOY_LOCAL" = 1 ] ; then \
echo "CP to locally as $$user" ; \
cp "$(BUILDDIR)/netboot/${NETBOOT_KERNEL}" "$(BUILDDIR)/netboot/${NETBOOT_INITRD}" ${NETBOOT_LOCAL} ; \
else \
echo "SCP to ${NETBOOT_HOST} as $$user" ; \
scp "$(BUILDDIR)/netboot/${NETBOOT_KERNEL}" "$(BUILDDIR)/netboot/${NETBOOT_INITRD}" ${NETBOOT_HOST}:${NETBOOT_LOCAL} ; \
fi
# Documentation
help::
@$(echo) "Netboot\n" \
" \e[3mnetboot\e[0m Copies $(PROJECT) to the network share, allowing the test infrastructure\n" \
" to boot your system"