Folding@Home for Corona Virus effort

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
890
Join the FreeBSD team!
Linux-Folding@Home Port is an easy install on FreeBSD, but if you get the error "FATAL: kernel too old" you will need to adjust a sysctl compat.linux.osrelease to value 2.6.32 which can be done by root for the present session, as sysctl compat.linux.osrelease=2.6.32 or permanently by editing your /etc/sysctl.conf to add that same line. Adding the line to your /boot/loader.conf will override whatever value it has as well.

Once all installed, you should see a message suggesting to edit the /usr/local/etc/fahclient/config.xml file if you'd like to contribute as a member of folding team FreeBSD, by adding line <team v='11743'/>

PS. Due to this being Linux software that has not been modified to function entirely as FreeBSD, the below adjustments to your /etc/fstab may be necessary.
Code:
proc            /proc                  procfs           rw      0       0
linproc         /compat/linux/proc     linprocfs        rw      0       0
linsysfs        /compat/linux/sys      linsysfs         rw      0       0


It may be necessary to load a few kernel objects onto the host system by kldload linprocfs and kldload linsysfs and kldload linux64

Those would also be added to your /etc/rc.conf file as kld_list="linprocfs linsysfs linux64" along with any others that may already be in the list. This would make it a permanent change rather than simply for the present session as above. kldstat will show what is loaded.

For jail installs, use iocage fstab -a [jailname] "[fstab entry]" with the three fstab entries above (ignoring extraneous whitespace, one space between variables should do). In an ordinary fstab tab characters can be used to make the columns pretty for future edits.

You can ignore any /proc/bus/pci/devices message since it calls that a warning and does not seem to affect running.

* Some versions of FreeNAS seem to reset the /etc/rc.conf file, needs clarification or workaround.

With further clarity this post will be modified to reflect more precise details, please report any missing details for any operation described above.
 
Last edited:

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
890
FYI:
Team stats can show 4 FreeBSD teams, with #11743 having the largest contribution of the bunch. The one unfortunately too normal (disheartening) statistic though is under OS, as we use the Linux client and not our own or perhaps even if we did, there is no listing for FreeBSD as an OS. Our success/effort is likely counted with Linux which diminishes them since we know this fact but boosts them for their fanboys.

Screenshot_2020-03-22 Folding home stats report.png
Screenshot_2020-03-22 Folding home stats report(1).png


We exist, so the only way to make ourselves known is to customize/fork such ports or develop our own, so that we are not under the Linux umbrella no matter where a majority of ports originate from.
 

majerus

Contributor
Joined
Dec 21, 2012
Messages
126
Can this be put into a plugin so its easier to consume?
 

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
890
My assumption was that people might have other boxes they could install it upon, though that doesn't stop it from being put in a jail or creating a plugin. I do not know precisely how either would be done, or if either method would work or would be as effective as outside on a more ordinary FreeBSD.
 

proto

Patron
Joined
Sep 28, 2015
Messages
269
I put that client on a bhyve-vm, CPU workload only.

/boot/loader.conf:
linux64_load="YES"

/etc/fstab:
Code:
# Device           Mountpoint           FStype      Options        Dump    Pass#
/dev/ada0p3        none                 swap        sw             0       0

proc               /proc                procfs      rw             0       0
linsys             /compat/linux/sys    linsysfs    rw             0       0
linproc            /compat/linux/proc   linprocfs   rw             0       0
 

S1RC

Dabbler
Joined
Jul 28, 2016
Messages
28
I'm new to running linux ports in an iocage jail, are there any step by step instructions on how to get this port working?

In the host system I had to load:
* kldload linprocfs
* kldload linsysfs
* kldload linux64

I'm not sure if that's the proper procedure.
 

asw2012

