Creating Ubuntu Image for ppc-4207

From Estone Technology Wiki
Jump to: navigation, search

Creating Ubuntu 14.04 Image

Install host dependencies

$ sudo apt-get install gparted git build-essential libncurses5 wget u-boot-tools zlib1g-dev ncurses-dev
$ sudo apt-get install cmake libc-dev-armhf-cross pkg-config-arm-linux-gnueabihf build-essential checkinstall cmake
$ sudo apt-get install pkg-config lzop libc6 libstdc++6 debootstrap qemu-user-static binfmt-support zlib1g:i386

Download the compiler toolchain

$ cd ~/
$ wget -c
$ tar xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
$ export target=mx6dl
$ export board=hio-ppc4207
$ export ARCH=arm
$ export CROSS_COMPILE=../gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-
$ unset LDFLAGS

build u-boot

$ cd ~/
$ git clone -b imx_v2015.04_3.14.52_1.1.0_ga
$ cd imx6qdl-linux-uboot/
$ make hio-imx6dl-board_defconfig
$ make

Note: the u-boot.imx resides at <imx6qdl-linux-uboot>

Build Kernel

$ cd ~/
$ git clone -b imx_3.14.52_1.1.0_ga
$ cd imx6qdl-linux-kernel/
$ make hio-imx6dl-ppc4207_defconfig
$ make -j4 zImage modules dtbs
  • Generate required files:

zImage: imx6qdl-linux-kernel/arch/arm/boot/zImage
hio-imx6dl-ppc4207.dtb: imx6qdl-linux-kernel/arch/arm/boot/dts/hio-imx6dl-ppc4207.dtb

Build rootfs

Installing with debootstrap

$ cd ~/
$ target=rootfs
$ distro=trusty
$ sudo debootstrap --arch=armhf --foreign --include=ubuntu-keyring,apt-transport-https,ca-certificates,openssl $distro "$target"
$ sudo cp /usr/bin/qemu-arm-static $target/usr/bin
$ sudo cp /etc/resolv.conf $target/etc
$ sudo chroot $target 
# distro=trusty
# /debootstrap/debootstrap --second-stage

Edit the sources.list repositories

# cat <<EOT > /etc/apt/sources.list
# deb $distro main universe
# deb-src $distro main universe
# apt-key adv --recv-keys --keyserver 40976EAF437D05B5
# apt-key adv --recv-keys --keyserver 3B4FE6ACC0B21F32
# apt-get update
# apt -y -f install
# apt-get upgrade
# apt-get install nano

Add x11 and LXDE to base rootfs

# apt-get install xinit lxde lxterminal lxappearance lxrandr lxshortcut lxinput xinit  xserver-xorg-dev mesa-utils mesa-utils-extra

Set up the lxde login environment

Add root login password

# passwd root  

Add linaro username

# adduser linaro	

Add Serial Console

# sudo nano etc/init/tty1.conf
Add this:  
exec /sbin/getty -L 115200 ttymxc1

Edit networks interfaces

# sudo nano etc/network/interfaces 
Add this:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

Exit chroot

# exit

Note:your rootfs is ready,It is in the current folder