50GB空闲磁盘空间(最好还剩余100GB以上)
Git 1.8.3.1以上版本
tar 1.28以上版本
Python 3.5.0以上版本
gcc 5.0以上版本
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
pylint3 xterm
$ git clone git://git.yoctoproject.org/poky
$ cd poky
$ git fetch --tags
$ git tag
$ git checkout tags/yocto-3.1 -b my-yocto-3.1
$ cd poky
$ ./oe-init-build-env
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.
You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
into your configuration please add entries to conf/bblayers.conf.
The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86'
Other commonly useful commands are:
- 'devtool' and 'recipetool' handle common recipe tasks
- 'bitbake-layers' handles common layer tasks
- 'oe-pkgdata-util' handles common target package tasks
当前位于poky目录下:
$ cd bitbake/bin
$ pwd
/home/neutionwei/poky/bitbake/bin
$ export PATH=$PATH:/home/neutionwei/poky/bitbake/bin
$ cd -
当前位于poky目录下:
$ cd build
$ bitbake core-image-minimal
Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:21
Parsing of 768 .bb files complete (0 cached, 768 parsed). 1300 targets, 40 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.46.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-18.04"
TARGET_SYS = "x86_64-poky-linux"
MACHINE = "qemux86-64"
DISTRO = "poky"
DISTRO_VERSION = "3.1"
TUNE_FEATURES = "m64 core2"
TARGET_FPU = ""
meta
meta-poky
meta-yocto-bsp = "my-yocto-3.1:5d47cdf448b6cff5bb7cc5b0ba0426b8235ec478"
NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/2.8/x86_64-nativesdk-libc.tar.xz;sha256sum=a09922172c3a439105e0ae6b943daad2d83505b17da0aba97961ff433b8c21ab
Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:01
Sstate summary: Wanted 1159 Found 0 Missed 1159 Current 0 (0% match, 0% complete)
NOTE: Executing Tasks
当前位于build目录下:
$ cd tmp/deploy/images/qemux86-64/
$ ls -al
total 28144
drwxr-xr-x 2 neutionwei neutionwei 4096 11月 1 04:20 .
drwxr-xr-x 3 neutionwei neutionwei 4096 11月 1 04:19 ..
lrwxrwxrwx 2 neutionwei neutionwei 75 11月 1 04:19 bzImage -> bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin
-rw-r--r-- 2 neutionwei neutionwei 8626848 11月 1 04:19 bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin
lrwxrwxrwx 2 neutionwei neutionwei 75 11月 1 04:19 bzImage-qemux86-64.bin -> bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin
-rw-r--r-- 2 neutionwei neutionwei 1338 11月 1 04:20 core-image-minimal-qemux86-64-20201031100022.qemuboot.conf
-rw-r--r-- 2 neutionwei neutionwei 12273664 11月 1 04:20 core-image-minimal-qemux86-64-20201031100022.rootfs.ext4
-rw-r--r-- 2 neutionwei neutionwei 884 11月 1 04:20 core-image-minimal-qemux86-64-20201031100022.rootfs.manifest
-rw-r--r-- 2 neutionwei neutionwei 3279857 11月 1 04:20 core-image-minimal-qemux86-64-20201031100022.rootfs.tar.bz2
-rw-r--r-- 2 neutionwei neutionwei 181054 11月 1 04:20 core-image-minimal-qemux86-64-20201031100022.testdata.json
lrwxrwxrwx 2 neutionwei neutionwei 56 11月 1 04:20 core-image-minimal-qemux86-64.ext4 -> core-image-minimal-qemux86-64-20201031100022.rootfs.ext4
lrwxrwxrwx 2 neutionwei neutionwei 60 11月 1 04:20 core-image-minimal-qemux86-64.manifest -> core-image-minimal-qemux86-64-20201031100022.rootfs.manifest
lrwxrwxrwx 2 neutionwei neutionwei 58 11月 1 04:20 core-image-minimal-qemux86-64.qemuboot.conf -> core-image-minimal-qemux86-64-20201031100022.qemuboot.conf
lrwxrwxrwx 2 neutionwei neutionwei 59 11月 1 04:20 core-image-minimal-qemux86-64.tar.bz2 -> core-image-minimal-qemux86-64-20201031100022.rootfs.tar.bz2
lrwxrwxrwx 2 neutionwei neutionwei 58 11月 1 04:20 core-image-minimal-qemux86-64.testdata.json -> core-image-minimal-qemux86-64-20201031100022.testdata.json
-rw-r--r-- 2 neutionwei neutionwei 7233298 11月 1 04:19 modules--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.tgz
lrwxrwxrwx 2 neutionwei neutionwei 75 11月 1 04:19 modules-qemux86-64.tgz -> modules--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.tgz
$ sudo apt-get install qemu
当前位于poky目录下:
$ cd scripts
$ pwd
/home/neutionwei/poky/scripts
$ export PATH=$PATH:/home/neutionwei/poky/scripts
$ cd -
当前位于poky目录下:
$ cd build
$ runqemu qemux86-64
runqemu - INFO - Running MACHINE=qemux86-64 bitbake -e ...
runqemu - INFO - Continuing with the following parameters:
KERNEL: [/home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin]
MACHINE: [qemux86-64]
FSTYPE: [ext4]
ROOTFS: [/home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20201031100022.rootfs.ext4]
CONFFILE: [/home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20201031100022.qemuboot.conf]
runqemu - INFO - Setting up tap interface under sudo
runqemu - INFO - Network configuration: ip=192.168.7.2::192.168.7.1:255.255.255.0
runqemu - INFO - Running /home/neutionwei/proj/yocto/poky/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-x86_64 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -drive file=/home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20201031100022.rootfs.ext4,if=virtio,format=raw -show-cursor -usb -device usb-tablet -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 -cpu core2duo -m 256 -serial mon:vc -serial null -kernel /home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin -append 'root=/dev/vda rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 '
与此同时会弹出名为qemu-system-x86_64的终端窗口,进入文件系统后直接输入root登陆即可!