Malformed Conditional error

Status
Not open for further replies.

GalaxyWide

Cadet
Joined
Aug 22, 2012
Messages
8
I am trying to do "make install clean" in "/usr/src/sys/modules/linux" after getting most of the Ports Collection via cvsup, and I get the following:

Code:
"Makefile", line 3: Malformed conditional (${MACHINE_CPUARCH} == "amd64")       
"Makefile", line 6: if-less endif                                               
"Makefile", line 21: Malformed conditional (${MACHINE_CPUARCH} == "i386")       
"Makefile", line 23: if-less endif                                              
"Makefile", line 27: Malformed conditional (${MACHINE_CPUARCH} == "i386")       
"Makefile", line 29: if-less endif                                              
"/usr/src/sys/modules/linux/../../conf/kmod.mk", line 111: Malformed conditional
 (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang")                       
"/usr/src/sys/modules/linux/../../conf/kmod.mk", line 115: if-less endif        
"/usr/src/sys/modules/linux/../../conf/kern.mk", line 18: Malformed conditional 
(${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang")                        
"/usr/src/sys/modules/linux/../../conf/kern.mk", line 33: if-less endif         
"/usr/src/sys/modules/linux/../../conf/kern.mk", line 55: Malformed conditional 
(${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang")                        
"/usr/src/sys/modules/linux/../../conf/kern.mk", line 62: if-less endif         
make: fatal errors encountered -- cannot continue


I have no idea what could be causing this, it does not seem to be a common error.

My "make.conf" is currently thus:

Code:
CPUTYPE?=pentium3                                                               
                                                                                
CFLAGS= -O2 -pipe                                                               
COPTFLAGS= -O2 -pipe                                                            
                                                                                
OPTIMIZED_CFLAGS= YES                                                           
BUILD_OPTIMIZED= YES                                                            
WITH_CPUFLAGS= YES                                                              
WITHOUT_DEBUG= YES                                                              
WITH_OPTIMIZED_CFLAGS= YES                                                      
NO_PROFILE= YES                                                                 
BUILD_STATIC= YES 


Another weird thing, when I checked it the first time, thinking maybe there was something wrong with it, it was completely empty. Not sure if that is bad or not, or how well I did at guessing a "make.conf" file together.

Any and all help and/or comments would be greatly appreciated! I'm experienced with computers, but not so much Linux and certainly not FreeNAS, so this is rather uncharted water for me.

Thanks!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Post moved to proper area.


FreeNAS and FreeBSD are NOT Linux. What OS are you trying to build on? What is the purpose of your build?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
We need a forum rule to auto-close threads of people that think FreeNAS is linux. I've seen 2 or 3 just today. I'd think people would eventually get the hint :P
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
We need a forum rule to auto-close threads of people that think FreeNAS is linux. I've seen 2 or 3 just today. I'd think people would eventually get the hint :P

We need a forum rule just to get people to read the forum rules! ;)
 

GalaxyWide

Cadet
Joined
Aug 22, 2012
Messages
8
I fully realize that FreeBSD, and therefore FreeNAS, are not Linux. Rather, I believe they are a variant of UNIX. My comment about my unfamiliarity with FreeNAS was more in a context of it vs. windows, in which case it has far more in common with Linux then it does with windows.

I’m not sure what you mean by “what OS are you trying to build on”. This is a standard install of FreeNAS 8.2-release on a 4GB drive.

As for the purpose…..the end result is that I would like to get hamachi running on my FreeNAS server. This requires Linux binary compatability, which requires linux_base-f10 from the ports collection, which in order to install requires linux.ko be loaded into the kernel. Or so I’ve been reading around the Web.

Since FreeNAS does not include linux.ko, I have had to add “src-sys” from the ports collection (via cvsup), and now (following a post in another forum) I am attempting to install the prebuilt linux.ko and related into the appropriate locations, using the command
Code:
make install clean
in the directory "/usr/src/sys/modules/linux". When I run that command, I get the error mentioned in my OP.

I could very well be going about this totally backwards, but the above is what I have been able to piece together after hours of searching and research.

Thanks for the quick replies!
 

GalaxyWide

Cadet
Joined
Aug 22, 2012
Messages
8
Update: After doing some more digging, I found that I needed to get “src-share” from the ports collection, and run
Code:
make install clean
in “/usr/src/share/mk”.

That made the “Malformed Conditional” error go away, but I get this:

Code:
Install: linux.ko: no such file or directory


I thought that that’s what running
Code:
make
from “/usr/src/sys/modules/linux” did, installed my missing linux.ko? I’m at a loss as to how to get this file…any ideas?

Thanks!
 

GalaxyWide

Cadet
Joined
Aug 22, 2012
Messages
8
Proto: I was wondering if that’s what you meant…this is just straight FreeNAS, but I could understand the confusion.

I’ll see about the port for hamachi later, but wont that still need linux.ko in the kernel? Or is that actually built for BSD? I apologize for asking inane questions, I’m still not too familiar with this ecosystem.

Thanks! :)
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Proto: I was wondering if that’s what you meant…this is just straight FreeNAS, but I could understand the confusion.

No problem, its always helpful not to make too many assumptions. You might have better luck setting up a FreeBSD VM and using that to build. I'm not sure how you've configured FreeNAS to build, so that could be part of the problem.


I’ll see about the port for hamachi later, but wont that still need linux.ko in the kernel? Or is that actually built for BSD? I apologize for asking inane questions, I’m still not too familiar with this ecosystem.

Thanks! :)

The port probably does still need the .ko file, but building the port should also build any dependencies and may do something differently.

I don't know much about Hamachi, but FreeNAS has openvpn built in (command line only for now). I'm not sure if they're compatible.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I am trying to do "make install clean" in "/usr/src/sys/modules/linux" after getting most of the Ports Collection via cvsup....

I would also suggest you get ports using portsnap like this:

portsnap fetch
portsnap extract

move/rename or delete your current /usr/ports and make sure you're in /usr/ports and it's empty before running those commands. I think portsnap is the preferred method for downloading ports over csup.

Again, I'm not sure how you have FreeNAS setup to build, but all kinds of messy problems come to mind trying to do it that way. The cleanest and more reliable way is with a FreeBSD VM built using FreeBSD 8.2 if that's the version of FreeNAS you want it to run on. Also, after you do the install, do a "freebsd-update fetch" and "freebsd-update install".

I quickly cd'd to /usr/ports/security/hamachi and did a "make" (no install) and it seemed to build fine. If you do that and then look in the work/README file, there's more info about a needed tunnel device.

That's just from a very quick look/try. Hopefully that'll get you headed in the right direction.
 

GalaxyWide

Cadet
Joined
Aug 22, 2012
Messages
8
I am unable to use portsnap, because when I try i get:
Code:
portsnap: command not found

I have tried getting the security collection (sill via cvsup) and running "make" from "/usr/ports/security/hamachi", but I get errors about missing "ucl", "upx", "gmake" and "per15.14.2", as well as an error saying that libtool is 2.2.10 and I need to upgrade to >2.4.

At this point I do not have the full ports collection, but in the past when I have used "src-all", it has eventually thrown error 28 before getting the entire collection because the 1GB OS partition is full. I did try to build a custom image with "/usr/local/trunk/nanobsd/freenas-common" edited with
Code:
FlashDevice generic 4g
but I could not get that to build, it gave me an error about "i386" being an unexpected argument.



With as ridiculous as this is getting, I'm nearly ready to throw in the towel and accept that my FreeNAS will only be local. (tried ssh but I simply cannot get it to go through my router and gateway).

Thanks!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I think if you were using a properly configured FreeBSD VM you would have much better luck. Trying to do any development from FreeNAS is futile.

You shouldn't have any problems with ssh either. If I get a chance I'll see if I can build this later, but my plate is pretty full and it's not likely anytime soon.
 

GalaxyWide

Cadet
Joined
Aug 22, 2012
Messages
8
For the last day or so I’ve been doing all my testing and such in a VirtualBox FreeBSD VM, running FreeNAS 8.2-release. I also set up a straight FreeBSD VM (miminal install with the necessary added packages), which I used when trying to build FreeNAS.

As far as ssh, I have it working just fine in my local network, but I cannot get in from the outside world (a router/gateway config issue I’m sure).

Any ideas as to why portsnap does not work? From what I’ve read it should be included and working in FreeNAS 8.x, and it seems like a much more elegant solution then cvsp\csup.

Thanks for your help thus far, and I definitely understand that you are busy :)
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Oh, I don't think you mentioned using a FreeBSD VM, I thought you said FreeNAS.

Not sure why portsnap doesn't work. Have you done a "freebsd-update fetch" "freebsd-update install" and reboot?

portsnap is pretty smooth, all of the ports compressed are ~67MB, it's a lot faster than cvsup.

Something just doesn't sound right with your install. If you can get that working, building Hamachi shouldn't be this much trouble.
 

GalaxyWide

Cadet
Joined
Aug 22, 2012
Messages
8
Good news is I finally got portsnap to work by copying it over from my FreeBSD VM to the FreeNAS VM using an ftp client.

Bad news is that now I am unable to fetch the ports collection because I get a “/var” filesystem full full error during the extract. It would seem that freeNAS thought ~150mb was enough for /var, but to extract ports it looks like I’ll need at least 250+ mb.

So now I am trying to enlarge my existing /var partition, but I am having a hard time making heads or tails of the BSD filesystem. This is the output of “df –h” (run from the terminal of my ftp client to allow copying of output):

Code:
/usr/sbin$ df -h
Filesystem             Size    Used   Avail Capacity  Mounted on
/dev/ufs/FreeNASs1a    927M    336M    517M    39%    /
devfs                  1.0K    1.0K      0B   100%    /dev
/dev/md0               4.6M    1.8M    2.4M    43%    /etc
/dev/md1               824K    1.5K    757K     0%    /mnt
/dev/md2               149M    6.5M    131M     5%    /var
/dev/ufs/FreeNASs4      20M    453K     18M     2%    /data


I need to enlarge /var, but I am not sure how. If you could point me in the right dircection that would be very much appreciated

Thank you!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
ok, I give up. DON'T BUILD ON FREENAS! :mad: I thought that point was clarified last night when you said you were using FreeBSD.

good luck
 

GalaxyWide

Cadet
Joined
Aug 22, 2012
Messages
8
Long story short: I did give up, sort of. After going though trying to custom compile freeNAS, trying to find a gui for FreeBSD (there is one in the works I believe, not sure if its working or not), and attempting to add hamachi to the plugins jail system, I finally discovered that Openvpn is natively supported in freeNAS.

Took me a while, but after realizing that the /usr/local/etc directory gets blown away every reboot and replaced with /conf/base/local/etc, I now have openvpn fully working, including SSH, Windows shares and remote Webgui.

Thanks for all your help, its awesome that there’s such a good support community for this project!


Also, for anyone that needs help with this in future, these links where very helpful:

Certificate creation for server and clients

OpenVPN on FreeNAS 8.2
 
Status
Not open for further replies.
Top