Skip to content
Snippets Groups Projects
Commit 3e9e4f7d authored by Wilke Pierre's avatar Wilke Pierre
Browse files

debug and docker

parent 4062af7a
No related branches found
No related tags found
No related merge requests found
......@@ -21,4 +21,3 @@ myapi.key
xv6.out*
.vagrant/
submissions/
.vscode/
......@@ -184,6 +184,11 @@ qemu-gdb: $K/kernel .gdbinit fs.img
@echo "*** Now run 'gdb' in another window." 1>&2
$(QEMU) $(QEMUOPTS) -S $(QEMUGDB)
docker-qemu:
docker run --rm --user $(shell id -u):$(shell id -g) --name os-container -v $(shell pwd):/data -it pwilke/os-infosec ${MAKE} qemu ${MAKEFLAGS}
docker-qemu-gdb:
docker run --rm --user $(shell id -u):$(shell id -g) --name os-container -p 25000-26500:25000-26500 -v $(shell pwd):/data -it pwilke/os-infosec ${MAKE} qemu-gdb ${MAKEFLAGS}
##
## FOR submitting lab solutions
......@@ -198,75 +203,4 @@ endif
print-gdbport:
@echo $(GDBPORT)
grade:
@echo $(MAKE) clean
@$(MAKE) clean || \
(echo "'make clean' failed. HINT: Do you have another running instance of xv6?" && exit 1)
./grade-lab-$(LAB) $(GRADEFLAGS)
WEBSUB := https://6828.scripts.mit.edu/2019/handin.py
handin: tarball-pref myapi.key
@SUF=$(LAB); \
curl -f -F file=@lab-$$SUF-handin.tar.gz -F key=\<myapi.key $(WEBSUB)/upload \
> /dev/null || { \
echo ; \
echo Submit seems to have failed.; \
echo Please go to $(WEBSUB)/ and upload the tarball manually.; }
handin-check:
@if ! test -d .git; then \
echo No .git directory, is this a git repository?; \
false; \
fi
@if test "$$(git symbolic-ref HEAD)" != refs/heads/$(LAB); then \
git branch; \
read -p "You are not on the $(LAB) branch. Hand-in the current branch? [y/N] " r; \
test "$$r" = y; \
fi
@if ! git diff-files --quiet || ! git diff-index --quiet --cached HEAD; then \
git status -s; \
echo; \
echo "You have uncomitted changes. Please commit or stash them."; \
false; \
fi
@if test -n "`git status -s`"; then \
git status -s; \
read -p "Untracked files will not be handed in. Continue? [y/N] " r; \
test "$$r" = y; \
fi
UPSTREAM := $(shell git remote -v | grep -m 1 "mit-pdos/xv6-riscv-fall19" | awk '{split($$0,a," "); print a[1]}')
tarball: handin-check
git archive --format=tar HEAD | gzip > lab-$(LAB)-handin.tar.gz
tarball-pref: handin-check
@SUF=$(LAB); \
git archive --format=tar HEAD > lab-$$SUF-handin.tar; \
git diff $(UPSTREAM)/$(LAB) > /tmp/lab-$$SUF-diff.patch; \
tar -rf lab-$$SUF-handin.tar /tmp/lab-$$SUF-diff.patch; \
gzip -c lab-$$SUF-handin.tar > lab-$$SUF-handin.tar.gz; \
rm lab-$$SUF-handin.tar; \
rm /tmp/lab-$$SUF-diff.patch; \
myapi.key:
@echo Get an API key for yourself by visiting $(WEBSUB)/
@read -p "Please enter your API key: " k; \
if test `echo "$$k" |tr -d '\n' |wc -c` = 32 ; then \
TF=`mktemp -t tmp.XXXXXX`; \
if test "x$$TF" != "x" ; then \
echo "$$k" |tr -d '\n' > $$TF; \
mv -f $$TF $@; \
else \
echo mktemp failed; \
false; \
fi; \
else \
echo Bad API key: $$k; \
echo An API key should be 32 characters long.; \
false; \
fi;
.PHONY: handin tarball tarball-pref clean grade handin-check
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment