Linux 5.0.0-rc6+ fixed my lockup when using USB-C video

I had a really vexing problem with my XPS 13 9370. When I used it with an Apple USB-C to HDMI dongle or a Dell X5 dock (which has HDMI, Ethernet and some other devices), it would randomly lock-up. It wasn’t a hard lock-up (just video I think) as I could ssh to it over the network and do an orderly shutdown, though, I could not kill Xorg.

I headed over to GitHub and cloned the latest Linux 5 source, configured (with the help of /boot/config-4.15.0-1033-oem), built (takes about 15-20 minutes), and installed (you have to compress the initrd,img initially).

It’s fixed, with no side effects (for me)!

I am not a Dell fanboy. …and ordering this thing (w/ Ubuntu pre-installed) was unpleasant. …and I have no illusions of support (from India). …but it continues to be the best laptop I’ve ever owned.

In comparison to my spouse’s Mac Book, yes, it’s a little bulkier, but it’s got 3 USB-C (yes, they will all charge) ports, about the same battery life, and lacks Apple’s dodgy keyboard.

What, Lattice Diamond has Synopsys?

Uh… yes please.

Okay here’s how to get Synopsys working on Ubuntu. Lattice Diamond (and I suspect Synopsys too), officially, only runs on Red Hat. See my earlier post to work around that. Now most things seem to work for meperhaps I’m being generous; Diamond, like most (all?) IDEs is a POS. Whilst pulling my hair out screwing around with LSE I stumbled across a Lattice tutorial explaining how make sure your using LSEand becoming indoctrinated in Lattice’s worldbut, wait, that would imply one has a choice of Synthesis tools. Hmmm, what’s this reference to SynplifyPro? A quick search later and oh that’s Synopsys, an industry standard, the next best thing to an open source Logic Synthesizer! Oh hell yeah, I’ll be using this! …and then it failed.

synplify pro: 137: [: unexpected operator bash sh redhat ubuntu

…and a few more similar errors. The problem is that Diamond actually runs Synplify via scripts. When a script begins with !#/bin/sh RHEL, through the magic of soft links, actually uses bash whilst Ubuntu uses dash. That’s a problem and here’s the fix…

root@xps13:~# cd /usr/local/diamond/3.10_x64/synpbase

root@xps13:/usr/local/diamond/3.10_x64/synpbase# for file in grep -lRsI "/bin/sh" *; do sed -i -e 's/#!\/bin\/sh/#!\/bin\/bash/g' $file; done

This will find all the files that contain “#!/bin/sh” and change them to “#!/bin/bash” and voilà! Now I’m not stuck learning Lattices’ proprietary crapI’ll take Synopsys’s proprietary crap over lattices’ any day 🙂

Installing Lattice Diamond on Ubuntu 18.04

Use Alien to convert the rpm to a Debian package:

alien --scripts diamond_3_10-base_x64-111-2-x86_64-linux.rpm 
diamond-3-10-base-x64_3.10-112_amd64.deb generated

Use dpkg to install the resulting deb package:

root@xps13:~# dpkg -i diamond-3-10-base-x64_3.10-112_amd64.deb 
Selecting previously unselected package diamond-3-10-base-x64.
(Reading database … 232711 files and directories currently installed.)
Preparing to unpack diamond-3-10-base-x64_3.10-112_amd64.deb …
Checking configuration of machine xps13…
Installing Diamond 3.10 Base…
Unpacking diamond-3-10-base-x64 (3.10-112) …
Setting up diamond-3-10-base-x64 (3.10-112) …
Extracting compressed data files…

Use alien to convert the service pack(s) to Debian Packages, if you see things like “bad interpreter” then you may need to install things like csh, here is an example below:

alien --scripts diamond_3_10-sp3_x64-144-3-x86_64-linux.rpm
diamond-3-10-sp3-x64_3.10-145_amd64.deb generated

root@xps13:~# dpkg -i diamond-3-10-sp3-x64_3.10-145_amd64.deb
Selecting previously unselected package diamond-3-10-sp3-x64.
(Reading database … 239294 files and directories currently installed.)
Preparing to unpack diamond-3-10-sp3-x64_3.10-145_amd64.deb …
Installing Diamond 3.10 SP 3…
Unpacking diamond-3-10-sp3-x64 (3.10-145) …
Setting up diamond-3-10-sp3-x64 (3.10-145) …
/var/lib/dpkg/info/diamond-3-10-sp3-x64.postinst: /usr/local/diamond/3.10_x64/sp/cp_pack: /bin/csh: bad interpreter: No such file or directory
Processing triggers for libc-bin (2.27-3ubuntu1) …

fail. …so install csh and try again:

root@xps13:~# apt install csh
Reading package lists… Done
Building dependency tree 
Reading state information… Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 243 kB of archives.
After this operation, 358 kB of additional disk space will be used.
Get:1 bionic/universe amd64 csh amd64 20110502-3 [243 kB]
Fetched 243 kB in 1s (405 kB/s)
Selecting previously unselected package csh.
(Reading database … 248012 files and directories currently installed.)
Preparing to unpack …/csh_20110502-3_amd64.deb …
Unpacking csh (20110502-3) …
Processing triggers for man-db (2.8.3-2ubuntu0.1) …
Setting up csh (20110502-3) …
update-alternatives: using /bin/bsd-csh to provide /bin/csh (csh) in auto mode

root@xps13:~# dpkg -i diamond-3-10-sp3-x64_3.10-145_amd64.deb 
(Reading database … 248021 files and directories currently installed.)
Preparing to unpack diamond-3-10-sp3-x64_3.10-145_amd64.deb …
Uninstalling Diamond 3.10 SP 3…
Installing Diamond 3.10 SP 3…
Unpacking diamond-3-10-sp3-x64 (3.10-145) over (3.10-145) …
Setting up diamond-3-10-sp3-x64 (3.10-145) …
Processing triggers for libc-bin (2.27-3ubuntu1) …

That did it for me, look in /usr/local/diamond. Enjoy! Personally I hate IDEs so I tend to use vi for all but trivial editing sessions but it works.


The HiFive 1 development board, got this a few months back, forgot to post.

So far I have OpenOCD sorta working–yea GDB!, well okay gdb’s not actually working for me yet. Yes I could just use the freedom SDK but that’s too easy! …and no I have no idea what I’m going to do with it, SDR radio transmitter, I dunno.



local .vimrc