Up­dat­ing FreeBSD 8.2 (or 9.x) to 10 (beta4)

This is a little de­scrip­tion how I re­motely (no con­sole, booted in­to multi-​user dur­ing up­date, no ex­tern­al ser­vices like jails/​httpd/​… run­ning) up­dated a FreeBSD 8.2 to 10 (beta4) from source. This should also work when up­dat­ing from FreeBSD 9.x. Note, I had already switched to ATA_​CAM on 8.2, so not in­struc­tions for the name change of the ata devices. No IPv6, WLAN or CARP is in use here, so changes which are needed in this area are not covered. Read UPDATING care­fully, there are a lot of changes between ma­jor re­leases.

What I did:

  • up­date /​usr/​src
  • make build­world
  • re­place “make ” in /usr/src/Makefile.inc1 with ${MAKE} (two times, one for “VERSION”, one for “BRANCH”)
  • veri­fy ker­nel con­fig for changes needed (run­ning “con­fig MyKer­nel” in /​usr/​src/​sys/​YourArch/​conf/​ helps to identi­fy syn­tax prob­lems), sorry I didn’t take notes, but I diffed the old and the new GENERIC con­fig and added/​removed ac­cord­ing to my in­terests
  • /usr/obj/…/src/usr.bin/bmake/make buildker­nel KERNCONF=MyKernel
  • /usr/obj/…/src/usr.bin/bmake/make in­stallker­nel KERNCONF=MyKernel KODIR=/boot/kernel.10
  • merge­mas­ter -p
  • /usr/obj/…/src/usr.bin/bmake/make in­stall­world DESTDIR=/somewhere/test
  • mk­dir /​root/​net10; cp /​somewhere/​test/​rescue/​ifconfig /​somewhere/​test/​rescue/​route /​root/​net10
  • cre­ate the file /etc/rc.10update with:
    case $(un­ame -r) in
    ex­port MYIFCONFIG
    ex­port MYROUTE
  • change the files (stu­pid ap­proach: grep for “if­con­fig” and “route” in /etc/rc.d to identi­fy files which need to change, I skipped files which I iden­ti­fied as not needed in my case, if you use pf/​IPv6/​bridge/​…, you may have to change some more files) /etc/rc.d/auto_linklocal /etc/rc.d/defaultroute /etc/rc.d/netif /etc/rc.d/netwait /etc/rc.d/routing: add “. /etc/rc.10update” at the end of the block with “. /etc/rc.subr”, change the “ifconfig”-command to ${MYIFCONFIG}, change the “route”-command to ${MYROUTE}
  • change /​etc/​net­work.subr: add “. /etc/rc.10update” be­fore the first func­tion, change the “ifconfig”-command to ${MYIFCONFIG}, change the “route”-command to ${MYROUTE}
  • make sure that the changes you made are 100% cor­rect, rather triple-​check than to not check at all (you will be locked out if they are not 100% OK)
  • stop any jails and make sure they do not re­start at boot
  • de­ac­tiv­ate the gmir­ror of the root-​fs, if there is one (it is maybe easi­er to ask a re­mote hand to swap the boot or­der in case of prob­lems)
  • here you could just a re­boot of the serv­er to come back to your cur­rent OS ver­sion, so make sure that the modi­fic­a­tions in /​etc did not cause any prob­lems with the old ver­sion (in case you see prob­lems with the v10 ker­nel), but if you do not have a re­mote con­sole to single-​user mode you have no chance to dir­ectly fix the prob­lem (risk mit­ig­a­tion de­scribed above), no mat­ter which ver­sion of the ker­nel you boot
  • next­boot -k kernel.10
  • shut­down -r now
  • lo­gin
  • check dmesg
  • op­tion­al: mv /​boot/​kernel /boot/kernel.8
  • make in­stallker­nel KERNCONF=MyKernel
    to have a v10 /​boot/​kernel
  • make in­stall­world
  • merge­mas­ter
  • make delete-​old
  • rm -r /etc/rc.10update /​root/​net10
  • change rc.conf: add “in­et” in ifconfig-​aliases
  • re­view sysctl.conf for out­dated entries
  • shut­down -r now
  • op­tion­al: rm -r /boot/kernel.10
  • en­able jails again (or later… up­dat­ing jails is not de­scribed here)
  • activate/​resync mirror(s)
  • re­build all ports (at­ten­tion: new pkg sys­tem)
  • make delete-​old-​libs
  • re­boot again to make sure everything is OK after the port-​rebuild and re­mov­al of old libs (a console.log (syslog.conf) helps here

Leave a Reply

Your email address will not be published. Required fields are marked *