aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2019-02-14 07:12:12 +0000
committerRob Austein <sra@hactrn.net>2019-02-14 07:12:12 +0000
commit6f702a880c0c8300385945afead0a8e8d8236adc (patch)
tree591f5458ccb21c85cbb569e53c6970bfb6c8d910
parentd3a03cf27dab20ee49e2d245f6ca43c98c268cf8 (diff)
Debug.
-rw-r--r--.dockerignore5
-rw-r--r--.gitignore1
-rwxr-xr-xBuilder117
-rwxr-xr-xBuilder216
-rw-r--r--Dockerfile2
-rw-r--r--Makefile10
-rwxr-xr-xratinox16
-rwxr-xr-xstage135
-rwxr-xr-xstage211
9 files changed, 51 insertions, 62 deletions
diff --git a/.dockerignore b/.dockerignore
index 1be0fe1..79fc6cc 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,12 +1,11 @@
-framebuf/Xvfb_screen0
+Builder?
.git
.gitignore
*.log
Makefile
ratinox
README.md
-stage1
-stage2
*.stamp
Xilinx_ISE_DS_Lin_14.7_1015_1.tar
Xilinx.lic
+Xvfb_screen0*
diff --git a/.gitignore b/.gitignore
index c215d4e..6fb693d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ framebuf/Xvfb_screen0
*.stamp
Xilinx_ISE_DS_Lin_14.7_1015_1.tar
Xilinx.lic
+Xvfb_screen0*
diff --git a/Builder1 b/Builder1
new file mode 100755
index 0000000..5285458
--- /dev/null
+++ b/Builder1
@@ -0,0 +1,17 @@
+#!/bin/sh -
+
+set -ex
+
+sed -i '/mount -t proc /d; /mount -t sysfs /d' /debootstrap/functions
+/debootstrap/debootstrap --second-stage
+
+ln -sf /bin/bash /bin/sh
+
+apt-get update
+
+apt-get install -y \
+ libglib2.0-0 \
+ libxrandr2 \
+ python-xvfbwrapper \
+ ratpoison \
+ sudo
diff --git a/Builder2 b/Builder2
new file mode 100755
index 0000000..c464435
--- /dev/null
+++ b/Builder2
@@ -0,0 +1,16 @@
+#!/bin/sh -
+
+set -ex
+
+/cryptech-builder/ratinox ise-install
+
+rm -rf /Xilinx_ISE_DS_Lin_14.7_1015_1
+
+adduser --disabled-password --gecos 'Cryptech Build Bot' --shell /bin/sh builder
+echo >/etc/sudoers.d/builder 'builder ALL = (ALL) NOPASSWD: SETENV: ALL'
+
+install -o builder -g builder /cryptech-builder/Xilinx.lic /home/builder/Xilinx.lic
+
+sudo -u builder /cryptech-builder/ratinox license-user
+
+rm $HOME/builder/Xilinx.lic
diff --git a/Dockerfile b/Dockerfile
index 0a787bf..2771f40 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM cryptech-builder:stage2
+FROM cryptech-builder:stage1
RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list
diff --git a/Makefile b/Makefile
index 2ddd1e4..6e8b401 100644
--- a/Makefile
+++ b/Makefile
@@ -11,16 +11,18 @@ stage0.stamp:
stage1.stamp: stage0.stamp
docker run -it --name cryptech-builder-stage1 \
--mount type=bind,source=$(abspath .),target=/cryptech-builder \
- cryptech-builder:stage0 /cryptech-builder/stage1
- docker commit -c 'USER builder' cryptech-builder-stage1 cryptech-builder:stage2
+ cryptech-builder:stage0 \
+ /cryptech-builder/Builder1
+ docker commit cryptech-builder-stage1 cryptech-builder:stage1
docker container rm cryptech-builder-stage1
touch $@
stage2.stamp: stage1.stamp
docker run -it --name cryptech-builder-stage2 \
--mount type=bind,source=$(abspath .),target=/cryptech-builder \
- cryptech-builder:stage1 /cryptech-builder/stage2
- docker commit -c 'USER builder' cryptech-builder-stage2 cryptech-builder:stage2
+ cryptech-builder:stage1 \
+ /cryptech-builder/Builder2
+ docker commit cryptech-builder-stage2 cryptech-builder:stage2
docker container rm cryptech-builder-stage2
touch $@
diff --git a/ratinox b/ratinox
index 33243b4..6cdad09 100755
--- a/ratinox
+++ b/ratinox
@@ -12,30 +12,30 @@ class Ratinox(xvfbwrapper.Xvfb):
def __init__(self, **kwargs):
if kwargs.pop("screencap", True) and "fbdir" in kwargs:
- self.screencap_file = os.path.join(kwargs["fbdir"], xvfb_screen_name)
+ self.screencap_file = os.path.join(kwargs["fbdir"], self.xvfb_screen_name)
else:
self.screencap_file = None
- super(Ratinox, self).__init__(**kwargs)
+ xvfbwrapper.Xvfb.__init__(self, **kwargs)
def __enter__(self):
- result = super(Ratinox, self).__enter__()
+ result = xvfbwrapper.Xvfb.__enter__(self)
self.wm = subprocess.Popen(("ratpoison",))
time.sleep(0.5)
return result
def __exit__(self, exc_type, exc_val, exc_tb):
- self.rat("quit")
+ subprocess.check_call(("ratpoison", "-c", "quit"))
self.wm.wait()
self.wm = None
- super(Ratinox, self).__exit__(exc_type, exc_val, exc_tb)
+ xvfbwrapper.Xvfb.__exit__(self, exc_type, exc_val, exc_tb)
def click(self, *coordinates):
assert len(coordinates) in (0, 2)
if coordinates:
- subproccess.check_call(("ratpoison", "-c", "ratwarp {:d} {:d}".format(*coordinates)))
+ subprocess.check_call(("ratpoison", "-c", "ratwarp {:d} {:d}".format(*coordinates)))
if self.screencap_file:
shutil.copy(self.screencap_file, "{}.{}".format(self.screencap_file, time.time()))
- subproccess.check_call(("ratpoison", "-c", "ratclick"))
+ subprocess.check_call(("ratpoison", "-c", "ratclick"))
def snooze(how_long = 15):
time.sleep(how_long)
@@ -122,7 +122,7 @@ def main():
ap.add_argument("command", choices = tuple(sorted(dispatch)))
args = ap.parse_args()
- dispatch[args.command]
+ dispatch[args.command]()
if __name__ == "__main__":
main()
diff --git a/stage1 b/stage1
deleted file mode 100755
index a4cfa56..0000000
--- a/stage1
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh -
-
-set -ex
-
-# Finish debootstrap (stage0 did debootstrap --foreign)
-
-sed -i '/mount -t proc /d; /mount -t sysfs /d' /debootstrap/functions
-/debootstrap/debootstrap --second-stage
-
-# The XiLinx tools don't like dash but are OK with bash.
-
-ln -sf /bin/bash /bin/sh
-
-# Jump through hoops to install the XiLinx software in this container.
-
-apt-get update
-
-apt-get install -y \
- libglib2.0-0 \
- libxrandr2 \
- python-xvfbwrapper \
- ratpoison \
- sudo
-
-/cryptech-builder/ratinox ise-install
-
-# Assuming we survived that, we're done with the 6GB
-# XiLinxinstallation package.
-
-rm -rf /Xilinx_ISE_DS_Lin_14.7_1015_1
-
-# Create non-root user (with sudo privs, for pbuilder)
-
-adduser --disabled-password --gecos 'Cryptech Build Bot' --shell /bin/sh builder
-echo >/etc/sudoers.d/builder 'builder ALL = (ALL) NOPASSWD: SETENV: ALL'
diff --git a/stage2 b/stage2
deleted file mode 100755
index 01b67a8..0000000
--- a/stage2
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh -
-
-set -ex
-
-# We should now be running as a non-root user, set up the XiLinx license
-
-sudo install -o builder -g builder /cryptech-builder/Xilinx.lic $HOME/builder
-
-/cryptech-builder/ratinox license-user
-
-rm $HOME/builder