Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Mar 2007 07:58:52 +1100
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Artem Kuchin <matrix@itlegion.ru>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Migrating from x86 (32) to amd64
Message-ID:  <20070309205852.GH856@turion.vk2pj.dyndns.org>
In-Reply-To: <000c01c7627f$7636f3f0$0c00a8c0@Artem>
References:  <002301c76274$04d05900$0c00a8c0@Artem> <20070309184555.GF856@turion.vk2pj.dyndns.org> <000c01c7627f$7636f3f0$0c00a8c0@Artem>

next in thread | previous in thread | raw e-mail | index | archive | help

--3siQDZowHQqNOShm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2007-Mar-09 22:16:36 +0300, Artem Kuchin <matrix@itlegion.ru> wrote:
>>>>>Is there way to more or less sefely  migrade to AMD64 arhitecture via
>>>>>csup and
>>>>>source build?
>>...
>>>Damn it. Then i guess i need to do some experimenting myself.
>>
>>Definitely.
>>
>>>Theoretically, what would be the procedure?
>>
>>1) Backup system.
>>2) Download amd64 install ISO and burn to CD
>>3) Boot from CD
>>4) Follow instructions for fresh install
>>5) Restore/merge configuration from backups.
>>
>>If you have a spare amd64 system and most of the content is static,
>>you could reduce downtime by doing steps 4 thru 5 on the second system
>>and either swapping the disk(s) or the entire system.
>
>no, that's no what i ment. I mean the procedure to source build/install
>amd64 on x86 and make it work. Just theoretically,

I presume you've read the bottom bit of /usr/src/UPGRADING

You should be able to cross-build an amd64 world with:
# make TARGET_ARCH=3Damd64 buildworld
# make TARGET_ARCH=3Damd64 KERNCONF=3DYourKernel buildkernel
(I'm confident this will work but watch out for CPU or
architecture-specific flags in your /etc/make.conf)

# mkdir /lib32 /usr/lib32
# cp -p /lib/* /lib32
# cp -p /usr/lib/* /usr/lib32
# cp -p /var/run/ld-elf.so.hints /var/run/ld-elf32.so.hints
# cp -p /libexec/ld-elf.so.1 /libexec/ld-elf32.so.1
These steps setup the i386 emulation infrastructure (some of these steps
may be overkill)

# make TARGET_ARCH=3Damd64 KERNCONF=3DYourKernel DESTDIR=3D/ installkernel
I think this will work.

Reboot to single user mode (shouldn't have any problems)
Mount /usr /var and anything else needed for the install
# mergemaster -p
# make TARGET_ARCH=3Damd64 DESTDIR=3D/ installworld

These steps are probably the riskiest because you are relying on
tricking the amd64 kernel into believing your i386 world is an i386
emulation.  If anything goes wrong here, you will probably need to
restore from backups because you can't run on the old kernel once
you've started installing amd64 binaries.

I haven't tried running an amd64 kernel with an i386 userland but
after symlinking /lib32 -> lib and /usr/lib32 -> lib and copying the
ld-elf.so files in my i386 filesystems, I can chroot into it whilst
running my amd64 kernel and execute commands.

# make delete-old
# mergemaster
These steps should be OK

Note that I wouldn't attempt to try going from 5.4/i386 to 6.2/amd64
in one step.  You want to minimise the things that can go wrong...

--=20
Peter Jeremy

--3siQDZowHQqNOShm
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQFF8cqM/opHv/APuIcRAk8yAJ4leYTgl3g7S861ojIt5i6Pph+ClACgwBI/
cyBfQfMxvsJCsMF++aXUuF4=
=329q
-----END PGP SIGNATURE-----

--3siQDZowHQqNOShm--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070309205852.GH856>