diff --git a/tools/labs/Makefile b/tools/labs/Makefile index 9779cfb09ec7ca..e965d86fada723 100644 --- a/tools/labs/Makefile +++ b/tools/labs/Makefile @@ -4,6 +4,8 @@ LABS ?= $(shell cd templates && find -mindepth 1 -maxdepth 1 -type d) MODS = $(shell cd templates && find $(LABS) -mindepth 1 -name Kbuild | xargs dirname) TODO ?= 0 +GUEST_IP_CMD ?= $(shell arp -n -i tap0 | tail -1 | cut -d ' ' -f 1) + include qemu/Makefile skels: @@ -31,6 +33,24 @@ copy: $(YOCTO_IMAGE) sudo umount $(TEMPDIR) rmdir $(TEMPDIR) +scp: ip + scp -r skels root@$(shell cat .ip): + +ssh: ip + ssh root@$(shell cat .ip) + +ip: + if [ ! -e qemu.mon ]; then exit 1; fi + GUEST_IP=$(GUEST_IP_CMD); \ + [ "$$GUEST_IP" = "arp:" ] && echo -n "Waiting for machine"; \ + while [ "$$GUEST_IP" = "arp:" ]; do \ + echo -n "."; \ + sleep 1; \ + GUEST_IP=`arp -e -n -i tap0 | tail -1 | cut -d ' ' -f 1`; \ + done; \ + echo ""; \ + echo -n $$GUEST_IP > .ip + docker-docs: cd docker && docker-compose build docs-build cd docker && UID=$(shell id -u) GID=$(shell id -g) docker-compose run docs-build bash -c "cd /linux/tools/labs && make docs" @@ -57,4 +77,4 @@ clean:: clean_skels: rm -rf skels -.PHONY: skels build copy docs docker-docs docker-kernel stop-docker-kernel clean clean_skels +.PHONY: skels build copy scp ssh ip docs docker-docs docker-kernel stop-docker-kernel clean clean_skels