In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to build an embedded Linux system with OpenEmbedded". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Download Embedded-LFS:
Svn checkout http://embedded-lfs.googlecode.com/svn/trunk/ embedded-lfs-read-only
two。 Create a script file named xxxx_env.sh:
The xxxx here represents the name of the board. For example, the pxa300_env.sh written for pxa300 is as follows:
Unset TOOLCHAIN_PREFIXexport BOARD_NAME=pxa300export TOOLCHAIN=/usr/local/arm-linux-4.1.1env.sh arm $1export CFLAGS=$CFLAGS "- mcpu=xscale-fno-strict-aliasing"
This is mainly about setting the name of the board and the location of the tool chain, as well as some additional compilation options. There are three default script files:
Openmoko_env.sh compiles for openmoko mobile phone
Pxa300_env.sh compiles for pxa300 of marvell.
The x86 version compiled by x86_env.sh can be tested in a virtual machine.
3. Modify the package configuration file:
Each item in the configuration file describes a software package, and the same package can have multiple items that are automatically merged. As described by zlib:
[zlib] config-env = export CC=$ (TARGET_CC) PREFIX=$ (PREFIX) config-cmd = configureconfig-param=-prefix=$ (PREFIX)-sharedurl = http://google-desktop-for-linux-mirror.googlecode.com/files/zlib-1.2.3.tar.gz
Config-env specifies the environment variable to be set before configure.
The command that config-cmd executes when configure is specified.
Config-param specifies the parameters when configure.
Url is the location where the software package is downloaded.
For software packages managed with standard autotool, it is simpler. As described by png:
[png] config-cmd = autoconfurl = http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.35.tar.bz2
All you need to do here is to specify that it is configured with autoconf and download the URL of the package.
In addition, the location of the package determines the compilation order of the package.
To reuse this configuration information between different platforms, you can put the configuration of these packages in several files:
(1) pkg-$GDK_TARGET.ini is mainly used to distinguish between TinyX-based GTK and DirectFB-based GTK.
Pkg-directfb.ini is based on the default configuration of TinyX's GTK.
Pkg-x11.ini is based on the default configuration of DirectFB-based GTK.
(2) pkg-$ARCH.ini this is a software package configuration unique to a certain type of CPU.
Configuration specific to the pkg-x86.ini PC version
Configuration specific to the pkg-arm.ini arm version
(3) the unique configuration of pkg-$BOARD_NAME.ini board.
(4) the pkg-$BOARD_NAME-$GDK_TARGET.ini board is specially configured for different backends of GTK.
4. Set compilation environment variables (take pxa300 as an example)
If you want to compile TinyX-based GTK:
[root@localhost embedded-lfs] #. Pxa300_env.sh
If you want to compile DirectFB-based GTK:
[root@localhost embedded-lfs] #. Pxa300_env.sh directfb
The following prompt appears at the terminal:
= exported the following vars:=ARCH=armGDK_TARGET=directfbWITH_ARCH=-with-arch=arm-linuxHOST_PARAM=-host=arm-linuxTARGET_CC=arm-linux-gccTARGET_PLATFORM=arm-linux-PREFIX=/work/mine/googlecode/embedded-lfs/arm/pxa300/usrCFLAGS=-I/work/mine/googlecode/embedded-lfs/arm/pxa300/usr/includeLDFLAGS=-L/work/mine/googlecode/embedded-lfs/arm/pxa300/usr/libPKG_CONFIG_PATH=/work/mine/googlecode/embedded-lfs/arm/pxa300/usr/lib/pkgconfig/PATH=/usr/local / arm-linux-4.1.1/bin:/work/mine/googlecode/embedded-lfs/patches/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/backup/software/jdk1.5.0_19/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/sbin:/usr/sbin::/root/bin=to build:make-f Makefile.pxa300.directfb all=
5. Compile
Just follow the prompts when setting environment variables, such as:
Make-f Makefile.pxa300.directfb all
The compiled results will be automatically installed under ARCH/BOARD, for example, the compiled results of pxa300 will be installed into the arm/pxa300 directory.
6. Problem diagnosis
Embedded- lfs works by generating a Makefile file based on package configuration and environment variables. For example, in the previous Makefile.pxa300.directfb, if there is a problem with the compilation, you can see if the script of the corresponding package in this Makefile is correct. For example, this is the compilation script for freetype:
Packages/freetype-2.3.9.tar.gz:cd packages & & wget http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.3.9.tar.gzfreetype-2.3.9: packages/freetype-2.3.9.tar.gztar xf packages/freetype-2.3.9.tar.gzfreetype: freetype-2.3.9mkdir freetype-2.3.9/$ (ARCH) Cd freetype-2.3.9/$ (ARCH) & &.. / configure $(HOST_PARAM)-prefix=$ (PREFIX) & & make clean; make & & make installfreetype_clean:rm-rf freetype-2.3.9/$ (ARCH) freetype_source_clean:rm-rf freetype-2.3.9
Some limitations of embedded-lfs:
(1) currently, only arm and x86 are supported
(2) only tested on Fedora, if autotool and libtool related tools are installed correctly in the system, other distributions should not have too many problems.
This is the end of the introduction of "how to build an embedded Linux system with OpenEmbedded". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.