Yocto on Quark X1000
Build Guide
Table of Contents
1注意事項
$ tree -L 1
.
|-- gnu-efi-3.0
|-- grub-legacy -> grub-legacy_5775f32a+v1.0.1
|-- grub-legacy_5775f32a+v1.0.1
|-- meta-clanton -> meta-clanton_v1.0.1
|-- meta-clanton_v1.0.1
|-- package
|-- Quark_EDKII -> Quark_EDKII_v1.0.1
|-- Quark_EDKII_v1.0.1
|-- Quark_EDKII_v1.0.1-svn_externals.repo
|-- spi-flash-tools -> spi-flash-tools_v1.0.1
|-- spi-flash-tools_v1.0.1
|-- sysimage -> sysimage_v1.0.1
`-- sysimage_v1.0.1
2 Prepare
$ 7z x Board_Support_Package_Sources_for_Intel_Quark_v1.0.1.7z
$ sudo apt-get install build-essential gcc-multilib vim-common \
p7zip-full git diffstat texinfo gawk chrpath file \
make gcc g++ uuid-dev iasl patch \
sed wget subversion git-core coreutils \
unzip texi2html texinfo libsdl1.2-dev docbook-utils fop gawk \
python-pysqlite2 diffstat make gcc build-essential xsltproc \
g++ desktop-file-utils chrpath libgl1-mesa-dev libglu1-mesa-dev \
autoconf automake groff libtool xterm libxml-parser-perl
3 EDKII firmware
3.1 build
$ tar -xvf package/Quark_EDKII_v1.0.1.tar.gz -C .
$ cd Quark_EDKII_v1.0.1/
$ ./svn_setup.py
$ svn update
$ cd CryptoPkg/Library/OpensslLib
$ wget http://www.openssl.org/source/openssl-0.9.8w.tar.gz
$ tar -xvf openssl-0.9.8w.tar.gz
$ cd openssl-0.9.8w
$ patch -p0 -i ../EDKII_openssl-0.9.8w.patch
$ cd ..
$ chmod +x Install.sh
$ ./Install.sh
$ cd ../../../
$ gcc -v
$ ./buildallconfigs.sh GCC46 QuarkPlatform
3.2 output
The build output can be found in the following directories:
4 GRUB OS loader
4.1 Build
$ wget http://sourceforge.net/projects/gnu-efi/files/gnu-efi_3.0v.orig.tar.gz
$ tar -xvf gnu-efi*
$ cd gnu-efi*/gnuefi
$ make ARCH="ia32"
$ cd -
$ tar -xvf grub-legacy_*.tar.gz
$ cd grub-legacy_*
$ ./gitsetup.py
$ cd work
$ autoreconf --install
$ export CC4GRUB='gcc -m32 -march=i586 -fno-stack-protector'
$ export GNUEFI_LIBDIR=~/workspace/galileo/gnu-efi-3.0/gnuefi/
$ CC="${CC4GRUB}" ./configure-quark.sh
$ make
4.2 output
5 ROOTFS & bzImage
5.1 build
$ tar -xvf meta-clanton*.tar.gz
$ cd meta-clanton*
$ ./setup.sh
$ source poky/oe-init-build-env yocto_build
$ bitbake image-spi-galileo
5.2 output
The output of the build process is found in ./tmp/deploy/images/ and includes the following files:
6 cross compile toolchain
6.1 build
$ source poky/oe-init-build-env yocto_build
$ bitbake image-spi-galileo -c populate_sdk
6.2 install
$ ./tmp/deploy/sdk/clanton-tiny-uclibc-x86_64-i586-toolchain-1.4.2.sh
6.3 usage
$ source /opt/clanton-tiny/1.4.2/environment-setup-i586-poky-linux-uclibc
$ ${CC} myfile.c -o myfile
7 flash image
7.1 build
$ tar -xvf sysimage_*.tar.gz
$ tar -xvf spi-flash-tools*.tar.gz
$ ./sysimage/create-symlinks.sh
$ cd sysimage/sysimage.CP-8M-debug
# modify the layout.conf file in the [Ramdisk] section
# from image-spi-clanton.cpio.lzma to image-spi-galileo-clanton.cpio.lzma
$ ../../spi-flash-tools*/Makefile
7.2 output
8 Define platform data
8.1 build
$ vim spi-flash-tools/platform-data/sample-platform-data.ini
次の例を参照して、プロファイルを変更します.
[Platform Type]
id=1
desc=PlatformID
data.type=hex.uint16
# ClantonPeak 2, KipsBay 3, CrossHill 4, ClantonHill 5, KipsBay-fabD 6
data.value=6
# WARNING: the MRC parameters MUST match the platformID used above
[Mrc Params]
id=6
ver=1
desc=MrcParams
data.type=file
#data.value=MRC/clantonpeak.v1.bin
#data.value=MRC/kipsbay.v1.bin
#data.value=MRC/crosshill.v1.bin
#data.value=MRC/clantonhill.v1.bin
data.value=MRC/kipsbay-fabD.v1.bin
[MAC address 0]
id=3
desc=1st MAC
data.type=hex.string
data.value=001320FDF4F2 #unique MAC address of your device
[MAC address 1]
id=4
desc=2nd MAC
data.type=hex.string
data.value=02FFFFFFFF01
$ cd spi-flash-tools/platform-data/
$ ./platform-data-patch.py -p sample-platform-data.ini \
-i ../../sysimage_4M*/sysimage.CP-8M-release/Flash-missingPDAT.bin
9 Programming Flash
Press [Enter] to directly boot.
Press [F7] to show boot menu options.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒ Please select boot device: ▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒UEFI Payload ▒
▒Boot Device List ▒
▒UEFI Internal Shell ▒
▒UEFI Generic USB2.0-CRW 20090815198100000 ▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒ and to move selection ▒
▒ ENTER to select boot device ▒
▒ ESC to exit ▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
EFI Shell version 2.31 [1.0]
Current running mode 1.1.2
Device mapping table
fs0 :Removable HardDisk - Alias hd11a0b blk0
PciRoot(0x0)/Pci(0x14,0x4)/USB(0x0,0x0)/HD(1,MBR,0x00000000,0x2000,0xE6C000)
blk0 :Removable HardDisk - Alias hd11a0b fs0
PciRoot(0x0)/Pci(0x14,0x4)/USB(0x0,0x0)/HD(1,MBR,0x00000000,0x2000,0xE6C000)
blk1 :Removable BlockDevice - Alias (null)
PciRoot(0x0)/Pci(0x14,0x4)/USB(0x0,0x0)
Press ESC in 1 seconds to skip startup.nsh, any other key to continue.
Shell> fs0:
fs0:\> CapsuleApp.efi Flash-missingPDAT.cap