0
0
0
s2sdefault

In my ongoing efforts to find new use for an IP260, I have made some interesting discoveries, and tried (and failed) to get coreboot on to the device. The failure point on coreboot was simply that there wasn't any thing compiled for IPSO 4.2. Here, I document my efforts to compile binaries on IPSO 4.2

Before we begin, I must profess that I know little (ie: nothing) about FreeBSD. I know it is another Unix variant, so while similar to Linux, it is a different beast altogether. So if I do wrong in anything below, please let me know in the comments, becasue I would surely love to get this going.

To start things off, I first need to determine what version of FreeBSD IPSO 4.2 is based off of. Taking my starting points from Wikipedia:

"IPSO SB was originally derived [...] from FreeBSD 2.1-STABLE and [...] FreeBSD 2.2.6-RELEASE and 3.5-RELEASE platforms."

"IPSO 6.0 was [...] based on FreeBSD 6.x."

Taking my cues from the (somewhat) obvious numbering scheme, my initial assumption is that IPSO 4.2is based on FreeBSD 4.2

So, I found and downloaded some old (ancient) FreeBSD ISOs, which was a feat in and of itself. Using VirtualBox, I created a VM and installed and booted FreeBSD 4.2.

Wow, is this ever different from Linux... Most of the general filesystem commands are the same, but the interface naming scheme is completely alien, and because it is SO old, all the new SSL/SSH encryption schemes are completely missing. I won't bore you with the troubles I had with FreeBSD, but suffice to say, it was a pain. Anyways, on to the good stuff...

