|
|
This is a part of the new system HOWTO pages. It relates to upgrading an existing machine by installing a new system on a new disk. See the main page for other options. This is very much the way I do things, and certain aspects are not useful elsewhere.
Create a new partition /destdir and install the latest and greatest version on it:
mkdir /src mount eureka:/src /src ln -s /src/CVS/FreeBSD/ncvs /home export CVSROOT=/home/ncvs mv /usr/ports /usr/ports.orig # or remove them cd /usr cvs co ports
mount /dev/ad2s3h $DESTDIR/home for i in Book Makefile OED PHRA Texts andrew core etc finanzamt grog hiten house jdunham lemis martins mikal monkey nanyang ncvs norm oldRCS oldx postgres reiterhof release rms root seren setuid var waveform wkt yana yvonne; do echo Syncing $i; rsync -Halv $i $DESTDIR/home; done rsync -Halv /wantadilla/home $DESTDIR/home cd /var rsync -Halv backups games mail rwho spool $DESTDIR/var
export DESTDIR=/destdir cd /usr/srcAt this point at the latest, make sure that the host system has any new users and groups that the target system will need for installation. chmod and friends always use the local system credentials, so if you don't, you'll get messages like
ERROR: Required proxy user is missing, see /usr/src/UPDATING.Continuing,
make world cp -p /boot/device.hints $DESTDIR/boot/device.hints make kernel cd /usr/src/etc make distrib-dirs (until we update the Makefile) make distribution This won't currently work across NFS because pwd_mkdb wants to use flock. Find a solution.
/home/Sysconfig/scripts/ciRCS check in RCS files (on old system)Then, on the new system:
/home/Sysconfig/scripts/installRCS -f create new RCS hierarchy cd / /home/Sysconfig/scripts/coRCS and check them out
cd $DESTDIR/etc rcsdiff -wu RCS/* 2>/dev/null | lessFix any conflicts, in particular /etc/group and /etc/master.passwd. If you change /etc/master.passwd, note that you'll have to regenerate /etc/passwd after rebooting to the new system.
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"|sed 's/rcsdiff:/co -M /; s/:.*//'|sh
For each file, decide what to do.
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.html,v 1.11 2008/02/04 23:51:15 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
Check rc.conf: in particular, make sure that host name and IP don't conflict with any other system in the network. This won't happen if you're upgrading a system, but it could if you're cloning.
For the last time, check in the current RCS-controlled files:
/home/Sysconfig/scripts/ciRCS
cd /home/Sysconfig/MasterRCS . ../scripts/linkRCS . ../scripts/coRCS
. mkmounts
ln -s /src/Sysconfig/<systemname> /home
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
Set DESTDIR globally:
If the partition has been copied from another machine, remove all ports and local copies of source and object trees:
make buildworld make kernel make installworld
Greg's home page | Greg's diary | Greg's photos | Copyright |