0

I formatted my old iMac 27'' with Ubuntu 18.04. I have my PC that is connected to it. Back in the day, on OSX I was able to put my PC on the iMac screen with Target Display Mode hitting Cmd+F2. Since I switched to Ubuntu I can't anymore. So I started reading about a solution:

Can be found here: https://stackoverflow.com/questions/43491594/reverse-engineering-the-target-display-mode-on-an-imac/

So, someone was able to find a way to do it on Ubuntu and he created a Git repo that is right here: https://github.com/floe/smc_util

I'm a complete newbie with Ubuntu but I have been reading on how to make this work. So, I download the zip file, unzip it in my Home folder. Inside it, there is three *.sh files and one *.c So, I tried to go straight to the sudo ./tdm_on.sh command I got the message: line 2: SmCDumpkey: command not found.

So I tried again but I start by running sudo /smc_dump_linux.sh and then sudo ./tdm_on.sh command

But still nothing. So, I think I'm missing a step, or doing something wrong here. Does anyone know how to make this tool work? I think I need to compile something, but I'm a beginner, I don't know the steps.

Thanks a lot

1 Answer 1

0

You would need to build the command(s) first - however with no documentation and no Makefile it's going to involve a bit of guess work.

There are 2 .c files - should those be linked into a single program, or are the two separate programs? The only way to find out may be to compile them and see:

gcc -Wall -o SmcDumpKey SmcDumpKey.c

This produces no errors and results in a binary executable SmcDumpKey so we can deduce that SmcDumpKey.c and smc_util.c are separate programs.

Because the current directory is likely not in your PATH, you will need to append it in order for the shell script(s) to find it ex.

$ PATH=$PATH:./ ./tdm_on.sh 
ioperm failed: Operation not permitted
ioperm failed: Operation not permitted
warning: output eDP not found; ignoring

so the SmcDumpKey program runs. You will likely want to move the compiled binary to somewhere on your PATH or on the sudo secure_path if you actually want to use it.

What about smc_util.c?

$ gcc -Wall -o smc_util smc_util.c
smc_util.c:27:10: fatal error: IOKit/IOKitLib.h: No such file or directory
 #include <IOKit/IOKitLib.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

At this point I'm stuck since I'm on an Intel-based system and IOKit is a Mac library. YMMV.

I hope this gets you started. Good luck!

1
  • Thanks a lot, I will try that tonight :-)
    – Hizzon3wb
    Mar 15, 2020 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .