Kernel Build errors
Peter Wemm
peter at wemm.org
Fri Dec 3 08:48:58 PST 2004
On Friday 03 December 2004 05:26 am, Michael Lednev wrote:
> Hello Egor,
>
> Friday, December 3, 2004, 3:24:54 PM, you wrote:
>
> ED> # cd /usr/src/
> ED> # make clean
> ED> # rm -r /usr/obj/*
> ED> # make TARGET_TECH=amd64 buildworld
> ED> # make TARGET_TECH=amd64 buildkernel
> ED> # make TARGET_TECH=amd64 installkernel
>
> hmmm, just like written in handbook ;)
>
> ED> New kernel freezes at startup right after enumerating hard
> drives... ED> Should I install world? How? Thanks in advance!
>
> unfortuately amd64 kernels cannot work with i386 world so you
> definetly need to install amd64 one. the easiest way to accomplish
> this is to make clean install from cd.
If you are feeling adventurous, this is what I do to convert an i386
install to an amd64 system:
* build an amd64 kernel, install it as kernel.amd64
* turn off swap and newfs /dev/ad0s1b (swap partition). dont forget
rc.conf and fstab
* mount /dev/ad0s1b /mnt
* make installworld DESTDIR=/mnt (this puts an amd64 userland in the
temporary filesystem that lives in the swap partition)
* copy /etc/fstab to /mnt/etc/fstab (and a few others that I dont
remember)
* reboot
* break into loader prompt
* type: set vfs.root.mountfrom="ufs:/dev/ad0s1b"
* boot -s kernel.amd64
If everything works, then I mount /home (I use /home/src and /home/obj)
and make symlinks from the scratch /usr/src and /usr/obj to /home. I
mount the old root partition, old /var and /usr etc
as /mnt, /mnt/usr, /mnt/var, etc. Then do another 'make installworld
DESTDIR=/mnt".
Reboot again, still with the amd64 kernel but with the normal root fs.
Once its up, turn swap back on and reset rc.conf.
Caveat: this is an overview, not a detailed recipe. I have not done
this for something like 12 months, so the chances that I've forgotten a
key point are fairly good. Don't try this if you're not going to be
able to get yourself out of a mess.
Historical note: Sun used the 'fs in swap' thing for their OS boot
tapes. They'd boot the tape and copy a dd'ed image into swap and mount
it. It probably predates that though, but that was the first I heard
of it.
BTW: the reason why this is necessary is that the 32 bit emulation is
aimed at application level syscalls and kernel interfaces. The moment
that we get into OS-level binaries, we get exposed to things like the
mount interface, sysctl binary data and so on. The task of translating
that is huge. Not to mention that static binaries (like /sbin/init)
won't run due to the i386_userldt syscalls.
--
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
More information about the freebsd-amd64
mailing list