为方便,把常用命令先写上,供大家拷贝方便
petalinux-create -t project -s version2-0405.bsp
petalinux-config --get-hw-description=./
john@john-virtual-machine:~/peta_proj/$ petalinux-package --bsp -p ./myc-7015 --output version2-0405.bsp
john@john-virtual-machine:~/peta_proj/myc-7015$ petalinux-package --boot --format BIN --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/system.bit --u-boot --force
john@john-virtual-machine:~$ /mnt/hgfs/2018.3/petalinux-v2018.3-final-installer.run /home/john/petalinux
本地化sstate
file:///mnt/hgfs/xilinx/sstate-rel-v2018.3/downloads
/mnt/hgfs/xilinx/sstate-rel-v2018.3/aarch64
petalinux可以手工修改的地方
petalinux-config存在project-spec/configs/config文件里
以下是验证此结论
以上设置保存在下面的目录里
打开可以看到
ultra96 boot设置
/petalinux_project/petalinux_from_sd/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend
下面的bsp.cfg文件以前的文件中是没有的,如果解析,必须在下面的bbappend的文件中加入目录
bsp.cfg
网络相关内容
CONFIG_NET=y
CONFIG_NET_TFTP_VARS=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CMD_NET=y
CONFIG_CMD_PING=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_TFTPPUT=y
CONFIG_CMD_NFS=y
CONFIG_BOOTDELAY=2
配置后产生的文件
petalinux-config中以上内容是找不到的
config u-boot
执行petalinux-config -c u-boot,根据README进行配置
petalinux-config -c u-boot
选中Networking Support,并全选其中内容,
CONFIG_BOOTDELAY 配置为2,
Command Line interface——>Network commands——>选择bootp tftpboot,tftp put,nfs三项。
应该是存在这里面
kernel
如果是自定义,注意加上以下两点
/project-spec/meta-user/recipes-kernel/linux/linux-xlnx copy over
bsp.cfg and fix_u96v2_pwrseq_simple.patch from my project repository (respectively linked).
Add the following lines to the linux-xlnx_%.bbappend file
SRC_URI += "file://bsp.cfg"
SRC_URI_append = " file://fix_u96v2_pwrseq_simple.patch"
在以前的文件中居然没有这个目录
但在meta-plnx-generared中确实产生类似的文件
CONFIG_MTD=y
CONFIG_MTD_OF_PARTS=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
#CONFIG_DEBUG_ZYNQ_UART0 is not set
CONFIG_DEBUG_LL=y
CONFIG_DEBUG_ZYNQ_UART1=y
CONFIG_EARLY_PRINTK=y
CONFIG_HWMON=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_OF_XILINX_PS=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MTD=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_OF_PARTS=y
CONFIG_MTD_SPI_NOR=y
CONFIG_NET_CORE=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_XILINX_PS_UART=y
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
CONFIG_SPI=y
CONFIG_SPI_XILINX_PS_QSPI=y
roofs
用户根文件放置目录
the user-rootfsconfig file (located in /project-spec/meta-user/conf
用户可用user-roofsconfig中引入,然后在下面的菜单中选定
Run petalinux-config -c rootfs
Select User Packages
select name of rootfs all the libraries listed above.
Petalinux build 的总文件bblayers.conf
顺手在根文件配置中加入以下文件包,作用不详,留待研究
加入镜像petalinux-image-full.bbappend
IMAGE_INSTALL_append = " peekpoke"
IMAGE_INSTALL_append = " gpio-demo"
IMAGE_INSTALL_append = " xlinx-axidma"
本地化配置sstate
第三项Add pre-mirror url:
file:///mnt/hgfs/xilinx/sstate-rel-v2018.3/downloads
第四项Local sstate feeds settings:
以前配置记录
SD卡,非emmc
BOOT.BIN SD
bootenv flash
image.ub SD
roofts jffs2 flash
Steps to Configure JFFS2 Boot
- Set the RootFS type to JFFS2. For more information, see Root File System Type
Configuration. - Set Primary Flash as boot device and boot images storage. For more information, see Boot
Images Storage Configuration and Primary Flash Partition Configuration.
如果用JFFS2,有三个地方需要设置,而以前只设了下两个,第一个设成了INITRAMFS,莫名其妙,可能是采用默认的文件系统
SD0为emmc, SD1为SD卡,BOOT由于QSPI放不下,以前就放在emmc第一个分区,BOOT.EVN在flash, kernel 在SD, initramfs 在emmc 第二分区
修改米尔config
改成SD卡
成功生成petalinux镜像
米尔emmc原始配置
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 212991 204800 100M b W95 FAT32
/dev/mmcblk0p2 212992 30375935 30162944 14.4G 83 Linux
Disk /dev/mmcblk1: 3.6 GiB, 3850371072 bytes, 7520256 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 63 7518419 7518357 3.6G 83 Linux
Disk /dev/mmcblk1boot1: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mmcblk1boot0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
加入GCC命令功能
petalinuxgroup-self-hosted.bb方法
在petalinux-config -c rootfs —>
Filesystem Packages —>
misc —>
[*] packagegroup-petalinux-self-hosted
以下未证实是否起作用,参考我的另一篇博客:
(95条消息) xilinx ultra96 2018.3以上版本BSP制作镜像时运行时间过长、内存耗尽的分析和解决_u010879745的博客-CSDN博客 https://blog.csdn.net/u010879745/article/details/104136726
因为webkitgtk模块编译时间超长,改掉后缀名,让yoto找不到它
将依赖它的模块注释掉
在petalinux系统目录里petalinuxgroup-self-hosted.bb文件中的epiphany注释掉
用make编译成功
执行文件生成
packagegroup-core-buildessential方法
另一篇文章说可以用packagegroup-core-buildessential来增加gcc、make功能,比较两个模块可知,上面的模块比这个模块功能要多一些。
04-18-2018 04:41 PM
10,736 Views
Registered: 08-31-2016
-
Create this file: meta-user/recipes-core/images/petalinux-user-image.bbappend
-
Add the following line to this file:
IMAGE_INSTALL += “packagegroup-core-buildessential”
It will add in the following packages to your build, and you will be able to run GCC on the target system.
https://forums.xilinx.com/t5/Embedded-Linux/gcc-in-petalinux-kernel/td-p/788368
packagegroup-core-buildessential.bb
SUMMARY = "Essential build dependencies"
inherit packagegroup
RDEPENDS_packagegroup-core-buildessential = "\
autoconf \
automake \
binutils \
binutils-symlinks \
cpp \
cpp-symlinks \
gcc \
gcc-symlinks \
g++ \
g++-symlinks \
gettext \
make \
libstdc++ \
libstdc++-dev \
libtool \
pkgconfig \
"
packagegroup-self-hosted.bb
SUMMARY = "Self-hosting"
DESCRIPTION = "Packages required to run the build system"
PR = "r13"
inherit packagegroup distro_features_check
# rdepends on libx11-dev
REQUIRED_DISTRO_FEATURES = "x11"
# rdepends on libgl
REQUIRED_DISTRO_FEATURES += "opengl"
PACKAGES = "\
packagegroup-self-hosted \
packagegroup-self-hosted-debug \
packagegroup-self-hosted-sdk \
packagegroup-self-hosted-extended \
packagegroup-self-hosted-graphics \
packagegroup-self-hosted-host-tools \
"
RDEPENDS_packagegroup-self-hosted = "\
packagegroup-self-hosted-debug \
packagegroup-self-hosted-sdk \
packagegroup-self-hosted-extended \
packagegroup-self-hosted-graphics \
packagegroup-self-hosted-host-tools \
"
RDEPENDS_packagegroup-self-hosted-host-tools = "\
e2fsprogs \
e2fsprogs-e2fsck \
e2fsprogs-mke2fs \
e2fsprogs-tune2fs \
hdparm \
iptables \
lsb \
mc \
mc-fish \
mc-helpers \
mc-helpers-perl \
parted \
${PSEUDO} \
screen \
"
PSEUDO = "pseudo"
PSEUDO_libc-musl = ""
RRECOMMENDS_packagegroup-self-hosted-host-tools = "\
kernel-module-tun \
kernel-module-iptable-raw \
kernel-module-iptable-nat \
kernel-module-iptable-mangle \
kernel-module-iptable-filter \
"
RDEPENDS_packagegroup-self-hosted-sdk = "\
autoconf \
automake \
binutils \
binutils-symlinks \
ccache \
coreutils \
cpp \
cpp-symlinks \
distcc \
file \
findutils \
g++ \
g++-symlinks \
gcc \
gcc-symlinks \
intltool \
ldd \
less \
libssp \
libssp-dev \
libssp-staticdev \
libstdc++ \
libstdc++-dev \
libtool \
make \
mktemp \
perl-module-re \
perl-module-text-wrap \
pkgconfig \
quilt \
sed \
"
# glibc-utils: for rpcgen
RDEPENDS_packagegroup-self-hosted-sdk_append_libc-glibc = "\
glibc-gconv-ibm850 \
glibc-utils \
"
RDEPENDS_packagegroup-self-hosted-debug = " \
gdb \
gdbserver \
rsync \
strace \
tcf-agent"
RDEPENDS_packagegroup-self-hosted-extended = "\
bzip2 \
chkconfig \
chrpath \
cpio \
curl \
diffstat \
diffutils \
elfutils \
expat \
gawk \
gdbm \
gettext \
gettext-runtime \
git \
git-perltools \
grep \
groff \
gzip \
settings-daemon \
libaio \
libusb1 \
libxml2 \
lrzsz \
lsof \
lzo \
man \
man-pages \
mdadm \
minicom \
mtools \
ncurses \
ncurses-terminfo-base \
neon \
nfs-utils \
nfs-utils-client \
openssl \
openssh-scp \
openssh-sftp-server \
openssh-ssh \
opkg \
opkg-utils \
patch \
perl \
perl-dev \
perl-misc \
perl-modules \
perl-pod \
python \
python-modules \
python3 \
python3-modules \
python3-git \
quota \
readline \
rpm \
setserial \
socat \
subversion \
sudo \
sysstat \
tar \
tcl \
texi2html \
texinfo \
unzip \
usbutils \
watchdog \
wget \
which \
xinetd \
zip \
zlib \
xz \
"
RDEPENDS_packagegroup-self-hosted-graphics = "\
builder \
libgl \
libgl-dev \
libglu \
libglu-dev \
libsdl \
libsdl-dev \
libx11-dev \
adwaita-icon-theme \
xdg-utils \
epiphany \
l3afpad \
pcmanfm \
vte \
"
Ubuntu:
http://www.wiki.xilinx.com/Ubuntu+on+Zynq
https://medium.com/developments-and-implementations-on-zynq-7000-ap/install-ubuntu-16-04-lts-on-zynq-zc702-using-petalinux-2016-4-e1da902eaff7
Debian:
https://wiki.debian.org/InstallingDebianOn/Xilinx/ZC702/wheezy
https://github.com/PyHDI/zynq-linux