Skip to content

Commit

Permalink
Merge pull request #48 from ToolmanP/main
Browse files Browse the repository at this point in the history
fix: minor fix
  • Loading branch information
ToolmanP authored Oct 28, 2024
2 parents 6d49041 + a76967a commit 6b7f545
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Scripts/capturer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
from asyncio.subprocess import DEVNULL, PIPE, STDOUT
from dataclasses import dataclass

import psutil

if sys.version_info[0] != 3 or sys.version_info[1] < 6:
print(
"This script requires Python version 3.7 and later. Please upgrade your Python version to grade this lab."
)
sys.exit(0)

try:
import psutil
except ImportError:
print("This script requires PsUtil as main dependencies. Please install this module first.")
sys.exit(255)

@dataclass
class LineCapture:
Expand Down
2 changes: 1 addition & 1 deletion Scripts/extras/lab5.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ gdb:

grade:
$(MAKE) distclean
$(Q)$(GRADER)
$(Q)$(DOCKER_RUN) $(GRADER) -t $(TIMEOUT) -f $(LABDIR)/scores.json -s $(SERIAL) make SERIAL=$(SERIAL) qemu-grade

.PHONY: qemu qemu-gdb gdb defconfig build clean distclean grade all
2 changes: 1 addition & 1 deletion Scripts/kernel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ gdb:

grade:
$(MAKE) distclean
$(Q)$(GRADER) -t $(TIMEOUT) -f $(LABDIR)/scores.json -s $(SERIAL) make SERIAL=$(SERIAL) qemu-grade
$(Q)$(DOCKER_RUN) $(GRADER) -t $(TIMEOUT) -f $(LABDIR)/scores.json -s $(SERIAL) make SERIAL=$(SERIAL) qemu-grade

.PHONY: qemu qemu-gdb gdb defconfig build clean distclean grade all
16 changes: 16 additions & 0 deletions Scripts/lab.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ include $(SCRIPTS)/env_generated.mk

# Toolchain configuration
GDB ?= gdb
DOCKER ?= docker
DOCKER_IMAGE ?= ipads/oslab:24.09
ifeq (,$(wildcard /docker.env))
DOCKER_RUN ?=
else
DOCKER_RUN ?= $(DOCKER) run -it --rm \
-e SCRIPTS=$(SCRIPTS) \
-e LABROOT=$(LABROOT) \
-e LABDIR=$(LABDIR) \
-e TIMEOUT=$(TIMEOUT) \
-e LAB=$(LAB) \
-u $(shell id -u $(USER)):$(shell id -g $(USER)) \
-v $(LABROOT):$(LABROOT) -w $(CURDIR) \
--security-opt=seccomp:unconfined \
ipads/oslab:24.09
endif
QEMU-SYS ?= qemu-system-aarch64
QEMU-USER ?= qemu-aarch64

Expand Down
3 changes: 3 additions & 0 deletions Scripts/submit.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
include $(CURDIR)/filelist.mk

FILES := $(FILES) $(shell find -name "*.pdf" \
-o -name "*.doc" \
-o -name "*.docx")
submit:
$(Q)tar -czf lab$(LAB).tar.gz $(FILES) | :
$(Q)echo " Submit Lab$(LAB)"
Expand Down

0 comments on commit 6b7f545

Please sign in to comment.