summaryrefslogtreecommitdiff
path: root/distribution/yocto-advanced/TUTORIAL.bash
blob: ecdf805da46593b3d5a5987b73f452aec20a9f77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash

#
# This script shows the steps for building and executing qemu, the boot files,
# and root filesystems.
#


# make meta-schulung-extended a git repository (optional)
#
#cd meta-schulung-extended
#git init
#git add .
#git commit -a -m 'initial commit'
#cd ..

# get a local copy of poky
git clone -b krogoth git://git.yoctoproject.org/poky.git

# setup (and switch to) the build environment
cd poky
TEMPLATECONF=../meta-schulung-extended/conf source ./oe-init-build-env ../build-schulung

# build qemu, u-boot/kernel/devicetree, root filesystem
bitbake qemu-native qemu-boot-files core-image-schulung meta-ide-support

# start the core image in qemu
DEPLOY=tmp/deploy/images/vexpress
SD=$DEPLOY/core-image-schulung-vexpress.ext4
UBOOT=$DEPLOY/u-boot.uimg
QEMU_AUDIO_DRV=none \
	./tmp/work/armv7ahf-neon-poky-linux-gnueabi/meta-ide-support/1.0-r3/recipe-sysroot-native/usr/bin/qemu-system-arm \
	-M vexpress-a9 \
	-m 128 \
	-nographic \
	-net nic -net user,tftp=$DEPLOY \
	-drive file=${SD},if=sd,format=raw \
	-kernel $UBOOT



# from the U-Boot prompt:
# => dhcp 0x64000000 image.fit
# => setenv bootargs console=ttyAMA0,115200 root=/dev/mmcblk0
# => bootm 0x64000000

# either run "poweroff" or powercut virtual machine with "CTRL-a, x"