diff options
author | Rob Austein <sra@hactrn.net> | 2019-02-11 06:22:01 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2019-02-11 06:22:01 +0000 |
commit | 6f526cc4567cb551feb4cae121f9a067d491f711 (patch) | |
tree | 33b9dcf972e138cc09760ce2a6b303c6b4f46af5 | |
parent | 71861b6ea54738950ac5c8e83e78bbd1215a11ed (diff) |
XiLinx installation sorta kinda mostly working.
Wow what a kludge.
Probably still some license manager antics, but I think that's
separate from installation, licensing is per user.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 15 | ||||
-rw-r--r-- | README.md | 28 | ||||
-rw-r--r-- | stage2/Dockerfile | 4 | ||||
-rw-r--r-- | stage2/finish.png | bin | 0 -> 640 bytes | |||
-rwxr-xr-x | stage2/installer | 69 |
6 files changed, 113 insertions, 4 deletions
@@ -1,2 +1,3 @@ Xilinx_ISE_DS_Lin_14.7_1015_1.tar Xilinx.lic +framebuf/Xvfb_screen0 @@ -1,4 +1,17 @@ -all: +all: debug + +build: build-stage1 build-stage2 # build-stage3 + +debug: build-stage2 + docker container prune -f + mkdir -p framebuf + docker run -it --mount type=bind,source=$(abspath framebuf),target=/framebuf xilinx:intalled + +build-stage1: cd stage1; docker build -t xilinx:loadonly . + +build-stage2: cd stage2; docker build -t xilinx:intalled . + +build-stage3: cd stage3; docker build -t cryptech-alpha . @@ -80,6 +80,28 @@ the XiLinx tools work properly without that. So: /opt/Xilinx/14.7/ISE_DS/common/bin/lin64/xlcm -manage ``` -In theory, we can run this GUI stuff under `Xvfb` in Docker. -Debugging this will probably require exporting the `Xvfb_screen0` file -via a volume mount. +Kludges too awful to mention +---------------------------- + +The file `finish.png` is for the `visgrep` tool from the `xautomation` +package. It sorta mostly kinda works as a mechanism for detecting +that we've gotten to the end of the XiLinx installation process. I +haven't gotten it to work quite as it says on the tin, but something like: + +``` +while true +do + xwdtopnm 2>/dev/null framebuf/Xvfb_screen0 | pnmtopng >framebuf/screen.png + if test -n "$(visgrep framebuf/screen.png finish.png finish.png)" + then + break + fi +done +``` + +For reasons that I don't understand, `visgrep` returns failure (exit +status 1) even when it finds the pattern, even though the manual says +it's not supposed to do that. Dunno why. Ancient code. Whatever. + +In practice, this is so nasty that I'm seriously tempted just to wait +half an hour then blindly click on where the finish button should be. diff --git a/stage2/Dockerfile b/stage2/Dockerfile index da030c8..3878080 100644 --- a/stage2/Dockerfile +++ b/stage2/Dockerfile @@ -10,9 +10,13 @@ RUN ln -sf /bin/bash /bin/sh # to need all of the following once we've debugged this. RUN apt-get update && apt-get install -y \ + libglib2.0-0 \ python-xvfbwrapper \ ratpoison \ x11-apps \ x11-utils \ x11-xserver-utils \ xautomation + +COPY installer /xilinx-unpack/ +CMD /xilinx-unpack/installer diff --git a/stage2/finish.png b/stage2/finish.png Binary files differnew file mode 100644 index 0000000..4129820 --- /dev/null +++ b/stage2/finish.png diff --git a/stage2/installer b/stage2/installer new file mode 100755 index 0000000..0853c9c --- /dev/null +++ b/stage2/installer @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +import subprocess, os, time, xvfbwrapper, itertools + +def run(*args, **kwargs): + return subprocess.Popen(args, **kwargs) + +def xte(*cmds): + subprocess.check_call(("xte",) + cmds) + +def xwininfo(): + print(subprocess.check_output(("xwininfo", "-root", "-tree"))) + +def ratpoison(*args): + cmd = ["ratpoison"] + cmd.extend(itertools.chain.from_iterable(("-c", a) for a in args)) + return subprocess.check_output(cmd) + +def main(): + with xvfbwrapper.Xvfb(fbdir = "/framebuf"): + print("DISPLAY={}".format(os.getenv("DISPLAY"))) + rat = run("ratpoison") + time.sleep(1) + + if False: + run("xsetroot", "-gray").wait() + run("xsetroot", "-cursor_name", "left_ptr", "-fg", "yellow", "-bg", "yellow").wait() + time.sleep(1) + xwininfo() + + xsetup = run("./xsetup", cwd = "/xilinx-unpack/Xilinx_ISE_DS_Lin_14.7_1015_1") + time.sleep(1) + xwininfo() + snooze = lambda: time.sleep(15) + + print("First screen") + snooze() + ratpoison("ratwarp 650 610", "ratclick") + + print("Second screen") + snooze() + ratpoison("ratwarp 250 420", "ratclick", + "ratwarp 250 444", "ratclick", + "ratwarp 650 610", "ratclick") + + print("Third screen") + snooze() + ratpoison("ratwarp 600 560", "ratclick", + "ratwarp 650 610", "ratclick") + + print("Fourth screen") + snooze() + ratpoison("ratwarp 300 100", "ratclick", + "ratwarp 650 610", "ratclick") + + for ith in ("Fifth", "Sixth", "Seventh"): + print(ith + " screen") + snooze() + ratpoison("ratclick") + + print("Waiting a few minutes, ^C if you get bored") + time.sleep(1800) + + # Need to do awful visgrep thing here to find the finish button. + # When we do find it: + #ratpoison("ratwarp 720 610", "ratclick", "quit") + +if __name__ == "__main__": + main() |