# Upgrade problem



## sk8harddiefast (Sep 4, 2013)

Dear forum. After a long time where I was on vacation, I am back on the forum. (The truth is that I missed you a lot!)

Here is my problem. I was on 9.2-RC3 and I wanted to see if 9.2-RELEASE is ready. Here is the mistake. Unfortunately I wrote `freebsd-update -r 9.1-RELEASE upgrade`. so I downgraded to 9.1-RELEASE-p6. When I understood my fault I tried to upgrade again to 9.2-RC3 but the system refuses.

```
/usr/sbin/freebsd-update: cannot open files/.gz: No such file or directory
```
I also tried to `make buildworld`

```
[ember@Unix /usr/home/ember]$ cd /usr/src/  
[ember@Unix /usr/src]$ sudo make buildworld
Password:

--------------------------------------------------------------
>>> Building an up-to-date make(1)
--------------------------------------------------------------
"/usr/share/mk/bsd.own.mk", line 661: Could not find bsd.compiler.mk
"/usr/share/mk/bsd.own.mk", line 670: Malformed conditional (${COMPILER_FEATURES:Mc++11})
"/usr/share/mk/bsd.own.mk", line 695: if-less endif
"/usr/share/mk/bsd.sys.mk", line 11: Could not find bsd.compiler.mk
"/usr/share/mk/bsd.sys.mk", line 49: Malformed conditional (!defined(NO_WCAST_ALIGN) && (${COMPILER_TYPE} != "clang"  || !defined(NO_WCAST_ALIGN.clang)))
"/usr/share/mk/bsd.sys.mk", line 66: Malformed conditional (${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD))
"/usr/share/mk/bsd.sys.mk", line 84: if-less endif
"/usr/share/mk/bsd.sys.mk", line 104: Malformed conditional (defined(NO_WFORMAT) || (${COMPILER_TYPE} == "clang" && defined(NO_WFORMAT.clang)))
"/usr/share/mk/bsd.sys.mk", line 106: if-less endif
"/usr/share/mk/bsd.sys.mk", line 107: if-less endif
"/usr/share/mk/bsd.sys.mk", line 113: Malformed conditional (${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD))
"/usr/share/mk/bsd.sys.mk", line 118: if-less endif
make: fatal errors encountered -- cannot continue
*** [make] Error code 1

Stop in /usr/src.
*** [upgrade_checks] Error code 1

Stop in /usr/src.
```

I am stuck and I cannot update to the newest version.


----------



## cpm@ (Sep 4, 2013)

Hi @sk8harddiefast,

According to the announcement of FreeBSD 9.2-RC3, the correct syntax to be used is as following:

```
# freebsd-update upgrade -r 9.2-RC3
```

Also, you can use the canonical way to update from source:

```
# mv /usr/src /usr/src.old 
# svn checkout https://svn0.us-west.freebsd.org/base/releng/9.2/ /usr/src
```

IMHO, it's preferible wait to the FreeBSD 9.2-RELEASE that it should be released around 14 September 2013. Read the release schedule for more details.


----------



## sk8harddiefast (Sep 4, 2013)

Î™ don't disagree but my system now is not working properly. Even the ps command is not working. I can't wait a half month with an almost crashed system*.*


----------



## jrm@ (Sep 5, 2013)

Did you also downgrade the kernel?  You can run into lots of problems if your kernel and userland don't match.


----------



## SirDice (Sep 5, 2013)

I'd try the source route, fetch a fresh copy of the source tree and try to build that. You may need to boot to single user mode to build it correctly though.


----------



## sk8harddiefast (Sep 5, 2013)

I am using SVN now. I've been fetching all sources for 1:30 hour now. After that how can I upgrade to 9.2-RC3 again? I used SVN only one time in the past (there was cvsup if I am not wrong) and I don't remember at all.


----------



## SirDice (Sep 5, 2013)

sk8harddiefast said:
			
		

> After that how can I upgrade to 9.2-RC3 again? I used svn only one time in the past (The was cvsup if I am not wrong) and I don't remember at all.


As long as you end up with a -RELEASE version with a GENERIC kernel, freebsd-update shouldn't have a problem with it.


