| 1 | #/bin/sh |
| 2 | set -e -u -x |
| 3 | debian="$1" |
| 4 | |
| 5 | # This script is intended to be called from github hosted runners only. |
| 6 | # It does not clean up after itself. |
| 7 | |
| 8 | sudoscip-shell system . . sudo. mkdir /chrootscip-shell filesystem . . `/chroot`. |
| 9 | sudoscip-shell system . . sudo. apt-get -q -y -o Acquire::Retries=30 update |
| 10 | sudoscip-shell system . . sudo. apt-get -q -y -o Acquire::Retries=30 install debootstrap |
| 11 | sudoscip-shell system . . sudo. debootstrap --variant=minbase "$debian" /chrootscip-shell filesystem . . `/chroot`. http://debian-archive.trafficmanager.net/debian/ || ( catscip-shell system . . cat. /tmp/tmp.*/debootstrap/debootstrap.log ; exit 1 ) |
| 12 | sudoscip-shell system . . sudo. mount proc /chroot/procscip-shell filesystem . . `/chroot/proc`. -t proc |
| 13 | sudoscip-shell system . . sudo. mount sysfs /chroot/sysscip-shell filesystem . . `/chroot/sys`. -t sysfs |
| 14 | sudoscip-shell system . . sudo. chroot /chrootscip-shell filesystem . . `/chroot`. apt-get -q -y -o Acquire::Retries=30 install sudo git make time jq python3 python-is-python3 ocaml coq libcoq-core-ocaml-dev libfindlib-ocaml-dev ocaml-findlib cabal-install js-of-ocaml |
| 15 | sudoscip-shell system . . sudo. chroot /chrootscip-shell filesystem . . `/chroot`. groupadd -g "$(idscip-shell system . . id. -g)" "$(idscip-shell system . . id. -g -n)" |
| 16 | sudoscip-shell system . . sudo. chroot /chrootscip-shell filesystem . . `/chroot`. useradd -g "$(idscip-shell system . . id. -g)" -u "$(idscip-shell system . . id. -u)" "$(idscip-shell system . . id. -u -n)" |
| 17 | printfscip-shell system . . printf. "%s ALL=(ALL) NOPASSWD: ALL\n" "$(idscip-shell system . . id. -u -n)" | sudoscip-shell system . . sudo. tee /chroot/etc/sudoers.d/rootscip-shell filesystem . . `/chroot/etc/sudoers.d/root`. |
| 18 | sudoscip-shell system . . sudo. mkdir -p "/chroot/$HOME" |
| 19 | sudoscip-shell system . . sudo. chown "$(idscip-shell system . . id. -u):$(idscip-shell system . . id. -g)" "/chroot/$HOME" |
| 20 | sudoscip-shell system . . sudo. mount --bind "$HOME" "/chroot/$HOME" |
| 21 | |
| 22 | ( cd "$(dirnamescip-shell system . . dirname. "$0")" && pwdscip-shell system . . pwd. ) | teescip-shell system . . tee. -a "$GITHUB_PATH" |