描述:
Debian系统支持很多应用软件的安装。使嵌入式用户告别不停的交叉编译操作,直接在板卡上可以通过指令安装应用,数据库,web服务器等,相当于一个PC电脑了。
目前我们放入debian的移植方法,后期我们会发布数据库及webserver安装方法。
1.板卡准备:
CORE9G25:
Corewind提供的基于Atmel at91sam9g25的工业控制板卡,特性如下:
处理器: ARM9 @ 400Mhz Atmel AT91SAM9G25
内存: 128 or 256 MByte DDR2
存储: 256MB Nand Flash
以太网: 板载百兆PHY芯片
USB: 支持3路USB 接口
串口:支持扩展7路串口
I2C: 可扩展2路I2C总线
SPI: 可扩展2路SPI
GPIO:可扩展60路GPIO接口
A/D: 4通道10bit AD
Linux 3.6.9系统支持
Buildroot及Debian文件系统支持
-----------------------------------------------------------------------
一般来讲128MB内存跑debian足够了,不过如果跑大型数据库,还得上256MB 内存。
-------------------------------------------------------------------------
上个产品图片:
========================================================================
2.debian移植方法
Required packages
Install the required packages on your Ubuntu Linux PC (Tested on Ubuntu 13.10):
~$ sudo apt-get install multistrapUse Multistrap to generate the rootfs contents
~$ sudo apt-get install qemu
~$ sudo apt-get install qemu-user-static
~$ sudo apt-get install binfmt-support
~$ sudo apt-get install dpkg-cross
"Multistrap is a tool that automates the creation of complete, bootable, root filesystems. It can merge packages from different repositories to make the rootfs. Extra packages are added to the rootfs simply by listing them - all dependencies are taken care of. Current development in multistrap is to support user-specified scripts being added as hooks during the unpacking phase to add customised startup scripts and configure things like device nodes".
Create a working directory
~$ mkdir emdebian
~$ cd emdebian
~/emdebian$
Create or download a file called multistrap.conf with the following contents:
[General]
arch=armel
directory=target-rootfs
cleanup=true
noauth=true
unpack=true
debootstrap=Emdebian Net Utils Python
aptsources=Emdebian
[Emdebian]
packages=apt
source=http://www.emdebian.org/grip
keyring=emdebian-archive-keyring
suite=wheezy-grip
[Net]
#Basic packages to enable the networking
packages=netbase net-tools ethtool udev iproute iputils-ping ifupdown isc-dhcp-client ssh
source=http://www.emdebian.org/grip
[Utils]
#General purpose utilities
packages=locales adduser nano less wget vim rsyslog dialog
source=http://www.emdebian.org/grip
#Python language
[Python]
packages=python python-serial
source=http://www.emdebian.org/grip
Read Multistrap man page to understand each directive meanings.
Adding packages
You can add or remove packages changing the "packages=" or adding new sections on "debootstrap=" line.
For example if you need to install the Apache http server and the PHP language add this section in multistrap.conf:
[Php]
packages=php5 apache2
source=http://www.emdebian.org/grip
and add the new section on this line:
debootstrap=Emdebian Net Utils Python Php
In this example we are using the Italian Debian repository http://ftp.it.debian.org/debian so to use your local Debian repository change .it. with your country ISO code (for example .uk., etc).
Note that not all the packages are available in the Emdebian-Grip repository so you need to download them from the standard Wheezy Debian repository in this case the section will become something like this:
[Php]Note that you can install more packages directly on the target using apt-get command.
packages=php5 apache2
source=http://ftp.it.debian.org/debian
suite=wheezy
Create the root filesystem
When your multistrap.conf file is ready launch Multistrap:
~/emdebian$ sudo multistrap -f multistrap.confMultistrap system installed successfully in /home/.../emdebian/target_rootfs/.
...
At the end of this procedure the directory target-rootfs directory will contents the whole rootfs tree to be moved into the second partition of an CORE9G25 board bootable microSD.
Configure now the EmDebian packages using the armel CPU emulator QEMU and chroot to create a jail where dpkg will see the target-rootfs as its root (/) directory.
~/emdebian$ sudo cp /usr/bin/qemu-arm-static target-rootfs/usr/binAt this prompt:
~/emdebian$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot target-rootfs dpkg --configure -a
Reply with < No >.
Some other prompt will appear during the configuration. Reply to them as you like.
When finished the target rootfs will be almost ready to be moved on the target microSD but it still needs some last extra configuration before using it.
Create a command file like this:
#!/bin/sh
#Target directory where will be createt the next target
#rootfs
TARGET_ROOTFS_DIR="target-rootfs"
#Directories used to mount some microSD partitions