Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: subtle enhancements #48

Merged
merged 3 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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