File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ LABS ?= $(shell cd templates && find -mindepth 1 -maxdepth 1 -type d)
4
4
MODS = $(shell cd templates && find $(LABS ) -mindepth 1 -name Kbuild | xargs dirname)
5
5
TODO ?= 0
6
6
7
+ GUEST_IP_CMD ?= $(shell arp -n -i tap0 | tail -1 | cut -d ' ' -f 1)
8
+
7
9
include qemu/Makefile
8
10
9
11
skels :
@@ -31,6 +33,24 @@ copy: $(YOCTO_IMAGE)
31
33
sudo umount $(TEMPDIR )
32
34
rmdir $(TEMPDIR )
33
35
36
+ scp : ip
37
+ scp -r skels root@$(shell cat .ip) :
38
+
39
+ ssh : ip
40
+ ssh root@$(shell cat .ip)
41
+
42
+ ip :
43
+ if [ ! -e qemu.mon ]; then exit 1; fi
44
+ GUEST_IP=$(GUEST_IP_CMD ) ; \
45
+ [ " $$ GUEST_IP" = " arp:" ] && echo -n " Waiting for machine" ; \
46
+ while [ " $$ GUEST_IP" = " arp:" ]; do \
47
+ echo -n " ." ; \
48
+ sleep 1; \
49
+ GUEST_IP=` arp -e -n -i tap0 | tail -1 | cut -d ' ' -f 1` ; \
50
+ done ; \
51
+ echo " " ; \
52
+ echo -n $$ GUEST_IP > .ip
53
+
34
54
docker-docs :
35
55
cd docker && docker-compose build docs-build
36
56
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::
57
77
clean_skels :
58
78
rm -rf skels
59
79
60
- .PHONY : skels build copy docs docker-docs docker-kernel stop-docker-kernel clean clean_skels
80
+ .PHONY : skels build copy scp ssh ip docs docker-docs docker-kernel stop-docker-kernel clean clean_skels
You can’t perform that action at this time.
0 commit comments