Chandramohan pujari
Source Formatting Done
2015-Dec-04
1.2
Nathalie Chan King Choy
Added an Appendix B for 2015.2 TRD with newer Ubuntu version
1. Summary
The Ubuntu Desktop provides a rich graphical environment upon which developers may develop their custom applications requiring graphical user interfaces.This Tech Tip is Intended to enable user to run complex operating system like Ubuntu on Zynq peta-Linux platform. This also demonstrates the capability of Zynq to act as a general purpose CPU.
To install only part of LibreOffice, you can install the appropriate meta-package by executing
sudo apt-get install <meta-package>
6. Appendix B - using 2015.2 TRD and newer Ubuntu rootfs
If you want to use the 2015.2 Zynq Base TRD with a newer Ubuntu rootfs, there are a few extra things you'll need to do because Linaro's newer releases don't include a Ubuntu Desktop rootfs image any more, and there are some kernel options to set so that the X-windowing doesn't fail with the newer Ubuntu rootfs. These instructions assume you are working with a Linux workstation where you have your SD card plugged into a card reader.
Get the 2015.2 Base TRD files: http://www.wiki.xilinx.com/Zynq+Base+TRD+2015.2
Get the Linaro 2014.10 release developer build, which is based on Ubuntu 14.04 (an LTS version): Go to page http://releases.linaro.org/14.10/ubuntu/trusty-images/developer/ and get linaro-trusty-developer-20141024-684.tar.gz
If you have a Windows machine, you can prepare your SD card according to steps 4.1.1 and 4.1.2 above to partition & set them to the correct type (fat32 for boot and ext4 for rootfs). On a Linux workstation, you can use the tool "gparted" to partition & set the type.
Untar the rootfs image into the rootfs partition:
sudo tar --strip-components=1 -C /media/nathalie/rootfs -xzpf linaro-trusty-developer-20141024-684.tar.gz binary
If you build the design yourself with the Xylon IP, you'll have your display timing out after about an hour, due to the evaluation version of the IP being used. Since we want to add stuff to the rootfs that will take longer than an hour to install everything, we will start off by using the pre-built BOOT.BIN that is included in the 2015.2 base TRD files "ready_to_test" folder, which has the non-evaluation version compiled in. For the moment, we don't need to modify the FSBL ELF, U-Boot ELF, nor HW bitstream, so we can use the pre-built BOOT.BIN. Copy <TRD directory>/ready_to_test/BOOT.BIN to the boot partition of your SD card.
We do need to modify the kernel because some kernel options are needed so that the X-windowing doesn't fail with the newer Ubuntu rootfs. Follow the instructions in section 5 of this page http://www.wiki.xilinx.com/Zynq+Base+TRD+2015.2 for PetaLinux up to
ln -sf zc702-base-trd.dts system-top.dts
in 5.2.1 (b). When you get to the part "ln -sf zc702-base-trd.dts system-top.dts", modify system-top.dts to use the rootfs that you will put on the rootfs partition: change so that root=/dev/mmcblk0p2 in the bootargs instead of using /dev/ram. Then do
petalinux-config -c kernel
and do these 2 steps:
(1) Disable PCI (CONFIG_PCI=n) because otherwise Xorg will segfault
(2) Set CMA_SIZE_MBYTES to 128 so that Xorg doesn't throw an error: Device Drivers > Generic Driver Options > DMA Contiguous Memory Allocator > Size in Mega Bytes.
Build & package the kernel with the modified options:
petalinux-build
petalinux-package --image -c kernel --format uImage
Copy $ZYNQ_TRD_HOME/software/petalinux/images/linux/system.dtb to the boot partition of your SD card with the filename devicetree.dtb. $ZYNQ_TRD_HOME is defined on page http://www.wiki.xilinx.com/Zynq+Base+TRD+2015.2
Copy $ZYNQ_TRD_HOME/software/petalinux/images/linux/uImage to the boot partition of your SD card
In the boot partition of your SD card, create a file uEnv.txt with the contents:
uenvcmd=run ubuntu_sdboot
ubuntu_sdboot=echo Copying Linux from SD to RAM in uEnv... && fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image} && if fatload mmc 0 0x2000000 ${ramdisk_image}; then bootm 0x3000000 0x2000000 0x2A00000; else bootm 0x3000000 - 0x2A00000; fi && echo Done uEnv
bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait
In the rootfs partition of your SD card, create a file etc/init/ttyPS0.conf with the contents (you probably will need to use "sudo" for creating/modifying files on the rootfs partition of your SD card):
start on runlevel [23]
stop on runlevel [!23]
respawn
exec /sbin/getty -8 115200 ttyPS0
In the rootfs partition of your SD card, open up etc/securetty for editing. If ttyPS0 isn't there, add it. If tty1 isn't there, add it.
In the rootfs partition of your SD card, open up etc/apt/apt.conf for editing. If you need to use a proxy server, then add lines that look like:
Acquire::http::proxy "<your proxy server>:<port #>/";
Acquire::https::proxy "<your proxy server>:<port #>/";
To get started, let’s set apt up to just get the minimal required packages:
APT::Install-Recommends "0";
APT::Install-Suggests "0";
In the rootfs partition of your SD card, open up etc/network/interfaces. If missing, add this line:
iface eth0 inet dhcp
Execute the "sync" command to flush everything that needs to be written. When it completes, eject the SD card and but do not put it in your ZC702 board yet.
Make sure you have the console connected to the UART on your ZC702 board. Cutecom can be used on a Linux workstation. Power on the board with no SD card so that it can get detected & then power it off.
dmesg | grep ttyUSB -> look for which /dev/ttyUSBn has the USB UART
for the "n" you found above, sudo chmod 666 /dev/ttyUSBn (otherwise you won't be able to make a connection). Connect to /dev/ttyUSBn in your console program
Put the SD card into the ZC702, make sure you are in SD boot mode, and turn it on. You should come up at tty1
Log in as root (password: linaro)
Disable console sleep: setterm -blank 0 -powerdown 0 > /dev/tty1
Make sure the ZC702 is plugged in to Ethernet. Then execute
/usr/lib/klibc/bin/ipconfig eth0
Then you can start to get packages. Lubuntu-desktop is a lightweight desktop. Other options could be lubuntu-core, xubuntu-desktop, etc. Getting lubuntu-desktop installed takes a few hours. (This is why we don't want the Xylon IP timing out on us while installation is happening).
apt-get update
apt-get lubuntu-desktop
After the installation is complete, use the "reboot" command to reboot. You should come back up to the login prompt. You can log in as user linaro (password linaro).
http://releases.linaro.org/14.10/ubuntu/trusty-images/developer/