Install CC/GCC

Mike Katz

Dabbler
Joined
May 26, 2017
Messages
20
How can I install CC on my TrueNAS/FreeBSD system?

If you can answer the question, please do.

Please do not make editorial comments on why I want to do this or that this is not a development platform or only an idiot would do this.
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,471
Yes, you can via hacking up the base image. You are probably better off building a jail via the UI, and then running "cc" inside of there. It'll let you customize / add packages to your hearts content, and wont run the risk of destroying the base OS image.
 

Mike Katz

Dabbler
Joined
May 26, 2017
Messages
20
Thank you for your reply.

I am unable to create a jail because the only drive on this system is the boot drive (1TB mirrored). Until I patch the driver and rebuild the kernel I cannot access the data drives.

What I want to do it recompile the kernel to update the driver for my SCSI controller without having to build a full FreeBSD virtual machine.

I don't care if I corrupt the system, it has no data on it other than the initial TrueNAS install.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
cc is not installed in the base OS. How do I install it?

You build a new FreeNAS/TrueNAS image that includes it. Because the C compiler normally comes as part of the base FreeBSD system, but is omitted in the FreeNAS/TrueNAS appliance build, there isn't anything that automatically installs it for you. Such abuse was never envisioned and no one wrote a tool to do it, because you're not supposed to do it.

Please do not make editorial comments on why I want to do this or that this is not a development platform or only an idiot would do this.

<moderator hat on>
Please ditch the attitude.
</moderator>

These are not "editorial comments." They are a statement of fact. All sorts of tools that might exist on a development platform are not present on the base appliance. This includes stuff such as all the critical bits in /usr/include, the system linker (ld), the compiler (clang), etc. We are not withholding some secret command like "pkg add system-includes clang ld" from you.

FreeNAS was originally a stripped NanoBSD but eventually became a stripped down FreeBSD version. Since the compiler takes up a lot of space, and since it would encourage user misbehaviour while serving no legitimate purpose, it has historically been omitted from the build.

What I want to do it recompile the kernel to update the driver for my SCSI controller without having to build a full FreeBSD virtual machine.

Unfortunately, if this is a rehash of your previous attempts to "rebuild the kernel" to "install a driver" for ancient parallel SCSI cards, I will note once again that the Dell PERC 4e controller is supported by the amr driver, which isn't included with FreeNAS/TrueNAS, but could possibly be bapped over from a generic FreeBSD install.

Now, you've already been given several different paths to solve your problem. Most recently, just a few days ago, I advised you that you could build a TrueNAS release containing whatever you liked.

This is at least the third iteration on this theme, and as a moderator, I am asking you to cease and desist posting variations on the same "how do I compile in the base OS" issue in different ways and different subforums. You are absolutely welcome to post questions resulting from efforts to follow any of the guidance people have offered you.
 
Top