Contributor
Joined
Dec 17, 2012
Messages
182
since this is a similar subject, is there anything for rosetta@home ? Can't find much.
 

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
890
since this is a similar subject, is there anything for rosetta@home ? Can't find much.
I wonder if a similar effort to make it installable on FreeBSD might use some of the techniques from the folding@home port for success. I don't know any more than possibly coming across it in passing, with some relation to folding@home. If it has a Linux client or it can be shoehorned onto Linux in some way, it ought to be possible for FreeBSD.
 

Sphinxy

Cadet
Joined
Mar 25, 2020
Messages
2
I'm new to running linux ports in an iocage jail, are there any step by step instructions on how to get this port working?

In the host system I had to load:
* kldload linprocfs
* kldload linsysfs
* kldload linux64

I'm not sure if that's the proper procedure.
I also tried this while that did get rid of the errors saying those modules weren't working, it left me with this:
Code:
root@folder:~ # service fahclient start
Starting fahclient.
02:24:40:WARNING:Exception: Failed to open '/proc/bus/pci/devices': Failed to open '/proc/bus/pci/devices': No such file or directory: No such file or directory
02:24:40:ERROR:Exception: Could not read link /proc/self/exe
/usr/local/etc/rc.d/fahclient: WARNING: failed to start fahclient

I am thoroughly new to much of what's supposed to be going on here, so sorry in advance if this is something stupidly simple to fix. I just want to use my idle system to help in this time of need.
 

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
890
I also tried this while that did get rid of the errors saying those modules weren't working, it left me with this:
Code:
root@folder:~ # service fahclient start
Starting fahclient.
02:24:40:WARNING:Exception: Failed to open '/proc/bus/pci/devices': Failed to open '/proc/bus/pci/devices': No such file or directory: No such file or directory
02:24:40:ERROR:Exception: Could not read link /proc/self/exe
/usr/local/etc/rc.d/fahclient: WARNING: failed to start fahclient

I am thoroughly new to much of what's supposed to be going on here, so sorry in advance if this is something stupidly simple to fix. I just want to use my idle system to help in this time of need.

I have these set for my FreeBSD box.
Code:
linprocfs            /compat/linux/proc      linprocfs       rw        0       0
fdesc                /dev/fd                 fdescfs         rw        0       0
proc                 /proc                   procfs          rw        0       0
linproc              /compat/linux/proc      linprocfs       rw        0       0
linsysfs             /compat/linux/sys       linsysfs        rw        0       0


I do not believe that the /proc/bus/pci/devices is important, especially since it calls that a warning, the issue is with the error. I cannot say for certain which variation is the one that solves it but an dstab adjustment is likely necessary. I will add the above to the initial post of this thread.

I also note that the following kernel objects are set to load on my box:
Code:
5     1 0xffffffff8192e000     4950 linprocfs.ko
6     4 0xffffffff81933000     3148 linux_common.ko
7     1 0xffffffff81937000     1a80 fdescfs.ko
8     1 0xffffffff81939000     1ebe linsysfs.ko
<snip>
11    4 0xffffffff81c02000    13f30 linuxkpi_gplv2.ko
<snip>
26    1 0xffffffff81d71000    35490 linux64.ko
<snip>
30    1 0xffffffff81dde000    3d620 linux.ko


I will have to check my loader.conf or rc.conf to see if/what I specifically set to load.
 
Last edited:

Sphinxy

Cadet
Joined
Mar 25, 2020
Messages
2
I have these set for my FreeBSD box.
Code:
linprocfs            /compat/linux/proc      linprocfs       rw        0       0
fdesc                /dev/fd                 fdescfs         rw        0       0
proc                 /proc                   procfs          rw        0       0
linproc              /compat/linux/proc      linprocfs       rw        0       0
linsysfs             /compat/linux/sys       linsysfs        rw        0       0


I do not believe that the /proc/bus/pci/devices is important, especially since it calls that a warning, the issue is with the error. I cannot say for certain which variation is the one that solves it but an dstab adjustment is likely necessary. I will add the above to the initial post of this thread.

