Changing an installed system from i386 to amd64

Bakul Shah bakul at bitblocks.com
Tue May 13 15:51:13 UTC 2008


On Tue, 13 May 2008 15:18:36 BST Pete French <petefrench at ticketswitch.com>  wrote:
> I have a box currently running i386 which I want to change over to
> run amd64. I have installed a second drive into the machine on which
> I have put a basic install of amd64, and have compiled up the world
> and kertnel from source.
> 
> Can I simply switch the original partition over by mounting it up
> and doin a 'make installworld' with an approrpiate DESTDIR set ?
> I guess what I am asking is if anything else is different between
> the two versions aside from the actual binaries themselves (i.e.
> directory layout and the like).

In the 64 bit FreeBSD world, /usr/lib32 contains libraries
for the x86 binaries and /lib, /usr/lib contain 64 bit
libraries so a straight install may mess things up.  At the
very least you should backup your 32 bit root partition --
but I have a feeling my advice is already too late :-)

Ideally a simple perl script can automate most of this job.
May be all you have to do is something like this:

for a in lib usr/lib usr/local/lib
do
	mv $DESTDIR/$a $DESTDIR/${a}32
done
echo 'ldconfig32_paths="/usr/lib32 /usr/local/lib32"' >> $DESTIDIR/etc/rc.conf

Most all old 32 bit ports should work but upgrading them can
mess things up.  All the new compiles will generate 64 bit
binaries but any port dependencies on a shared library will
be wrong.  Also, not all 32 bit ports work on 64 bit.  May be
the trick is to save port directory names for all installed
ports (e.g. shell/zsh), then blow them all away (after saving
a copy somewhere) and then install them again.

This really needs to be part of sysinstall.

PS: the following may come in handy.  Save it in ~/bin/ldd32.

#!/bin/sh
# ldd for i386 binaries
for i in ${1+"$@"}
do
  echo "$i":
  env LD_32_TRACE_LOADED_OBJECTS=1 "$i"
done


More information about the freebsd-stable mailing list