Create a judge environment in a nutshell!
Nutshell is a part of Project Polya. This project means to provide a CLI helper for teachers/students to set up their own sandboxed environment, so that they can work together smoothly in later grading.
Why not check the help page first? ```text nutshell 0.1.0
USAGE:
nutshell
FLAGS: -h, --help Prints help information -V, --version Prints version information
SUBCOMMANDS: create-root create an arch chroot environment help Prints this message or the help of the given subcommand(s) init-overlay initialize an overlay file system make-squashfs create a squashfs ```
```text nutshell-create-root 0.1.0 create an arch chroot environment
USAGE:
nutshell create-root [FLAGS] [OPTIONS] --target-dir
FLAGS: -h, --help Prints help information -s, --shell enter the chroot environment after basic setups -V, --version Prints version information
OPTIONS:
-d, --download-backend
``
This command helps you to create an Arch Linux chroot environment. You can set your own download backend:
aria2c,
wget,
pacstrap` are all available.
This command will download the bootstrap tar of Arch and then extract it into the target directory. Using systemd-nspawn
,
it will populate GPG keys and run some basic updates. It will also prepare the base
and base-devel
environment.
You are highly recommeneded to set a download mirror at mainland, such as https://mirrors.tuna.tsinghua.edu.cn/archlinux/
.
As for the mirrorlist
, you may want some configurations like the following:
```text
Server = https://ftp.sjtu.edu.cn/archlinux/$repo/os/$arch Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch ```
```text nutshell-init-overlay 0.1.0 initialize an overlay file system
USAGE:
nutshell init-overlay [FLAGS] [OPTIONS] --base-dir
FLAGS: -h, --help Prints help information -p, --print-result print the result in json format -s, --shell enter the chroot environment after mount -V, --version Prints version information
OPTIONS:
-b, --base-dir
This command helps to mount a squashfs file with an overlay layer.
data-dirand
base-dir` are the temporary storage path needed for overlay layer.
```text nutshell-make-squashfs 0.1.0 create a squashfs
USAGE:
nutshell make-squashfs [FLAGS] --source
FLAGS: -f, --faster make the process faster by disabling high quality compression -h, --help Prints help information -V, --version Prints version information
OPTIONS:
-s, --source
This command is just a wrapper of
mksquashfs`. It will help to create a squashfs file that can be used
in the Project Polya.
By default, it uses -comp lz4 -Xhc
as the compression args.