There is a big difference between Ubuntu and CentOS (hint: it's mostly because of the glibc version differences, there are lots of differences but this one has the most impact).I want to compile my soft for Ubuntu (CentOS) for OPNsense (FreeBSD)
OPNsense based on freeBSD. You asked me about the project with more details. In present time it is doesn't matter about OPNsense.And OPNsense is not supported here. Sorry.
It does. We can tell you how to enable the Linux Compatibility on FreeBSD which may not work on OPNSense. OPNSense is a highly customized derivative, it may use FreeBSD as a base but it is configured and maintained completely differently.In present time it is doesn't matter about OPNsense.
ok, first, let's make enable the Linux Compatibility on FreeBSD. After that I'll try to make it on the OPNSenseIt does. We can tell you how to enable the Linux Compatibility on FreeBSD which may not work on OPNSense. OPNSense is a highly customized derivative, it may use FreeBSD as a base but it is configured and maintained completely differently.
In that case, there should be someone you can ask and who's better qualified to do the necessary porting...But this software from my work, for commercial project. Sorry, I can't due to NDA tell more about it.
And I don't know really more about this software.
Sorry, no.Did you read the handbook on how to enable the Linux compatibility?
seems, no require.Does your Linux executable require any additional libraries?
# pkg install emulators/linux_base-c7
linux_enable="YES"
That will enable the Linux compatibility, yes. I don't know if it will work for your executable though. I don't have access to your code and you haven't provided enough detail about it to make an educated guess. So you're going to have to try it yourself.And should works?
root@OPNsense:/etc # pkg -vv
Version : 1.12.0
PKG_DBDIR = "/var/db/pkg";
PKG_CACHEDIR = "/var/cache/pkg";
PORTSDIR = "/usr/ports";
INDEXDIR = "";
INDEXFILE = "INDEX-11";
HANDLE_RC_SCRIPTS = false;
DEFAULT_ALWAYS_YES = false;
ASSUME_ALWAYS_YES = false;
REPOS_DIR [
"/etc/pkg/",
"/usr/local/etc/pkg/repos/",
]
PLIST_KEYWORDS_DIR = "";
SYSLOG = true;
ABI = "FreeBSD:11:amd64";
ALTABI = "freebsd:11:x86:64";
DEVELOPER_MODE = false;
VULNXML_SITE = "http://vuxml.freebsd.org/freebsd/vuln.xml.bz2";
FETCH_RETRY = 3;
PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
PKG_ENABLE_PLUGINS = true;
PLUGINS [
]
DEBUG_SCRIPTS = false;
PLUGINS_CONF_DIR = "/usr/local/etc/pkg/";
PERMISSIVE = false;
REPO_AUTOUPDATE = true;
NAMESERVER = "";
HTTP_USER_AGENT = "pkg/1.12.0";
EVENT_PIPE = "";
FETCH_TIMEOUT = 30;
UNSET_TIMESTAMP = false;
SSH_RESTRICT_DIR = "";
PKG_ENV {
}
PKG_SSH_ARGS = "";
DEBUG_LEVEL = 0;
ALIAS {
all-depends = "query %dn-%dv";
annotations = "info -A";
build-depends = "info -qd";
cinfo = "info -Cx";
comment = "query -i \"%c\"";
csearch = "search -Cx";
desc = "query -i \"%e\"";
download = "fetch";
iinfo = "info -ix";
isearch = "search -ix";
prime-list = "query -e '%a = 0' '%n'";
prime-origins = "query -e '%a = 0' '%o'";
leaf = "query -e '%#r == 0' '%n-%v'";
list = "info -ql";
noauto = "query -e '%a == 0' '%n-%v'";
options = "query -i \"%n - %Ok: %Ov\"";
origin = "info -qo";
provided-depends = "info -qb";
rall-depends = "rquery %dn-%dv";
raw = "info -R";
rcomment = "rquery -i \"%c\"";
rdesc = "rquery -i \"%e\"";
required-depends = "info -qr";
roptions = "rquery -i \"%n - %Ok: %Ov\"";
shared-depends = "info -qB";
show = "info -f -k";
size = "info -sq";
}
CUDF_SOLVER = "";
SAT_SOLVER = "";
RUN_SCRIPTS = true;
CASE_SENSITIVE_MATCH = false;
LOCK_WAIT = 1;
LOCK_RETRIES = 5;
SQLITE_PROFILE = false;
WORKERS_COUNT = 0;
READ_LOCK = false;
PLIST_ACCEPT_DIRECTORIES = false;
IP_VERSION = 0;
AUTOMERGE = true;
VERSION_SOURCE = "";
CONSERVATIVE_UPGRADE = true;
PKG_CREATE_VERBOSE = false;
AUTOCLEAN = false;
DOT_FILE = "";
REPOSITORIES {
}
VALID_URL_SCHEME [
"pkg+http",
"pkg+https",
"https",
"http",
"file",
"ssh",
"ftp",
"ftps",
"pkg+ssh",
"pkg+ftp",
"pkg+ftps",
]
ALLOW_BASE_SHLIBS = false;
WARN_SIZE_LIMIT = 1048576;
METALOG = "";
OSVERSION = 1102000;
IGNORE_OSVERSION = false;
Repositories:
OPNsense: {
url : "pkg+https://pkg.opnsense.org/FreeBSD:11:amd64/20.1/latest",
enabled : yes,
priority : 11,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/local/etc/pkg/fingerprints/OPNsense"
}
root@OPNsense:/etc #
becouse for me not obvious this message. Why package not founded.why do we have to explain to you a message like: package not found?
I'll try to do it.You mentioned you have a FreeBSD machine, so why not install Linux compat on it, then try to run your Linux compiled binary on it and see if that works before you try building a cross-compiling toolchain?
Tested- same result- binary files, compiled on CentOS doesn't run on the freeBSD with code error-You mentioned you have a FreeBSD machine
yes, installed before on the freeBSDDid you install full emulators/linux-c7, as mentioned by @mjollnir
Sorry, not clear for me. What should I do with it?kldstat | grep linux
This obviously means he didn't ever try to read & follow the handbook or does not run a GENERIC kernel or didn't load the linux kernel module after he installed emulators/linux_base-c7. Forget it, my impression is this guy is cheating and still didn't get that OPNsense is not FreeBSD & he's doing all this on his OPNsense box. Of course you can install from FreeBSD package repository on an OPNsense host. Doesn't mean it will always work as aspected, though.Tested- same result- binary files, compiled on CentOS doesn't run on the freeBSD with code error-
Exex format error. Binary file not executable.
Never do this on a FreeBSD host where you want to run some Linux binary. This command will irreversely grep the Linux Compatability Layer. Forever. Do not type this into console. Never.Sorry, not clear for me. What should I do with it?