View Full Version : FreeBSD 8 Src Upgrade
vivek
November 15th, 2009, 15:54
Backup the system before you do this. I've successfully upgraded my Gnome desktop from 7.2 to 8RC3. I'm also assuming that you are using portsnap and portmaster to manage apps. Here is how I did it:
Edit supfile and make sure tag set to RELENG 8 (this will get RC3):
*default release=cvs tag=RELENG_8_0
Note if you do not have supfile, enter:
# cp /usr/share/examples/cvsup/standard-supfile /root/supfile
# vi /root/supfile
And make sure it looks as follows
*default host=cvsup1.us.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_8_0
*default delete use-rel-suffix
Get the freebsd 8 source:
csup /root/supfile
Read last minute info:
vi /usr/src/UPDATING
You can disable unwanted options i.e. source build options via /etc/src.conf. Here is my sample /etc/src.conf (read man page src.conf(5) for more info):
WITHOUT_ATM=yes
WITHOUT_BLUETOOTH=yes
WITHOUT_CALENDAR=yes
WITHOUT_GAMES=yes
WITHOUT_I4B=yes
WITHOUT_IPFILTER=yes
WITHOUT_IPX=yes
WITHOUT_LPR=yes
WITHOUT_NETCAT=yes
WITHOUT_NIS=yes
WITHOUT_RCMDS=yes
WITHOUT_SENDMAIL=yes
WITHOUT_WPA_SUPPLICANT_EAPOL=yes
WITHOUT_ZFS=yes
WITHOUT_BLUETOOTH=yes
Type the following command to build base system:
cd /usr/src
make cleanworld && make cleandir
make buildworld
Build and install the kernel:
make buildkernel
make installkernel
Reboot the box:
reboot
Boot into a single user mode and mount it:
mount -a -t ufs
df
Install sys configuration files that are required by the new base system
mergemaster -p
Warning: Be careful with /etc/passwd, /etc/group and other modified file in based. Verify each file before installing the new version or merging something.
Instal the base system:
cd /usr/src
make installworld
Merge your configuration files
mergemaster -i
make delete-old
reboot
Warning: Be careful with /etc/passwd, /etc/group and other modified file in based. Verify each file before installing the new version or merging something.
Verify it:
uname -a
O/P
FreeBSD ninjutsu.my.lan 8.0-RC3 FreeBSD 8.0-RC3 #2: Sun Nov 15 22:34:26 IST 2009 root@ninjutsu.my.lan:/usr/obj/usr/src/sys/GENERIC amd64
Recompile all apps:
portsnap fetch update
pkg_version -l '<'
portmaster -Da
make delete-old-libs
References:
man pages portmaster, portsnap, make, csup, src.conf(5) etc, /usr/src/Makefile
http://www.freebsd.org/doc/en/books/handbook/makeworld.html
Let me know if you've any question. Enjoy! Peace & Love!!
aragon
November 15th, 2009, 20:49
No offense, but are posts like these really necessary? I see nothing unique in your howto compared to simply reading the handbook...
DutchDaemon
November 15th, 2009, 20:58
You miss some important steps, like 'make delete-old' and 'make delete-old-libs' (the second one should only be done after rebuilding all installed ports). Starting with 'make cleanworld' and 'make cleandir' is advisable as well.
See /usr/src/Makefile.
vivek
November 15th, 2009, 22:22
@DutchDaemon, thanks for the heads up and information.
@aragon, not everything is covered in handbook. The main point of forum is discussion. See DutchDaemon's comment. It was helpful and informative.
jb_fvwm2
November 15th, 2009, 23:02
One would want to upgrade more carefully if one has
a custom kernel; compare v7 GENERIC to v8 GENERIC,
see the Release_Notes_for_v8;
Despite that, some features I could not get to work
properly without loading additional ko's in loader.conf,
(in this case, geom_bsd.ko, geom_mbr.ko, geom_label.ko, to
"allow" dev entries to appear). Could have been something
I overlooked, a temporary glitch at that particular day
of _8 stable, ...
I think I made a simple post of the process in this or another
forum (and not a full howto).
SIFE
November 24th, 2009, 00:36
how can i force to rebuild packages even thye are updates ?
vivek
November 25th, 2009, 14:22
how can i force to rebuild packages even thye are updates ?
From the man page ( I never did this ):
Using portmaster to do a complete reinstallation of all your ports:
portmaster --list-origins > ~/installed-port-list
Update your ports tree
portmaster --clean-distfiles-all
portmaster --check-port-dbdir
portmaster -Faf
pkg_delete '*'
rm -rf /usr/local/lib/compat/pkg
Manually check /usr/local and /var/db/pkg to make sure that they are really empty:
portmaster `cat ~/installed-port-list`
See man page for details.
SeaHag
December 9th, 2009, 02:49
Where's the supfile found? It's been a long time since I set the system up and I don't remember where it is or what it was called?
DutchDaemon
December 9th, 2009, 05:59
/usr/share/examples/cvsup/
graudeejs
December 9th, 2009, 07:19
/usr/share/examples/cvsup/
man he's lazy to read.... I've told him everything he needs to know to update system....
https://forums.freebsd.org/showthread.php?t=9163
SeaHag
December 9th, 2009, 07:46
/usr/share/examples/cvsup/
Those are example ones. Where is the one my system is currently using?
SeaHag
December 9th, 2009, 07:47
man he's lazy to read.... I've told him everything he needs to know to update system....
https://forums.freebsd.org/showthread.php?t=9163
No, he just told me to read the handbook which is not clear or helpful.
DutchDaemon
December 9th, 2009, 08:14
c(v)sup is not configured to use any cvsupfile by default. You'll have to either create one or use one of the examples.
SeaHag
December 9th, 2009, 08:23
I'm confused. I thought I had to have one to set up the system in the first place, no? Doesn't it remain on the system somewhere?
DutchDaemon
December 9th, 2009, 08:26
csup plays no role in the initial setup of the machine. The initial setup is either done from CD/DVD or over the net (FTP/HTTP). Those are binary ("canned") sets, not source code.
SeaHag
December 9th, 2009, 09:46
Ok. Yes I install over the net. I remember making a supfile a while back when I set up a different system. I thought it was always used for net install to specify the mirror repository but I guess I was just confusing it with when I used to use cvsup for port install. I've been using portsnap for the last year or two and used to use cvsup. I thought it was used for net install too but I was mistaken.
So I guess I need to make a new one for this upgrade then it will remain on the system if I ever want to use csup again right?
sixtydoses
December 9th, 2009, 10:03
Yes, it'll remain on the system. For the source supfile you have to specify the branch tag that you want, in your case it's RELENG_8. For ports supfile the tag is always current.
DutchDaemon
December 9th, 2009, 21:15
But leave the ports part out of the csup process, since you're already running portsnap. Don't want two separate processes competing over the ports tree.
SeaHag
December 9th, 2009, 22:37
Yes, it'll remain on the system. For the source supfile you have to specify the branch tag that you want, in your case it's RELENG_8. For ports supfile the tag is always current.
So you're saying there are two supfiles, one for ports and one for source?
SeaHag
December 9th, 2009, 22:43
I followed the above steps and followed along in the handbook at the same time but when I got to the step;
make installkernel
It failed for / filesystem full. / is at 109%. My /dev/ad8s3a is 500MB. Is this normal? Is there something I can delete to make room?
df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ad8s3a 496M 495M -39M 109% /
devfs 1.0k 1.0k 0B 100% /dev
/dev/ad8s3e 496M 1.0M 455M 0% /tmp
/dev/ad8s3f 89G 29G 53G 35% /usr
/dev/ad8s3d 2.9G 776M 1.9G 29% /var
/dev/ad8s5 500G 224G 276G 45% /Data
fstab
Device Mountpoint FStype Options Dump Pass#
/dev/ad8s3b none swap sw 0 0
/dev/ad8s3a / ufs rw 1 1
/dev/ad8s3e /tmp ufs rw 2 2
/dev/ad8s3f /usr ufs rw 2 2
/dev/ad8s3d /var ufs rw 2 2
/dev/ad8s5 /Data ntfs rw 2 2
/dev/acd0 /cdrom cd9660 ro,noauto 0 0
sixtydoses
December 10th, 2009, 00:01
So you're saying there are two supfiles, one for ports and one for source?
Yes. But as DutchDaemon had mentioned earlier, leave the csup for ports since you're already using portsnap.
Wrt your / space being full, I remember having the same issue couple of years back, but that was completely my bad as I wrongly symlinked one of my data directory to a directory in / (I forgot I was root and I used the ~ instead of /home/user/). Might wanna check the content of your /.
SeaHag
December 10th, 2009, 00:55
How can I check /? When I go to / and run du -h it shows everything on the entire system.
phoenix
December 10th, 2009, 01:26
Read the man page: du
Note the -d option. :)
du -d 1
SeaHag
December 10th, 2009, 04:54
Read the man page: du
Note the -d option. :)
du -d 1
du -hd1 outputs;
2.0K ./.snap
2.5K ./dev
1.0M ./tmp
29G ./usr
776M ./var
1.7M ./etc
2.0K ./cdrom
1.1M ./bin
392M ./boot
7.4M ./lib
274K ./libexec
2.0K ./proc
4.0K ./mnt
2.0K ./proc
4.3M ./rescue
84M ./root
4.4M ./sbin
2.0K ./Data
30G .
How can I tell from this why / is full?
DutchDaemon
December 10th, 2009, 05:51
Try du -x -d 1 /, or for more detail du -x -d 2 /, etc. By using -x you stay inside the / filesystem.
SeaHag
December 10th, 2009, 06:25
Try du -x -d 1 /, or for more detail du -x -d 2 /, etc. By using -x you stay inside the / filesystem.
du -x -d 1 / shows the same list as above. Does that mean /boot is within /? /boot seems to have a lot in it.
du -x -d1 -h /boot/ shows;
24K /boot/defaults
2.0K /boot/firmware
199M /boot/kernel
2.0K /boot/modules
2.0K /boot/zfs
233M /boot/kernel.old
433M /boot/
I looks like /boot/kernel and /boot/kernel.old are taking up the space. Can/should I delete /boot/kernel.old?
DutchDaemon
December 10th, 2009, 06:27
The -h flag actually adds confusion. Leave it out, and ignore everything sized 0-2 (those are mostly mountpoints and/or empty directories). Anything bigger is inside /. And yes, /boot is inside /, or the system couldn't boot ..
SeaHag
December 10th, 2009, 07:04
Ok but what should I do to free up space? First I tried the bianry upgrade method but that didn't work so now I'm trying the source method. Is any of this left over maybe from the binary method that can be deleted?
DutchDaemon
December 10th, 2009, 07:52
Your /boot/ directory is exceptionally big. A regular /boot/kernel or /boot/kernel.old is about 35-40 MB big. If your current kernel is running well, you can delete /boot/kernel.old/. This might free up enough space for the current kernel to be copied. If /boot/kernel is full of files with 'symbol' in their names, those can be deleted as well (with due care, of course, don't delete the kernel itself or the modules (*.ko).
SeaHag
December 10th, 2009, 08:00
I freed up some space but when I run make installworld I now get this message;
===> share/info (install)
===> lib (install)
===> lib/csu/amd64 (install)
install -o root -g wheel -m 444 crt1.o crti.o crtn.o gcrt1.o /usr/lib
install:No such file or directory
*** Error code 1
Stop in /usr/src/lib/csu/amd64.
*** Error code 1
Stop in /usr/src/lib.
*** Error code 1
Stop in /usr/src.
*** Error code 1
Stop in /usr/src.
*** Error code 1
Stop in /usr/src.
*** Error code 1
Stop in /usr/src.
What file or directory can't it find? I've tried the binary upgrade method and by source but neither one worked. I'm unable to upgrade my system from 7.2 to 8.0
DutchDaemon
December 10th, 2009, 08:11
I think you'd better start over, using this (http://forums.freebsd.org/showpost.php?p=53974&postcount=5) as a template.
SeaHag
December 11th, 2009, 05:50
Ok that worked better. I got all the way thru upgrading ports but when I ran startx I got this;
/libexec/ld-elf.so.1: Shared object "libz.so.4" not found, required by "X".
I installed misc/compat7x then that took care of that. Now all I have to so is get my mouse working in X.
DutchDaemon
December 11th, 2009, 06:59
Sticky: http://forums.freebsd.org/showthread.php?t=4224
SeaHag
December 11th, 2009, 07:05
I got the mouse working in X by adding the following;
Section "ServerFlags"
Option "AutoAddDevices" "false"
EndSection
So now everything seems to work. I'm posting this from my new 8.0 box. Thanks for all the help everyone.
riot_dd
December 11th, 2009, 21:52
You have probaly build your kernel with debug messages and symbols which blows the kernel to the size you see, if you remove/comment out the line
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
in the GENERIC config file or in your own then your kernel shouldn't take
more than 40MB of space.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.