----------



## sk8harddiefast (Sep 5, 2013)

Ok. I am waiting to finish downloading.


----------



## sk8harddiefast (Sep 5, 2013)

Î™t is still downloading! How big is the source tree?


----------



## fonz (Sep 5, 2013)

sk8harddiefast said:
			
		

> Î™t is still downloading! How big is the source tree?


I'm slightly rounding up here, but compressed (as found on install media) we're talking close to 100 MB, uncompressed it's approaching 800 MB.


----------



## sk8harddiefast (Sep 5, 2013)

It has been downloading since the morning and now it's 21:30 at night! It's on releng and has a long  way to go. Is this right?


----------



## wblock@ (Sep 5, 2013)

Along with Subversion overhead, /usr/src is currently about 1.8 GB.


----------



## fonz (Sep 5, 2013)

sk8harddiefast said:
			
		

> It has been downloading since the morning and now it's 21:30 at night! It's on releng and has a long  way to go. Is this right?


That depends, but probably not. How much has been downloaded so far (use e.g. du) and which server/mirror are you downloading from?


----------



## sk8harddiefast (Sep 5, 2013)

In fact it downloads all this http://svnweb.freebsd.org/base/ if I understood right. Is all this needed?


----------



## wblock@ (Sep 5, 2013)

sk8harddiefast said:
			
		

> In fact downloads all this http://svnweb.freebsd.org/base/ as I understood right. Is all this needed?



No.  That directory holds all the branches.  All the source for -CURRENT, -STABLE, -RELEASE, all versions.  Plus other stuff.

Stop the current download and check out just what you want, probably stable/9:

`rm -rf /usr/src`
`svn checkout [url=https://svn0.eu.FreeBSD.org/base/stable/9]https://svn0.eu.FreeBSD.org/base/stable/9[/url] /usr/src`


----------



## sk8harddiefast (Sep 5, 2013)

Ok. I am doing it now*.*


----------



## sk8harddiefast (Sep 5, 2013)

After that I `make buildworld`, `buildkernel` etc, and upgrade to 9.2-RC3?


----------



## wblock@ (Sep 5, 2013)

If you check out -STABLE, build and install, you'll already have 9.2-RC3.  If you want to use freebsd-update(8) afterwards, you'll have to check out a release instead of -STABLE.


----------



## sk8harddiefast (Sep 5, 2013)

Ok. Everything downloaded perfect. My /usr/src has only the /stable/9 But: `sudo make buildworld`


```
--------------------------------------------------------------
>>> Building an up-to-date make(1)
--------------------------------------------------------------
"/usr/share/mk/bsd.own.mk", line 661: Could not find bsd.compiler.mk
"/usr/share/mk/bsd.own.mk", line 670: Malformed conditional (${COMPILER_FEATURES:Mc++11})
"/usr/share/mk/bsd.own.mk", line 695: if-less endif
"/usr/share/mk/bsd.sys.mk", line 11: Could not find bsd.compiler.mk
"/usr/share/mk/bsd.sys.mk", line 49: Malformed conditional (!defined(NO_WCAST_ALIGN) && (${COMPILER_TYPE} != "clang"  || !defined(NO_WCAST_ALIGN.clang)))
"/usr/share/mk/bsd.sys.mk", line 66: Malformed conditional (${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD))
"/usr/share/mk/bsd.sys.mk", line 84: if-less endif
"/usr/share/mk/bsd.sys.mk", line 104: Malformed conditional (defined(NO_WFORMAT) || (${COMPILER_TYPE} == "clang" && defined(NO_WFORMAT.clang)))
"/usr/share/mk/bsd.sys.mk", line 106: if-less endif
"/usr/share/mk/bsd.sys.mk", line 107: if-less endif
"/usr/share/mk/bsd.sys.mk", line 113: Malformed conditional (${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD))
"/usr/share/mk/bsd.sys.mk", line 118: if-less endif
make: fatal errors encountered -- cannot continue
*** [make] Error code 1

Stop in /usr/src.
*** [upgrade_checks] Error code 1

Stop in /usr/src.
```

