December 08, 2019, 11:48:04 pm

News:

Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/


How to build ubuntu 14.04 core Nand Image

Started by benn, May 14, 2014, 06:46:49 am

Previous topic - Next topic

benn

May 14, 2014, 06:46:49 am Last Edit: May 14, 2014, 07:12:41 am by benn
Prebuilt Image:
http://dl.cubieboard.org/software/a20-cubietruck/ubuntu-14.04/ct-ubuntu-nand.img.gz


default root password: cubie  8)

How to build your own ubuntu 14.04 nand image?

Steps:

Prepare Your Build Environment

We have to build the nand image on Ubuntu 12.04(x86_64), because of the proprietary binary blobs of pack tools from Allwinner.

$sudo apt-get update
$sudo apt-get upgrade
$sudo apt-get install build-essential u-boot-tools uboot-mkimage
$sudo apt-get install gcc-arm-linux-gnueabihf gcc-arm-linux-gnueabi
$sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev git wget fakeroot kernel-package zlib1g-dev
$sudo apt-get install libncurses5-dev

Getting Source Code

$mkdir /work/my-linux-sdk
$cd /work/my-linux-sdk
$git clone https://github.com/cubieboard/linux-sdk-products.git products
$git clone https://github.com/cubieboard/linux-sdk-tools.git tools
$git clone https://github.com/cubieboard/linux-sdk-binaries.git binaries
$git clone https://github.com/cubieboard/linux-sunxi.git linux-sunxi
$cd linux-sunxi
$git checkout -b ct-sunxi-3.4 origin/ct/sunxi-3.4
$cd -
$cd binaries
$wget http://dl.cubieboard.org/software/a20-cubietruck/ubuntu-14.04/ubuntu-core-14.04-core.ext4.gz
$gunzip ubuntu-core-14.04-core.ext4.gz

Compiling

$source tools/scripts/envsetup.sh
select ct-ubuntu
$cb_build_nand_image

If success, we can get a image file named livesuit_cubieboard3.img at build/ct-ubuntu/pack/


Mike Lowrey

Great job thanks!

Is anyone working on using this for an optimized Cubietruck image?

Blaireau

I tried tu install the prebuild image on my Cubietruck, but I don't have network acces. Any Idea ?

benn

Quote from: Blaireau on May 17, 2014, 09:02:57 pm
I tried tu install the prebuild image on my Cubietruck, but I don't have network acces. Any Idea ?


can you ping google.com ?
If not, try
#dhclient eth0




Art

~$ ifconfig
lo
~$ ifconfig -a
lo and tunl0

eth0 device not found.

ShPioN

Quote from: Art on May 19, 2014, 03:10:58 am

eth0 device not found.

then lsmod should show which modules are loaded.

outlaw

Hi there

i'm not able to flash this prebuild image with Phoenix 1.08
Times out with error

rose28357

May 28, 2014, 04:18:57 am #8 Last Edit: May 28, 2014, 06:23:54 am by rose28357
Quote from: ShPioN on May 19, 2014, 01:41:15 pm
Quote from: Art on May 19, 2014, 03:10:58 am

eth0 device not found.

then lsmod should show which modules are loaded.

You need gmac (if compiled to kernel it will not be shown by lsmod )
and bcmdhd for wireless lan.

Try modprobe bcmdhd.

francismendes

I don't know exactly why, but I tried to follow the steps in the first post on a fresh Ubuntu 12.04 (x86_64) install and was getting the following errors:


-bash: /home/usuario/ct/tools/pack/pctools/a20/linux/fsbuild200/fsbuild: No such file or directory
mv: cannot stat `bootfs.fex': No such file or directory
-bash: /home/usuario/ct/tools/pack/pctools/a20/linux/eDragonEx/dragon: No such file or directory
/home/usuario/ct


Which I solved installing the ia32-libs package:


sudo apt-get install ia32-libs


After this, the image was successfully created:


usuario@ubuntu:~/ct$ ll build/ct-ubuntu/pack/livesuit_cubieboard3.img
-rwxrwxr-x 1 usuario usuario 432722944 Jun 20 18:26 build/ct-ubuntu/pack/livesuit_cubieboard3.img*
usuario@ubuntu:~/ct$

JimmyGogool

Thanks for the sweet tutorial,

everythings works fine, but my image is slightly smaler:

-rwxr-xr-x 1 root root 432574464 Jun 27 17:17 build/ct-ubuntu/pack/livesuit_cubieboard3.img*

and after flashing by livesuit, cubie is not booting.

Any idea?

jobarjo

Hi

Also tested the prebuilt image and can't get the gigabit network to work.

modprobe dmac  doesn't find the module

rose28357

should be modprobe gmac ???
or modeprobe bcmdhd for the CT internal WiFi.

MrDialUp

August 17, 2014, 02:43:40 am #13 Last Edit: August 17, 2014, 09:23:42 am by MrDialUp
Here is how I got eth0 to work with this image.

When it first loads and you do a ifconfig -a, eth0 does not show up in the list because the driver is not loaded.

So you need to load the driver:   modprobe sunxi-gmac

Then you need to edit the /etc/network/interfaces file by ' vi /etc/network/interfaces '  and add the following two lines
auto eth0
iface eth0 inet dhcp

Note:  nano is not available so you have to use vi to edit.  A cheat sheet for vi use is here: http://www.lagmonster.org/docs/vi.html

Then you ' ifconfig eth0 up ' and then ' ifup eth0 ' and you should be good to do a ' sudo apt-get update ' and ' sudo apt-get dist-upgrade '.

You'll need to add the sunxi-gmac module to the modules folder in order for it to load at next boot.  And with this image, you really should transfer rootfs to SATA or microsd right away as you will run out of storage space quickly.


c128

August 23, 2014, 04:29:30 am #14 Last Edit: August 23, 2014, 04:46:27 am by c128
Thanks for this image  :)

Quote from: MrDialUp on August 17, 2014, 02:43:40 am
You'll need to add the sunxi-gmac module to the modules folder in order for it to load at next boot.


I've just used this image as the basis for (what will be) a Cubietruck mail server and hit this too.

For those that see it too, as MrDialUp mentions, you need to open up the "/etc/modules" file and add "sunxi-gmac" to have the wired network available on boot.

Quote from: MrDialUp on August 17, 2014, 02:43:40 am
And with this image, you really should transfer rootfs to SATA or microsd right away as you will run out of storage space quickly.


I used a combination of these nand-part instructions:

http://www.cubieforums.com/index.php?topic=2835.0
http://maruscha.org/content/cubietruck-resize-nand

...to expand the NAND storage out.

I have a further question though - is it possible to transfer this NAND install to SATA SSD?  I followed the relevant bits of the instructions here:

http://gleenders.blogspot.co.uk/2014/06/cubietruck-ubuntu-ssd-install-and-boot.html

...which is based on lubuntu.  Although the SSD itself was fine when using a pure NAND boot, when transferred I ended up with a system that failed to boot on access to the SSD at /dev/sda1, and got stuck in a re-boot cycle.