Changes between Version 2 and Version 3 of FreeBSDCrossBuilding


Ignore:
Timestamp:
Sep 29, 2010, 8:34:51 PM (12 years ago)
Author:
Rick van der Zwet
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FreeBSDCrossBuilding

    v2 v3  
    1 XXX: Make we somehow more descriptive
     1Mijn aanpak met 8.1-RELEASE heb ik gebruik gemaakt van wat 'vieze trucjes' die nullfs dingen en chroot.Bouwen in een jail heb ik niet
     2voor elkaar gekregen omdat mdconfig i386 (32bit) niet overweg kan met een amd64 (64bit) /dev/mdctl handle. Verder kan 'stock' nanobsd.sh ook
     3niet cross-builden en maakt wat vervelende aannamems van de architecture van het systeem waar het op draait.  Ik maak dus de ports en het OS in de chroot en doe de instalatie in het 'master' os.
    24
    3 Building a FreeBSD kernel i386 called file:DEBUG on an amd64 can cause some headache:
    4 build# sh -c 'MACHINE_ARCH=i386 MACHINE=i386 MAKEOBJDIRPREFIX=/usr/obj/nanobsd.wleiden/i386 make KERNCONF=DEBUG NO_MODULES=yes buildkernel'
     5  master# svn checkout http://svn.wirelessleiden.nl/svn/code/iris/trunk/nanobsd /root/nanobsd
     6  master# mkdir -p /usr/local/jail/i386
     7  master# csup -h cvsup.nl.freebsd.org /usr/share/examples/cvsup/standard-supfile
     8  master# cd /usr/src
     9  master# make buildworld TARGET=i386
     10  master# make installworld TARGET=i386 DESTDIR=/usr/local/jail/i386
     11  master# kldload nullfs
     12  master# mkdir -p /usr/local/jail/i386/usr/ports ; mount_nullfs /usr/ports /usr/local/jail/i386/usr/ports
     13  master# mkdir -p /usr/local/jail/i386/usr/obj ; mount_nullfs /usr/obj /usr/local/jail/i386/usr/obj
     14  master# mkdir -p /usr/local/jail/i386/root/nanobsd ; mount_nullfs /root/nanobsd /usr/local/jail/i386/root/nanobsd
     15  master# chroot /usr/local/jail/i386/
     16  jail# setenv UNAME_m i386
     17  jail# setenv UNAME_m i386
     18  jail# /root/nanobsd/tools/package-build.sh
     19  jail# patch -d /usr/src/sys/dev/usb -i /root/nanobsd/misc/patches/usbdevs.patch
     20  jail# patch -d /usr/src/sys/dev/usb/net -i /root/nanobsd/misc/patches/if_udav.c.patch
     21  jail# sh /usr/src/tools/tools/nanobsd/nanobsd.sh -c /root/nanobsd/cfg/nanobsd.wleiden
     22  Info: This build will fail ones it tries to play around with memory disks.
     23  jail# exit
     24  master# setenv CFG_ROOT_PASSWORD `dd if=/dev/random bs=10k count=10 | tr -cd '[a-zA-Z0-9]' | cut -c -15`
     25  master# echo $CFG_ROOT_PASSWORD
     26  master# sh /usr/src/tools/tools/nanobsd/nanobsd.sh -c /root/nanobsd/cfg/nanobsd.wleiden
     27  master# ls -alh /usr/obj/nanobsd.wleiden/_.disk.*
    528
    6 Then install kernel CF is mounted at file:/mnt :
    7 # sh -c 'MACHINE_ARCH=i386 MACHINE=i386 MAKEOBJDIRPREFIX=/usr/obj/nanobsd.wleiden/i386 make KERNCONF=DEBUG NO_MODULES=yes installkernel PREFIX=/mnt'
     29References:
     30 - Patches are needed for the USB devices we use, but who are not in a stock 8.1-RELEASE-p2.
     31 - Oficial node image building page http://www.wirelessleiden.nl/projects/nodefactory/wiki/NanoBSD
     32 - Trick the ports building architecture using UNAME_* http://lists.freebsd.org/pipermail/freebsd-arch/2009-January/008857.html