# Linux programs requiring /proc/cpu - a lost cause?



## caesius (May 15, 2012)

I'd really like to run Altera FPGA software on my FreeBSD machine. I've installed the program on Debian, and simply copied the entire folder over to FreeBSD. I'm aware that may be hoping for too much already, but the installer won't work with FreeBSD 

Anyway, after I copied it and tried to run one of the programs (quartus):

```
> ./quartus
grep: /proc/cpuinfo: No such file or directory
The Quartus II software is optimized for the Intel Pentium III processor
and newer processors.  The required extensions were not found on:
''

The Quartus II software will not function properly on this processor model.
Terminating...
exit: Illegal number: -1
[2] benjamin@blackbox>
```

Is this a lost cause? Even though the program is a shell script that calls a binary, the bit that checks for /proc/cpu must be in the binary itself, because there's no reference to it in the script.


----------



## SirDice (May 15, 2012)

Try enabling linprocfs(5).


----------



## Crivens (May 15, 2012)

Since FreeBSD does not rely on a /proc file system, why not also take a static snapshot from that debian machine and place it there?

Oh, and linprocfs could also work, thank you Sir for reminding


----------



## caesius (May 16, 2012)

> Try enabling linprocfs(5).


Yup, it is enabled already.



> Since FreeBSD does not rely on a /proc file system, why not also take a static snapshot from that debian machine and place it there?


Could you please elaborate on this?


----------



## acheron (May 16, 2012)

A gross hack would be to create a /proc/cpuinfo file and copy into it the content of /proc/cpuinfo you have on your linux machine.


----------



## ChalkBored (May 17, 2012)

You could also try symlinking /compat/linux/proc to /proc. But the real issue is it should be seeing /compat/linux/proc as /proc already, due to the linux emulation.


----------



## caesius (Jun 22, 2012)

ChalkBored said:
			
		

> You could also try symlinking /compat/linux/proc to /proc. But the real issue is it should be seeing /compat/linux/proc as /proc already, due to the linux emulation.



This works. Sort of.

I have to unmount the proc filesystem, then make the symlink. Obviously this is not a viable solution if I wish to port this software. Any hints given that unmounting proc and creating a symlink work?


----------



## wblock@ (Jun 22, 2012)

freebsd-ports is probably the best place to ask.


----------



## caesius (Jun 22, 2012)

wblock@ said:
			
		

> freebsd-ports is probably the best place to ask.



Thanks wblock, but I am not convinced. This seems more of a general Linux emulation problem rather than a porting problem to me. I guess what I was asking before was something along the lines of: how the heck to do I force a Linux binary to look at /compat/linux/proc/cpuinfo, rather than attempt to read the non-existent /proc/cpuinfo. The only option I see is a symlink, which can't be done if proc is mounted.


----------



## wblock@ (Jun 23, 2012)

It's likely a problem that has come up before with other ports.  There's also freebsd-emulation.


----------



## caesius (Jun 23, 2012)

Think I have found the problem. The binary is marked SYSV. Using brandelf(1) to mark it as Linux seemed to work.

Cheers.


----------