I suppose the "bare minimums" to test the make command would be the binary itself (you don't say), and the gcc libraries. So let's grab those and stuff them into a tar file:

# tar -cf /FreeBSD_4.2.tar
# find / -name make -exec tar -f /FreeBSD_4.2.tar --append '{}' \;
# find / -name gcc -exec tar -f /FreeBSD_4.2.tar --append '{}' \;

Again, I won't go into the pain of how I got the file off the VM, but suffice to say it happened. Then I got the file to my IP260, and extracted it and ran make:

IP260[admin]# mount -uw /
IP260[admin]# tar -C / -xvf FreeBSD_4.2.tar
IP260[admin]# /usr/bin/make
Abort trap

Figures... It would have been WAY too easy if this worked. This means IPSO 4.2 is NOT FreeBSD 4.2. Since the Wikipedia article DOES mention some specific versions, let's work with those. IPSO 6 was based on FreeBSD 6, so we know it's below that, but since the earlier version of IPSO is based on FreeBSD 3.5, it is possible that this is what was upgraded.

Once again, more pain finding the ISO and getting the files off the device, but in the end:

IP260[admin]# tar -C / -xvf FreeBSD_3.5.tar
IP260[admin]# /usr/bin/make
Abort trap

Nope. Since IPSO 6 was based on FreeBSD 6, and IPSO 6 was the next version of IPSO, perhaps the earlier version of IPSO was based on a similarly earlier version of FreeBSD:

IP260[admin]# tar -C / -xvf FreeBSD_5.tar
IP260[admin]# /usr/bin/make
elf_coredump: seginfo.count = 6, seginfo.size = 389120, hdrsize = 4096, corefile_size = 393216
Jan  4 09:19:01 JonM-IP260 [LOG_CRIT] kernel: elf_coredump: seginfo.count = 6, seginfo.size = 389120, hdrsize = 4096, corefile_size = 393216
Bad system call (core dumped)

Different error message, but still no. So, let us work up from 3.5 to 5:

IP260[admin]# tar -C / -xvf FreeBSD_4.1.tar
IP260[admin]# /usr/bin/make
Abort trap

Nope.

IP260[admin]# tar -C / -xvf FreeBSD_4.5.tar
IP260[admin]# /usr/bin/make
make: no system rules (sys.mk).

SUCCESS (kinda)! Woo yeah! So it looks like IPSO 4.2 is based on FreeBSD 4.5. Since I know that the error message is due to just not having sources to use and compile, let us gather them from FreeBSD 4.5:

# tar -cvf 4.5src.tar /usr/src/share

Get them to the IP260, and try again:

IP260[admin]# mount -uw /
IP260[admin]# tar -C / -xvf 4.5src.tar
IP260[admin]# /usr/bin/make
make: no system rules (sys.mk).

Hmmm... I'm still missing something. Let's just grab more:

# tar -cf 4.5share.tar /usr/share /usr/src

And back to the IP260:

IP260[admin]# mount -uw /
IP260[admin]# tar -C / -xvf 4.5share.tar
IP260[admin]# /usr/bin/make
make: no system rules (sys.mk).

Still missing something!? Alright forget it, let's just grab the whole filesystem:

# tar -C / -cf 4.5FS.tar /

On the IPSO side of things, I need to make sure that when I extract the files, they don't overwrite the existing files and binaries (that would be bad), so what are the important flags, and what is the default?

TAR Flags

-k, --keep-old-files
    don't replace existing files when extracting
--overwrite
    overwrite existing files when extracting
    --overwrite is default.

Alright, so let us extract the filesystem into IPSO:

IP260[admin]# tar -C / -xf 4.5FS.tar / -k

And I run out of disk space.... I should have seen THAT coming. The IP260 I am using is Disk-Based, so that means the OS as whole resides upon the flash card, but the logging (and application packages like Checkpoint) reside upon the harddrive, which in this case is 20GB, more than enough to hold the FreeBSD 4.5 filesystem. From my previous discoveries, I know that partitioning setup is far from clear or obvious, so I cannot simply mount the harddrive to another location and use that. Maybe I need a bigger flash card? Prying the IP260 open, I see that the flash card in use is a mere 128MB. No wonder I ran out space, that is far FAR from enough. Not wanting to actually fork out any cash for the project, I have to work with what I've got, and I hunted down another old flash card, this one 1GB in size. Far from a monster, it just might be enough to work.

Using pv and dd (dd with progress bar), I copy the image off the old card, and on to the new (yes, this truly is all that is needed). Put the card into the IP260, and boot and COMPLETELY fresh install IPSO 4.2 (including the bootloader). Once booted and configured, let us try again:

IP260[admin]# mount -uw /
IP260[admin]# tar -C / -xf 4.5FS.tar / -k

And once again, ran out of disk space. Alright... If I can't remount the harddrive, maybe I can create some symbolic links to the harddrive for the bigger folders that are taking up large amounts of space. Once again, fresh install and basic config, and now let's make some folders and links:

IP260[admin]# mount -uw /

IP260[admin]# cd /var
IP260[admin]# mkdir usr
IP260[admin]# cd usr
IP260[admin]# mkdir ports
IP260[admin]# mkdir share
IP260[admin]# mkdir libdata
IP260[admin]# mkdir include

IP260[admin]# ln -s /var/usr/ports /usr/ports
IP260[admin]# ln -s /var/usr/share /usr/share
IP260[admin]# ln -s /var/usr/libdata /usr/libdata
IP260[admin]# ln -s /var/usr/include /usr/include

IP260[admin]# tar -C / -xf 4.5FS.tar / -

This was taking forEVER, and since there is no progress bar, nor anything to indicate progress or space available, I was getting antsy. VERY antsy. So I got another SSH session going, and ran the following command to watch the available space:

IP260[admin]# while (1)
? clear
? df
? sleep 1
? end

SUCCESS! It extracted completely, and without errors! Now we're cookin'! So now, to compile something... But what to compile? Going through the FreeBSD handbook, there are some explicit instructions for subversion, and if I can get subversion compiled, then (just about) EVERYTHING suddenly becomes available for IPSO 4.2. Let's try:

IP260[admin]# cd /usr/ports/devel/subversion
IP260[admin]# make install clean
sysctl: unknown oid 'kern.osreldate'
"/usr/ports/Mk/bsd.port.mk", line 615: warning: "/sbin/sysctl -n kern.osreldate" returned non-zero status
Syntax error: Bad substitution
*** Error code 2

Stop in /var/usr/ports/devel/subversion.
*** Error code 1

Stop in /var/usr/ports/devel/subversion.
*** Error code 1

Stop in /var/usr/ports/devel/subversion.
*** Error code 1

Stop in /var/usr/ports/devel/subversion.
*** Error code 1

Stop in /var/usr/ports/devel/subversion.
*** Error code 1

Stop in /var/usr/ports/devel/subversion.

Well, that's progress... Kinda. So let's take another look at the error:

"/usr/ports/Mk/bsd.port.mk", line 615: warning: "/sbin/sysctl -n kern.osreldate" returned non-zero status

Hmmm... If it returned a non-zero status, what DID it return? Let's run that command:

IP260[admin]# sysctl -n kern.osreldate
sysctl: unknown oid 'kern.osreldate'

Hmmmm... Sysctl is used to get/set kernel parameters, and it seems like 'kern.osreldate' just doesn't exist in IPSO. What SHOULD we be expecting as a returned value?

FreeBSD4.5# sysctl -n kern.osreldate
450000

Well, that's easy enough to fix, just set the value in IPSO 4.2 with sysctl -w:

IP260[admin]# sysctl -w kern.osreldate
sysctl: unknown oid 'kern.osreldate'

Once again, it just can't be that easy. Using my Google-fu, it turns out that the -w flag simply let's you re-write the value for existing kernel values, you cannot create one with this command. Fortunately, you CAN create the variable by editing the sysctl.conf file:

vi /image/IPSO-4.2-BUILD111-05.11.2010-205957-1515/etc/sysctl.conf

At the bottom of the file, add:

kern.osreldate = 450000

Reboot, and try again:

IP260[admin]# sysctl -w kern.osreldate
sysctl: unknown oid 'kern.osreldate'

Assuming that my sysctl.conf entry had bad formatting, I tried a variety of different syntaxes:

kern.osreldate = "450000"
kern.osreldate=450000
kern.osreldate="450000"

None worked. Nothing would allow me to add that kernel variable. Ok... So if I can't create the kernel variable, maybe I can hard-code the value into the file!

vi /usr/ports/Mk/bsd.port.mk

We know the error is on line 615:

# Get __FreeBSD_version
.if !defined(OSVERSION)
.if exists(/sbin/sysctl)
OSVERSION!=     /sbin/sysctl -n kern.osreldate
.else
OSVERSION!=     /usr/sbin/sysctl -n kern.osreldate
.endif                                                         
.endif

A couple of 'if' statements, either one setting OSVERSION to the output of the sysctl command. Let's replace it with this:

# Get __FreeBSD_version
.if !defined(OSVERSION)
#.if exists(/sbin/sysctl)
#OSVERSION!=    /sbin/sysctl -n kern.osreldate
#.else
#OSVERSION!=    /usr/sbin/sysctl -n kern.osreldate
OSVERSION!=     450000
#.endif
.endif

And let us compile:

IP260[admin]# make install clean
450000: not found
"/usr/ports/Mk/bsd.port.mk", line 618: warning: "450000" returned non-zero status
Syntax error: Bad substitution
*** Error code 2

"Bad substitution" eh? Let's try something else then, replace line 618 (the new we added after commenting out) with:

OSVERSION!=${echo "450000"}
IP260[admin]# make install clean
Syntax error: Bad substitution
*** Error code 2

Still not liking it... Let's try:

OSVERSION?=     450000
IP260[admin]# make install clean
Syntax error: Bad substitution
*** Error code 2

Still not liking my substitutions eh...? Maybe a little Google-fu is needed her, and sure enough, I came across this page. It is the same problem file, similar FreeBSD versions, and mentioning the OSVERSION. Problem is, that the error line is WAY different, and the author even explicitly says on the page: "The instructions in this entry no longer work, please check out the revised entry on this issue." The revised entry simply builds upon the same error and problem line. So while I may yet encounter this issue, it doesn't solve the one at hand. Well, on to further attempts for a good substitution:

OSVERSION=      450000
IP260[admin]# make install clean
Syntax error: Bad substitution
*** Error code 2

At this point, I am once again considering a variation of the echo command, and while looking through the rest of the bsd.port.mk file, I found the following:

# ECHO is defined in /usr/share/mk/sys.mk, which can either be "echo",
# or "true" if the make flag -s is given.  Use ECHO_CMD where you mean
# the echo command.
ECHO_CMD?=      echo                            # Shell builtin

Aha! My echo command was wrong. Let's try:

OSVERSION=      ${ECHO_CMD "450000"}

IP260[admin]# make install clean
Syntax error: Bad substitution
*** Error code 2

Nope, that wasn't it. What's next... I mean, how important can this 1 single variable be? What if we just don't set it?:

# Get __FreeBSD_version
.if !defined(OSVERSION)
#.if exists(/sbin/sysctl)
#OSVERSION!=    /sbin/sysctl -n kern.osreldate
#.else
#OSVERSION!=    /usr/sbin/sysctl -n kern.osreldate
#.endif
.endif
IP260[admin]# make install clean
"/usr/ports/Mk/bsd.port.mk", line 791: Malformed conditional (${OSVERSION} > 500025)
"/usr/ports/Mk/bsd.port.mk", line 791: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 797: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 797: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 971: Malformed conditional (${OSVERSION} >= 500007)
"/usr/ports/Mk/bsd.port.mk", line 971: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 988: Malformed conditional (exists(/usr/bin/perl5) && ${OSVERSION} >= 300000)
"/usr/ports/Mk/bsd.port.mk", line 988: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 997: if-less else
"/usr/ports/Mk/bsd.port.mk", line 997: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1004: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1004: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1070: Malformed conditional (${OSVERSION} < 500016)
"/usr/ports/Mk/bsd.port.mk", line 1070: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1073: if-less else
"/usr/ports/Mk/bsd.port.mk", line 1073: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1076: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1076: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1080: Malformed conditional (${OSVERSION} < 300000)
"/usr/ports/Mk/bsd.port.mk", line 1080: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1086: if-less else
"/usr/ports/Mk/bsd.port.mk", line 1086: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1088: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1088: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1196: Malformed conditional (${OSVERSION} >= 400000)
"/usr/ports/Mk/bsd.port.mk", line 1196: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1203: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1203: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1771: Malformed conditional (${OSVERSION} >= 300000)
"/usr/ports/Mk/bsd.port.mk", line 1771: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1789: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1789: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 3418: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 3418: Need an operator
make: fatal errors encountered -- cannot continue

SUPER important it would seem. What about:

OSVERSION!="450000"
IP260[admin]# make install clean
450000: not found
"/usr/ports/Mk/bsd.port.mk", line 618: warning: ""450000"" returned non-zero status
Syntax error: Bad substitution
*** Error code 2

Oh for the love of... Let's try:

OSVERSION!="450000"
IP260[admin]# make install clean
450000: not found
"/usr/ports/Mk/bsd.port.mk", line 618: warning: ""450000"" returned non-zero status
Syntax error: Bad substitution
*** Error code 2

AAAARRRRGGGGHHHH!!!! At this point, I'm losing my patience, my cool, and am running out of ideas... One last try here, what about:

OSVERSION?="450000"
IP260[admin]# make install clean
"/usr/ports/Mk/bsd.port.mk", line 792: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 792: Malformed conditional (${OSVERSION} > 500025)
"/usr/ports/Mk/bsd.port.mk", line 792: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 798: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 798: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 908: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 908: Malformed conditional (defined(USE_GCC295) && ${OSVERSION} < 400012)
"/usr/ports/Mk/bsd.port.mk", line 908: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 914: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 914: Malformed conditional (defined(USE_GCC30) && ${OSVERSION} < 500999)
"/usr/ports/Mk/bsd.port.mk", line 914: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 919: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 919: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 972: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 972: Malformed conditional (${OSVERSION} >= 500007)
"/usr/ports/Mk/bsd.port.mk", line 972: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 976: if-less else
"/usr/ports/Mk/bsd.port.mk", line 976: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 977: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 977: Malformed conditional (${OSVERSION} >= 300000)
"/usr/ports/Mk/bsd.port.mk", line 977: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 979: if-less else
"/usr/ports/Mk/bsd.port.mk", line 979: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 981: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 981: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 984: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 984: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 989: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 989: Malformed conditional (exists(/usr/bin/perl5) && ${OSVERSION} >= 300000)
"/usr/ports/Mk/bsd.port.mk", line 989: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 998: if-less else
"/usr/ports/Mk/bsd.port.mk", line 998: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1005: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1005: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1071: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 1071: Malformed conditional (${OSVERSION} < 500016)
"/usr/ports/Mk/bsd.port.mk", line 1071: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1074: if-less else
"/usr/ports/Mk/bsd.port.mk", line 1074: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1077: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1077: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1081: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 1081: Malformed conditional (${OSVERSION} < 300000)
"/usr/ports/Mk/bsd.port.mk", line 1081: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1087: if-less else
"/usr/ports/Mk/bsd.port.mk", line 1087: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1089: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1089: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1197: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 1197: Malformed conditional (${OSVERSION} >= 400000)
"/usr/ports/Mk/bsd.port.mk", line 1197: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1204: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1204: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1772: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 1772: Malformed conditional (${OSVERSION} >= 300000)
"/usr/ports/Mk/bsd.port.mk", line 1772: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 1790: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 1790: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 3419: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 3419: Need an operator
make: fatal errors encountered -- cannot continue

PROGRESS (kinda)! There is now a good substitution, but now I am getting the same kind of errors (though on different lines) that I had discovered earlier. While I am unsure if this is good news or bad news, it is a different set of errors, so we'll take it. Going back to the previous pages, the "revised" instructions say:

"It seems like the first commit to the ports infrastructure which broke compatibility happened around Feb 5th, 2007 - so let's backup the current /usr/ports/Mk and check out one from Feb 4th:
cd /usr/ports
mv Mk Mk.original
cvs -d This email address is being protected from spambots. You need JavaScript enabled to view it.:/home/ncvs co -D "04 Feb 2007" -d Mk ports/Mk"

Well, my little lab setup in which I am working on this does not have internet access (not ideal, I know, but it is imposed upon me rather than by choice), so I cannot use this. So back to the original set of instructions... In short, we are to replace the bsd.port.mk file with the following:

--- bsd.port.mk.backup    Tue Feb 20 09:30:54 2007
+++ bsd.port.mk    Tue Feb 20 15:43:11 2007
@@ -2289,37 +2289,11 @@
 PKGORIGIN?=        ${PKGCATEGORY}/${PORTDIRNAME}
 
-.if ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install") || exists(${LOCALBASE}/sbin/pkg_info)
-.if (${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install"
-EXTRACT_DEPENDS+=    ${LOCALBASE}/sbin/pkg_info:${PORTSDIR}/ports-mgmt/pkg_install
-.endif
-.if !defined(DESTDIR)
 PKG_CMD?=        ${LOCALBASE_REL}/sbin/pkg_create
 PKG_ADD?=        ${LOCALBASE_REL}/sbin/pkg_add
 PKG_DELETE?=    ${LOCALBASE_REL}/sbin/pkg_delete
 PKG_INFO?=        ${LOCALBASE_REL}/sbin/pkg_info
 PKG_VERSION?=        ${LOCALBASE_REL}/sbin/pkg_version
-.else
-PKG_CMD?=        ${LOCALBASE_REL}/sbin/pkg_create
-PKG_ADD?=        ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_add
-PKG_DELETE?=        ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_delete
-PKG_INFO?=        ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_info
-.endif
-.else
-.if !defined(DESTDIR)
-PKG_CMD?=        /usr/sbin/pkg_create
-PKG_ADD?=        /usr/sbin/pkg_add
-PKG_DELETE?=    /usr/sbin/pkg_delete
-PKG_INFO?=        /usr/sbin/pkg_info
-PKG_VERSION?=        /usr/sbin/pkg_version
-.else
-PKG_CMD?=        /usr/sbin/pkg_create
-PKG_ADD?=        ${CHROOT} ${DESTDIR} /usr/sbin/pkg_add
-PKG_DELETE?=        ${CHROOT} ${DESTDIR} /usr/sbin/pkg_delete
-PKG_INFO?=        ${CHROOT} ${DESTDIR} /usr/sbin/pkg_info
-PKG_VERSION?=        ${CHROOT} ${DESTDIR} /usr/sbin/pkg_version
-.endif
-.endif
 
# Does the pkg_create tool support conflict checking?
# XXX Slow?

Continuing the instructions :

"save it. Now build and install a newer version of make, "Berkeley make, back-ported to FreeBSD 4.x"

cd /usr/ports/devel/make
make install
make clean"

Ok let's do it!

IP260[admin]# cd /usr/ports/devel
IP260[admin]# cd make
make: No such file or directory.

Or not... Well, maybe compiling subversion will work now?

IP260[admin]# cd /usr/ports/devel/subversion
IP260[admin]# make install clean
"/usr/ports/Mk/bsd.port.mk", line 3: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 10: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 17: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 22: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 23: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 30: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 36: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 37: Need an operator
make: fatal errors encountered -- cannot continue

Taking a look at the lines mentioned, I conclude that the problem here is that these lines start with '-', so I removed them like so:

--- bsd.port.mk.backup    Tue Feb 20 09:30:54 2007
+++ bsd.port.mk    Tue Feb 20 15:43:11 2007
#@@ -2289,37 +2289,11 @@
PKGORIGIN?=        ${PKGCATEGORY}/${PORTDIRNAME}

.if ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install") || exists(${LOCALBASE}/sbin/pkg_info)
.if (${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install"
EXTRACT_DEPENDS+=    ${LOCALBASE}/sbin/pkg_info:${PORTSDIR}/ports-mgmt/pkg_install
.endif
.if !defined(DESTDIR)
PKG_CMD?=        ${LOCALBASE_REL}/sbin/pkg_create
PKG_ADD?=        ${LOCALBASE_REL}/sbin/pkg_add
PKG_DELETE?=    ${LOCALBASE_REL}/sbin/pkg_delete
PKG_INFO?=        ${LOCALBASE_REL}/sbin/pkg_info
PKG_VERSION?=        ${LOCALBASE_REL}/sbin/pkg_version
.else
PKG_CMD?=        ${LOCALBASE_REL}/sbin/pkg_create
PKG_ADD?=        ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_add
PKG_DELETE?=        ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_delete
PKG_INFO?=        ${CHROOT} ${DESTDIR} ${LOCALBASE_REL}/sbin/pkg_info
.endif
.else
.if !defined(DESTDIR)
PKG_CMD?=        /usr/sbin/pkg_create
PKG_ADD?=        /usr/sbin/pkg_add
PKG_DELETE?=    /usr/sbin/pkg_delete
PKG_INFO?=        /usr/sbin/pkg_info
PKG_VERSION?=        /usr/sbin/pkg_version
.else
PKG_CMD?=        /usr/sbin/pkg_create
PKG_ADD?=        ${CHROOT} ${DESTDIR} /usr/sbin/pkg_add
PKG_DELETE?=        ${CHROOT} ${DESTDIR} /usr/sbin/pkg_delete
PKG_INFO?=        ${CHROOT} ${DESTDIR} /usr/sbin/pkg_info
PKG_VERSION?=        ${CHROOT} ${DESTDIR} /usr/sbin/pkg_version
.endif
.endif

# Does the pkg_create tool support conflict checking?
# XXX Slow?

Let's try now:

IP260[admin]# make install clean
"/usr/ports/Mk/bsd.port.mk", line 7: Malformed conditional (((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OS)
"/usr/ports/Mk/bsd.port.mk", line 8: Malformed conditional ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSV)
"/usr/ports/Mk/bsd.port.mk", line 10: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 10: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 23: if-less else
"/usr/ports/Mk/bsd.port.mk", line 23: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 37: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 37: Need an operator
make: fatal errors encountered -- cannot continue

The 'if-less endif' errors make sense to me because these lines are 'endif', and the errors with the 'if' statements are also showing other errors... Some 'Malformed conditional', so it's just those lines I need to focus on. Malformed conditional... Well, the 'if' statement is also known more generically as a conditional statement... So there's something wrong with the logic or syntax. Let's work the syntax angle... Let's try:

.if {(${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install"} || exists(${LOCALBASE}/sbin/pkg_info)
.if {${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)} && ${PKGORIGIN} != "ports-mgmt/pkg_install"
IP260[admin]# make install clean
"/usr/ports/Mk/bsd.port.mk", line 7: Malformed conditional ({(${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OS)
"/usr/ports/Mk/bsd.port.mk", line 8: Malformed conditional ({${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSV)
Unterminated {} clause ""

Nope. I think I made it worse... What about:

.if ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install") || exists(${LOCALBASE}/sbin/pkg_info)
.if ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install")
IP260[admin]# make install clean
"/usr/ports/Mk/bsd.port.mk", line 7: Malformed conditional (((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OS)
"/usr/ports/Mk/bsd.port.mk", line 8: Malformed conditional (((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OS)

Nope. So maybe not the syntax... Maybe it's logic overall? Let's take a deep(er) look at the logic and see. Let's go with the second line, since it is smaller and perhaps a bit simpler:

.if ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install")

Let's break down the logic phonetically:

if ( (the OS version less than 504) OR (the os version is between 600 and 613) OR (the OS version is between 700 and 713) AND origin doesn't equal something )

I'll be honest, I'm not sure I understand the reasoning behind the logic, but the logic itself seems pretty solid. What next? Clearly, the error is a Malformed if statement, but I can't for the life of me identify the source of the error. For now, this ends here, in sad defeat.

Now what to do with this poor IP260? It's from Nokia, and I am sure the hardware will survive the apocalypse. But what about software and functionality? Thus far, my attempts to breathe new life into this little device have been focused on making it do something (anything) it was NOT originally designed to do; something outside the box. In order to do anything with this thing, I think I have start thinking INside the box, and work within what it WAS designed to do. But that is for another day, for now, I drown my defeat in sweet sweet Vodka, and try to wrap my head around thinking INside the box.

Comments  

# trbet 2021-09-07 14:26
Hello, I log on to your blogs on a regular basis. Your humoristic style is awesome, keep it up!
Reply | Reply with quote | Quote

Add comment


Security code
Refresh

0
0
0
s2sdefault