Quantcast
Channel: Alexander Leidinger » Open Source
Viewing all articles
Browse latest Browse all 10

Updating FreeBSD 8.2 (or 9.x) to 10 (beta4)

$
0
0

This is a little description how I remotely (no console, booted into multi-user during update, no external services like jails/httpd/… running) updated a FreeBSD 8.2 to 10 (beta4) from source. This should also work when updating from FreeBSD 9.x. Note, I had already switched to ATA_CAM on 8.2, so not instructions 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 carefully, there are a lot of changes between major releases.

What I did:

  • update /usr/src
  • make buildworld
  • replace “make ” in /usr/src/Makefile.inc1 with ${MAKE} (two times, one for “VERSION”, one for “BRANCH”)
  • verify kernel config for changes needed (running “config MyKernel” in /usr/src/sys/YourArch/conf/ helps to identify syntax problems), sorry I didn’t take notes, but I diffed the old and the new GENERIC config and added/removed according to my interests
  • /usr/obj/…/src/usr.bin/bmake/make buildkernel KERNCONF=MyKernel
  • /usr/obj/…/src/usr.bin/bmake/make installkernel KERNCONF=MyKernel KODIR=/boot/kernel.10
  • mergemaster –p
  • /usr/obj/…/src/usr.bin/bmake/make installworld DESTDIR=/somewhere/test
  • mkdir /root/net10; cp /somewhere/test/rescue/ifconfig /somewhere/test/rescue/route /root/net10
  • create the file /etc/rc.10update with:
    case $(uname –r) in
    8.2*)
            MYIFCONFIG=/sbin/ifconfig
            MYROUTE=/sbin/route
            ;;
    10*)
            MYIFCONFIG=/root/net10/ifconfig
            MYROUTE=/root/net10/route
            ;;
    esac
    export MYIFCONFIG
    export MYROUTE
  • change the files (stupid approach: grep for “ifconfig” and “route” in /etc/rc.d to identify files which need to change, I skipped files which I identified 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/network.subr: add “. /etc/rc.10update” before the first function, change the “ifconfig”-command to ${MYIFCONFIG}, change the “route”-command to ${MYROUTE}
  • make sure that the changes you made are 100% correct, 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 restart at boot
  • deactivate the gmirror of the root-fs, if there is one (it is maybe easier to ask a remote hand to swap the boot order in case of problems)
  • here you could just a reboot of the server to come back to your current OS version, so make sure that the modifications in /etc did not cause any problems with the old version (in case you see problems with the v10 kernel), but if you do not have a remote console to single-user mode you have no chance to directly fix the problem (risk mitigation described above), no matter which version of the kernel you boot
  • nextboot –k kernel.10
  • shutdown –r now
  • login
  • check dmesg
  • optional: mv /boot/kernel /boot/kernel.8
  • make installkernel KERNCONF=MyKernel
    to have a v10 /boot/kernel
  • make installworld
  • mergemaster
  • make delete-old
  • rm –r /etc/rc.10update /root/net10
  • change rc.conf: add “inet” in ifconfig-aliases
  • review sysctl.conf for outdated entries
  • shutdown –r now
  • optional: rm –r /boot/kernel.10
  • enable jails again (or later… updating jails is not described here)
  • activate/resync mirror(s)
  • rebuild all ports (attention: new pkg system)
  • make delete-old-libs
  • reboot again to make sure everything is OK after the port-rebuild and removal of old libs (a console.log (syslog.conf) helps here

Share


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images