|
|
Mount /src, which contains the FreeBSD sources, and start building the latest version of FreeBSD:
Upgrade to latest version of FreeBSD with# mkdir /src # mount dereel:/src /src # cd /usr # mv src src.local # just in case # ln -s /src/FreeBSD/svn/stable/8 src # cd src # make buildworld # make kernel # make installworld
Meanwhile, install Ports Collection. It's big enough that we can't have it on the root file system, so we use symlinks, smoke and mirrors:
# mkdir -p /home # ln -s /src/CVS/FreeBSD/ncvs /home # export CVSROOT=/home/ncvs # cd /home # cvs co ports # ln -s /src/FreeBSD/ports/distfiles /home/ports point to tarballs on dereel # mv /usr/ports /usr/ports.orig # or remove them # ln -s /home/ports /usr
When CVS goes away:
# cd /src/FreeBSD # find ports -name work -type d|xargs rm -rf # mv ports/distfiles . # tar cf - ports | (cd /usr && tar xvf -) # mv distfiles ports
Create a file /etc/make.conf with the contents:
# /home/Sysconfig/scripts/ciRCS check in RCS files (on old system)Then, on the new system:
# ln -s /src/Sysconfig/mysystem /home/Sysconfig
Once the new kernel is up and running, build ports:
# cd $DESTDIR/etc # rcsdiff -wu RCS/* 2>/dev/null | lessFix any conflicts.
Special cases:
Then check in the updated version of /etc/fstab: Afterwards you should see:
--- fstab 2005/07/08 15:31:01 1.22 +++ fstab 2005/07/11 03:17:28 @@ -1,7 +1,7 @@ # $Id: newsystem-newdisk.php,v 1.3 2011/02/08 01:05:06 grog Exp grog $ # Device Mountpoint FStype Options Dump Pass# /dev/ad0s2b none swap sw 0 0 -/dev/ad0s2a / ufs rw 1 1 +/dev/ad0s1a / ufs rw 1 1 /dev/ad0s3h /home ufs rw 1 2 echunga:/cdrom /cdrom nfs ro,noauto 0 0 proc /proc procfs rw 0 0 @@ -10,13 +10,13 @@ echunga:/ /echunga nfs rw 0 0 echunga:/home /echunga/home nfs rw 0 0 echunga:/src /src nfs rw 0 0 -linproc /compat/linux/proc linprocfs rw 0 0 +# linproc /compat/linux/proc linprocfs rw 0 0 /dev/ad2h /dumpa ufs rw 0 2 /dev/ad3s1h /dumpb ufs rw 0 2 echunga:/dump /dump nfs rw 0 0 # blackwater:/ /wantadilla nfs rw 0 0 # blackwater:/home /wantadilla/home nfs rw 0 0 # blackwater:/dumpa /dumpa nfs rw 0 0 -/dev/ad0s1a /destdir ufs rw 2 2 +/dev/ad0s2a /destdir ufs rw 2 2 teevee:/ /teevee nfs rw,noauto 0 0 teevee:/spool /teevee/spool nfs rw,noauto 0 0
Note the alternative of building the password file at boot time
After /etc, check out the remaining RCS files:
# /home/Sysconfig/scripts/installRCS -f create new RCS hierarchy # cd / # /home/Sysconfig/scripts/coRCS
If the root shell is in the Ports Collection, install it now, or make sure that there's a root user with Bourne shell in the password file. Normally toor will do that. To install the shell,
# /home/Sysconfig/scripts/installport /usr/ports/shells/bash2
Don't install any other ports at this stage: the ports database gets put in the wrong place.
# pwd_mkdb -p $DESTDIR/etc $DESTDIR/etc/master.passwd # newaliasesThis currently doesn't work: it claims cross-device links and crap. Do it after rebooting, but make sure that you will be able to log in.
Check out any files missing in /etc:
# rcsdiff -wu RCS/* 2>&1 >/dev/null | grep "No such file"
For each file, decide what to do. A brute force method is:
# rcsdiff -wu RCS/* 2>&1 >/dev/null | grep "No such file"|sed 's/rcsdiff:/co -M /; s/:.*//'|sh
For the last time, check in the current RCS-controlled files:
# /home/Sysconfig/scripts/ciRCS
# cd /home/Sysconfig/MasterRCS # . ../scripts/linkRCS # . ../scripts/coRCS
# . mkmounts
awk < installed-ports '{printf ("cd %s; %s %s %s %s %s %s %s %s\n", $7, $8, $9, $10, $11, \ $12, $13, $15, $15); }'|uniq > installports mailme sh installports
# rm -rf /usr/src # ln -s /src/FreeBSD/5-CURRENT-WANTADILLA /usr
# cd /etc # mv group group.orig # mv master.passwd master.passwd.orig # co group master.passwd shells # diff -wu group group.orig Merge differences, notably new groups # diff -wu master.passwd master.passwd.orig Merge differences, notably new users # pwd_mkdb -p /etc/master.passwd # (cd /usr/ports/shells/bash2; make install) # (cd /usr/ports/editors/emacs21; make install) # co ntpd.conf # cp -p /usr/share/zoneinfo/Australia/Adelaide localtime
R=/wantadilla remote system name cp $R/root/.bashrc $R/root/.bash_profile $R/root/.emacs ~root (cd $R; tar cf - usr/local/share/abbreviations usr/share/syscons/keymaps/au.emacs.kbd ) \ | tar xvf - cp -p /wantadilla/usr/local/share/emacs/site-lisp/* /usr/local/share/emacs/site-lisp
rm -rf /var/tmp/temproot/ find /var/tmp/temproot/|xargs chflags noschg rm -rf /var/tmp/temproot/ # cd /ETC # cp -p master.passwd group shells /etc # pwd_mkdb /etc/ # cd /usr # mv src src.local # ln -s /src/FreeBSD/5-CURRENT-ADELAIDE/src # mailme mergemaster -ia
pkg_info > /var/tmp/packagesEdit out the ones you don't want (including any you don't know: they're probably dependencies). Then:
sed <packages 's:-[0-9].*$: \\; Make install:; s:^:echo cd /usr/ports/*/:' | sh >~/packagesThis will give something like this:
cd /usr/ports/graphics/ImageMagick ; Make install cd /usr/ports/x11/XFree86 ; Make install cd /usr/ports/distfiles/acroread /usr/ports/print/acroread ; Make install cd /usr/ports/*/apache ; Make install cd /usr/ports/french/aspell /usr/ports/german/aspell /usr/ports/portuguese/aspell /usr/ports/russian/aspell /usr/ports/textproc/aspell /usr/ports/ukrainian/aspell ; Make install cd /usr/ports/audio/audacity ; Make install cd /usr/ports/*/bash ; Make install cd /usr/ports/sysutils/cdrtools ; Make install cd /usr/ports/misc/cpuid ; Make install cd /usr/ports/devel/cscope ; Make install cd /usr/ports/net/cvsup ; Make install cd /usr/ports/textproc/docbook ; Make install cd /usr/ports/textproc/docbook-xml ; Make install cd /usr/ports/textproc/docbook-xsl ; Make install cd /usr/ports/textproc/docproj ; Make install cd /usr/ports/textproc/dsssl-docbook-modular ; Make install cd /usr/ports/editors/emacs ; Make install cd /usr/ports/audio/esound ; Make install cd /usr/ports/net/ethereal ; Make install cd /usr/ports/distfiles/exim /usr/ports/mail/exim ; Make install cd /usr/ports/mail/fetchmail ; Make install cd /usr/ports/misc/figlet ; Make install cd /usr/ports/print/freetype2 ; Make install cd /usr/ports/www/galeon ; Make install cd /usr/ports/print/ghostscript-gnu ; Make install cd /usr/ports/print/ghostview ; Make install cd /usr/ports/*/gimp ; Make install cd /usr/ports/finance/gnucash ; Make install cd /usr/ports/security/gnupg ; Make install cd /usr/ports/audio/gramofile ; Make install cd /usr/ports/audio/grip ; Make install cd /usr/ports/print/gv ; Make install cd /usr/ports/french/ispell /usr/ports/german/ispell /usr/ports/hungarian/ispell /usr/ports/textproc/ispell ; Make install cd /usr/ports/textproc/jade ; Make install cd /usr/ports/*/kdebase ; Make install cd /usr/ports/audio/lame ; Make install cd /usr/ports/chinese/links /usr/ports/www/links ; Make install cd /usr/ports/multimedia/linux-realplayer ; Make install cd /usr/ports/emulators/linux_base ; Make install cd /usr/ports/*/mplayer-gtk ; Make install cd /usr/ports/chinese/mutt /usr/ports/distfiles/mutt /usr/ports/japanese/mutt /usr/ports/mail/mutt ; Make install cd /usr/ports/distfiles/openoffice /usr/ports/editors/openoffice /usr/ports/french/openoffice /usr/ports/german/openoffice /usr/ports/japanese/openoffice /usr/ports/korean/openoffice /usr/ports/portuguese/openoffice /usr/ports/russian/openoffice ; Make install cd /usr/ports/*/perl ; Make install cd /usr/ports/sysutils/portupgrade ; Make install cd /usr/ports/distfiles/postfix /usr/ports/mail/postfix ; Make install cd /usr/ports/distfiles/postgresql /usr/ports/japanese/postgresql ; Make install cd /usr/ports/mail/procmail ; Make install cd /usr/ports/net/rsync ; Make install cd /usr/ports/japanese/samba /usr/ports/net/samba ; Make install cd /usr/ports/audio/sweep ; Make install cd /usr/ports/mail/sylpheed ; Make install cd /usr/ports/www/tidy cd /usr/ports/converters/unix2dos ; Make install cd /usr/ports/archivers/unzip /usr/ports/korean/unzip ; Make install cd /usr/ports/textproc/urlview ; Make install cd /usr/ports/x11-servers/x2x ; Make install cd /usr/ports/sysutils/x86info ; Make install cd /usr/ports/x11-clocks/xalarm ; Make install cd /usr/ports/sysutils/xcpustate ; Make install cd /usr/ports/astro/xearth ; Make install cd /usr/ports/astro/xephem ; Make install cd /usr/ports/sysutils/xmbmon ; Make install cd /usr/ports/audio/xmixer ; Make install cd /usr/ports/chinese/xmms /usr/ports/multimedia/xmms ; Make install cd /usr/ports/chinese/xpdf /usr/ports/graphics/xpdf /usr/ports/japanese/xpdf ; Make install cd /usr/ports/sysutils/xsysstats ; Make install cd /usr/ports/x11/xtset ; Make install cd /usr/ports/distfiles/xv /usr/ports/graphics/xv /usr/ports/japanese/xv ; Make install cd /usr/ports/archivers/zip ; Make installYou need the space before the ; character so that the wild card expansion works correctly. Where more than one occurs, you need to work out which one is correct and remove the rest. Where a * remains, you need to go looking for the port.
Finally,
. ~/packages
Greg's home page | Greg's diary | Greg's photos | Copyright |