Skip to main content.
Navigation:
DENX
>
DULG
>
ELDKInstallationUnderFreeBSD
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
DULG
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
DULG Home
BoardSelect
Manual
FAQ
Application Notes
Changes
Index
List of pages in DULG
Search
%SECTION0{name=ELDK Installation Under FreeBSD }% ELDK Installation under FreeBSD Question:: How can I install ELDK on a FreeBSD system? Answer:: [Thanks to Rafal Jaworowski for these detailed instructions.] This is a short tutorial how to host ELDK on FreeBSD 5.x and 6.x. The procedure described below was tested on 5.2.1, 5.3 and 6-current releases; we assume the reader is equipped with the ELDK 3.x CDROM or ISO image for installation, and is familiar with FreeBSD basic administration tasks like ports/packages installation. 1 Prerequisites: 1 Install =linux_base= %BR% %BR% The first step is to install the Linux compatibility layer from ports =/usr/ports/emulators/linux_base/= or packages =ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages/emulators/= %BR% %BR% %X% Please make sure to install version 7.1_5 (=linux_base-7.1_5.tbz=) or later; in particular, version 6.1.5 which can also be found in the ports tree does *not* work properly! %BR% %BR% The compatibility layer is activated by <verbatim> # kldload linux </verbatim> 1 Install =bash= %BR% %BR% Since ELDK and Linux build scripts are organised around =bash= while FreeBSD does not have it in base, this shell needs to be installed either from ports =/usr/ports/shells/bash2/= or packages collection =ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages/shells/= %BR% %BR% The installation puts the =bash= binary in =/usr/local/bin=. It is a good idea to create a symlink in =/bin= so that hash bang from scripts (=#!/bin/bash=) works without modifications: <verbatim> # cd /bin # ln -s /usr/local/bin/bash </verbatim> 1 Prepare ELDK %BR% %BR% %X% This step is only needed for ELDK release 3.1 and older versions. %BR% %BR% Copy the install files from the CDROM or ISO image to a writable location. Brand the ELDK installer as Linux ELF file: <verbatim> # cd <elkd_install_dir> # brandelf -t Linux ./install </verbatim> %T% *Note:* The following workaround might be a good alternative for the tedious copying of the installation CDROM to a writable location and manual branding: you can set a fallback branding in FreeBSD - when the loader cannot recognise the ELF brand it will switch to the last resort defined. <verbatim> # sysctl -w kern.elf32.fallback_brand=3 kern.elf32.fallback_brand: -1 -> 3 </verbatim> With this setting, the normal ELDK CDROM images should work. 1 Install ELDK normally as described in %REF{type=Section,topic=ELDKInitialInstallation,name=ELDKInitInstall}% 1 Set envrionment variables and PATH as needed for ELDK (in bash); for example: <verbatim> bash$ export CROSS_COMPILE=ppc_8xx- bash$ export PATH=${PATH}:/opt/eldk/bin:/opt/eldk/usr/bin </verbatim> 1 Hints for building U-Boot: %BR% %BR% FreeBSD normally uses BSD-style ='make'= in base, but in order to compile U-Boot ='gmake'= (GNU make) has to be used; this is installed as part of the ='linux_base'= package (see above). %BR% %BR% U-Boot should build according to standard ELDK instructions, for example: <verbatim> bash$ cd /opt/eldk/ppc_8xx/usr/src/u-boot-1.1.2 bash$ gmake TQM823L_config bash$ gmake all </verbatim> 1 Hints for building Linux: %BR% %BR% There are three issues with the =Makefile= in the Linux kernel source tree: * GNU =make= has to be used. * The ='expr'= utility in FreeBSD base behaves differently from the version than is used in Linux so we need to modify the Makefile to explicitly use the Linux version (which is part of the Linux compatibility package). This is best achieved with defining ="EXPR = /compat/linux/usr/bin/expr"= somewhere at =Makefile='s beginning and replacing all references to ='expr'= with the variable =${EXPR)=. * Some build steps (like when running ='scripts/mkdep'= can generate very long arguments lists (especially is the Linux kernel tree is in a directory with long absolute filenames). A solution is to use =xargs= to split such long commands into several with shorter argument lists. %BR% %BR% The Linux kernel can then be built following the standard instructions, for example: <verbatim> bash$ cd /opt/eldk/ppc_8xx/usr/src/linux-2.4.25/ bash$ gmake mrproper bash$ gmake TQM823L_config bash$ gmake oldconfig bash$ gmake dep bash$ gmake -j6 uImage </verbatim>
14.1. ELDK
1. Abstract
14.1.2. ELDK Installation Hangs
Prev
Home
Next