:q


----------



## wblock@ (Sep 5, 2013)

There should not be a stable/9 directory in /usr/src.

The compile problem is... I don't know.  Files missing, broken binary, something.  If it were me and no backup was available, I might boot from an install CD of the right version and copy binaries and files from the install CD onto the disk, but that really is brute-force and could make things worse if not done very carefully.


----------



## kpa (Sep 5, 2013)

Do you have some peculiar sudo setup? Try logging on as root with su(1) and try again.


----------



## DutchDaemon (Sep 5, 2013)

Don't overlook what @wblock@ said .. make sure /usr/src actually contains what it should contain (the root of the source tree). A quick check for the existence of files like COPYRIGHT, MAINTAINERS, and UPDATING should tell you that you have the right files there.


----------



## sk8harddiefast (Sep 5, 2013)

> The compile problem is... I don't know. Files missing, broken binary, something. If it were me and no backup was available, I might boot from an install CD of the right version and copy binaries and files from the install CD onto the disk, but that really is brute-force and could make things worse if not done very carefully.


Another plan because this sounds very dangerous?


> Do you have some peculiar sudo setup? Try logging on as root with su(1) and try again.


Same results.


----------



## sk8harddiefast (Sep 5, 2013)

I think yes. I can't paste everything because it's huge but the UPDATING file is telling at the end:

```
$FreeBSD: stable/9/UPDATING 254707 2013-08-23 14:24:46Z avg $
```
and my /usr/src include:

```
.svn		                       bin			libexec
COPYRIGHT		       cddl			release
LOCKS			       contrib		rescue
MAINTAINERS		       crypto		sbin
Makefile		               etc			secure
Makefile.inc1		       games		share
Makefile.mips		       gnu			sys
ObsoleteFiles.inc	include			        tools 
README			       kerberos5		usr.bin
UPDATING		               lib			usr.sbin
```

I don't overlook @wblock@ of course. I just was eating and I reply quickly*.*


----------



## sk8harddiefast (Sep 5, 2013)

A little progress. `make buildkernel` and `make installkernel` worked just fine. My `uname -a` now says:

```
FreeBSD Unix 9.2-PRERELEASE FreeBSD 9.2-PRERELEASE #1 r255261: Thu Sep  5 23:23:03 EEST 2013     ember@Unix:/usr/obj/usr/src/sys/GENERIC  amd64
```
But `make buildworld` still gives me the same error*.* I checked on /usr/share/mk and bsd.compiler.mk is missing*.*


----------



## sk8harddiefast (Sep 5, 2013)

Ok. I found the solution. For the moment that I am in 9.2-PRERELEASE and I have all the source tree in my /usr/src/, I just copied from /usr/src/share/mk/bsd.compiler.mk to /usr/share/mk*.* Now `make buildworld` runs*.*


----------



## wblock@ (Sep 5, 2013)

bsd.compiler.mk is in /usr/src/share/mk.  Copying that file alone may not be enough, it may need the new make(1).

Edit: simulpost.


----------



## sk8harddiefast (Sep 5, 2013)

For the moment everything seems to running smoothly. I am going to see If I will get errors. But I think that things are going better now  I don't say solved until I'm sure.


----------



## sk8harddiefast (Sep 6, 2013)

ÎŸk.`make buildworld`, `make buildkernel`, `make installkernel` all done. No errors, no problems. This part solved.


----------



## wblock@ (Sep 6, 2013)

Don't forget `make installworld`.


----------



## sk8harddiefast (Sep 6, 2013)

I get this:

```
===> share/info (install)
===> lib (install)
===> lib/csu/amd64 (install)
install -o root -g wheel -m 444  crt1.o crti.o crtn.o Scrt1.o gcrt1.o /usr/lib
/usr/bin/install: Undefined symbol "gid_from_group"
*** [realinstall] Error code 1

Stop in /usr/src/lib/csu/amd64.
*** [realinstall] Error code 1

Stop in /usr/src/lib.
*** [realinstall] Error code 1

Stop in /usr/src.
*** [install] Error code 1

Stop in /usr/src.
```

I already posted this problem here*.*


----------