I also note that the following kernel objects are set to load on my box:
Code:
5     1 0xffffffff8192e000     4950 linprocfs.ko
6     4 0xffffffff81933000     3148 linux_common.ko
7     1 0xffffffff81937000     1a80 fdescfs.ko
8     1 0xffffffff81939000     1ebe linsysfs.ko
<snip>
11    4 0xffffffff81c02000    13f30 linuxkpi_gplv2.ko
<snip>
26    1 0xffffffff81d71000    35490 linux64.ko
<snip>
30    1 0xffffffff81dde000    3d620 linux.ko


I will have to check my loader.conf or rc.conf to see if/what I specifically set to load.
Thanks a bunch! All it took was adding proc, linproc, and linsysfs to my jail's fstab (not sure which one did it, I'm sure it wasn't proc since I tried that one before I added the other two and it didn't work...)!
For anyone who stumbles across this in the future, you'll just need to use iocage fstab -a [jailname] "[fstab entry]" with the last three entries from @Tigersharke's fstab as posted in the OP (ignoring extraneous whitespace, one space between variables should do).
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
166
I had this working in a jail in FreeNAS 11.3, but I upgraded to the TrueNAS 12 BETA and this no longer works. I recreated a jail and installed the official port as shown here, but I'm getting the following when I try to run service fahclient start. I do have the mount paths to the jail in those fstab entries (i.e. /path/to/jail/compat/linux/proc) and have jail_jailname_mount_enable="YES" in /etc/rc.conf.

Code:
kldload: can't load linux64: Operation not permitted
/usr/local/etc/rc.d/fahclient: WARNING: Unable to load kernel module linux64
/usr/local/etc/rc.d/fahclient: WARNING:failed precmd routine for fahclient
 
Last edited:

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
890
The kldload error refers to a kernel object of the name linux64 which the process has no permissions to start. You may need to adjust your rc.conf (for the jail I believe) to initiate the load of it. this can only be done with the requisite privs, and then when the jail is started it should have the linuxulator which it needs for FaH. I may be wrong about the precise kernel object, it may result in linux64 being loaded though.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
166
Well somehow my host /etc/rc.conf got overwritten to default. Ran kldload linux64 from the host and it appears to work now. From what I understand you can't load kernel modules in jails. Has to be in the host and then mounted in the jails. It looks like my host /etc/rc.conf gets overwritten on reboot, which might be the issue. Also my dedicated /etc/fstab.jailname gets deleted... this didn't happen on 11.3
 
Last edited:

underpickled

Contributor
Joined
Oct 1, 2013
Messages
166
So actually all I need to do is manually "kldload linux64" on the host and then start the fahclient in the jail, but it's unclear how to make that stick on reboot.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
166
Ok. So then you would modify the host /etc/rc.conf to include kld_list="linux64" or add linux64 into the quotes already present , seperated by a space.
I did that, but it went back to default on reboot
 

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
890
I did that, but it went back to default on reboot

Hmm. Perhaps somewhere with FreeNAS there is an area which would include such settings as these?
Alternatively, *maybe* create /etc/rc.conf.local to contain the line above. I believe that normally FreeBSD will look at both files, but perhaps FreeNAS will permit the new file to remain?

I hope someone who knows FreeNAS better can offer more precise advice. There may also be other threads or resources on these forums which relate to jails that could have needed info.
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
166
Hmm. Perhaps somewhere with FreeNAS there is an area which would include such settings as these?
Alternatively, *maybe* create /etc/rc.conf.local to contain the line above. I believe that normally FreeBSD will look at both files, but perhaps FreeNAS will permit the new file to remain?

I hope someone who knows FreeNAS better can offer more precise advice. There may also be other threads or resources on these forums which relate to jails that could have needed info.
Good suggestion, and it's corroborated here: https://www.freebsd.org/doc/handbook/configtuning-rcd.html
Unfortunately TrueNAS 12 BETA wipes that out too.
 
Top