Solved I need to transfer project from Linux to FreeBSD and have a problem with compilation

I want to make same focus with install linux_base-c7 on the OPNsense
Yes, I know that is different with FreeBSD, but let's try it.
OPNsense writes:
pkg: No packages available to install matching 'linux_base-c7' have been found in the repositories

What should I do to install it?
 
Did you run service abi onestart as you have been told?
no run.

now I runned "service abi onestart" on the FreeBSD.
output is:
Additional ABI support: linux.

df- screen
Guys, sorry for screen- I can't copy from VMware text.
 

Attachments

  • Screenshot_2.jpg
    Screenshot_2.jpg
    14.5 KB · Views: 125
We are curious to see the output of /usr/apps2/configlayer
To be precise: type that command ON THE FREEBSD HOST, please. Then press the ENTER key.
 
  • Thanks
Reactions: a6h
You didn't even add what I said to put in /etc/fstab and then mount them. That was listed before the df. Even the port said to do that and you ignored it.
That’s not his problem … Problem is that OPNsense doesn’t seem to have the Linuxulator package.
 
Crawl before running.

On CentOS, make small program:
Code:
#include <stdio.h>

int main() {
  printf("Привет мир\h");
  return 0;
}

Compile and then move result to FreeBSD.
Get this to work before moving to your custom application.
 
  • Thanks
Reactions: a6h
That’s not his problem … Problem is that OPNsense doesn’t seem to have the Linuxulator package.
The problem is - what you can easily derive from reading the whole thread from the start - ahem, different, to say it politely.
 
Now that you have them mounted, and you have Linux compat kernel module running, what do you get when you run the binary? Show the output.
give me 10 min. I want to check advise from
ljboiler
to make simple code and run it on the FreeBSD, compiled before on the CentOS
 
On CentOS, make small program:
I compiled on the CentOS your programm and transfer output file to FreeBSD-
all works!

Can I be sure that except specific libraryes for Linux, programs, compiled for Linux now works for FreeBSD?
Seems, yes.

Add these to /etc/fstab
Code:
linprocfs /compat/linux/proc linprocfs rw 0 0
linsysfs /compat/linux/sys linsysfs rw 0 0
tmpfs /compat/linux/dev/shm tmpfs rw,mode=1777 0 0
And run mount -a
Is this necessary changes to work files for Linux on the FreeBSD?
 

Attachments

  • Screenshot_5.jpg
    Screenshot_5.jpg
    7.6 KB · Views: 114
Now that you have them mounted, and you have Linux compat kernel module running, what do you get when you run the binary? Show the output.
If I test simple programm- above- all ok. If I run my specific programm- there is no specifical enviroment for test it.
Next step- test it on the OPNsense.

And I need to install linux_base-c7 to it.


We are curious to see the output of /usr/apps2/configlayer
To be precise: type that command ON THE FREEBSD HOST, please. Then press the ENTER key.
types: No device discovered.
This is string from project file. Therefore, this code works on the FreeBSD.

Now need to run it on the OPNsense.
 
then you can set this thread solved. On your 1st post, click "..."->edit thread->Prefix
And go to a OPNsense forum.
 
  • Thanks
Reactions: a6h
no run.

now I runned "service abi onestart" on the FreeBSD.
output is:
Additional ABI support: linux.

df- screen
Guys, sorry for screen- I can't copy from VMware text.
If you can't copy/paste then why not just secure shell into the virtual machine? If your host is say, Windows, then use something like putty otherwise just use ssh. Then you can copy/paste to your heart's content.
 
Honestly, there's a good chance we were so naive to help a 14-year old script kiddy to port his network sniffer or such onto a badly configured firewall router where he broke in with some recipe from darknet
  • the level of his english skills,
  • the secretiveness about his software,
  • numerous strange delays, e.g.
    Will return late to this question.
  • and above all, his non-existent skills in OS & SW development.
None of this alone -- except the last -- is a sufficient indication, but all together are.
 
A PoC remote windows kernel crash exploit targeting a very old release of some intel wifi driver (CVE from 2007) indeed has exactly these linux-specific includes...
 
Yes, but so does half the Linux kernel code dealing with the network stack, I would propose. It is ultimately a BSD network stack, so I would envisage it couldn't be too hard to convert from Linux to BSD; presuming there's not too much liberal usage of GCC linux-isms like there was in the Linux kernel (one of the reasons why it couldn't/can't compile with Clang).

(Disclaimer: I've not read the entire thread. Accusations are just that without evidence).
 
but so does half the Linux kernel code dealing with the network stack, I would propose.
Probably. But from what was written in the thread, this never was about kernel code (I was asking that at first). Of course, there might be valid reasons for userspace code to use these includes as well, but they're probably rare :)
 
The main reason why this seemed suspicious to me is the fact that he only gave evasive answers when asked for the actual purpose of the software (which obviously performs some unusual network-related things).
 
Well then I applaud his bravado; very little clue about kernel structure on the source kernel, trying to port to FreeBSD. Outstanding.🖖
 
Impudence wins. I guess he did all this remote on the machine where he broke in; this would explain the delays. One can only hope that system's kernel does neither include COMPAT_LINUX32 nor the kernel module and is booted from readonly media.
 
Back
Top