Procházet zdrojové kódy

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.
Rob Austein před 6 roky
rodič
revize
6f526cc456
6 změnil soubory, kde provedl 113 přidání a 4 odebrání
  1. 1 0
      .gitignore
  2. 14 1
      Makefile
  3. 25 3
      README.md
  4. 4 0
      stage2/Dockerfile
  5. binární
      stage2/finish.png
  6. 69 0
      stage2/installer

+ 1 - 0
.gitignore

@@ -1,2 +1,3 @@
 Xilinx_ISE_DS_Lin_14.7_1015_1.tar
 Xilinx.lic
+framebuf/Xvfb_screen0

+ 14 - 1
Makefile

@@ -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  .

+ 25 - 3
README.md

@@ -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.

+ 4 - 0
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

binární
stage2/finish.png


+ 69 - 0
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()