Author Topic: How to build ubuntu 14.04 core Nand Image  (Read 22801 times)

Offline benn

  • Newbie
  • *
  • Posts: 40
  • Karma: +4/-0
    • View Profile
How to build ubuntu 14.04 core Nand Image
« on: May 14, 2014, 06:46:49 am »
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/
« Last Edit: May 14, 2014, 07:12:41 am by benn »

Offline actkk2000

  • Hero Member
  • *****
  • Posts: 571
  • Karma: +2/-11
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #1 on: May 14, 2014, 09:26:30 am »
Great job thx! [emoji4]

Offline Mike Lowrey

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #2 on: May 15, 2014, 05:15:47 am »
Great job thanks!

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

Offline Blaireau

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #3 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 ?

Offline benn

  • Newbie
  • *
  • Posts: 40
  • Karma: +4/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #4 on: May 18, 2014, 08:49:26 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




Offline Art

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #5 on: May 19, 2014, 03:10:58 am »
~$ ifconfig
lo
~$ ifconfig -a
lo and tunl0

eth0 device not found.

Offline ShPioN

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #6 on: May 19, 2014, 01:41:15 pm »

eth0 device not found.
then lsmod should show which modules are loaded.

outlaw

  • Guest
Re: How to build ubuntu 14.04 core Nand Image
« Reply #7 on: May 26, 2014, 07:01:51 am »
Hi there

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

Offline rose28357

  • Hero Member
  • *****
  • Posts: 567
  • Karma: +28/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #8 on: May 28, 2014, 04:18:57 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.
« Last Edit: May 28, 2014, 06:23:54 am by rose28357 »

Offline francismendes

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #9 on: June 20, 2014, 05:47:22 pm »
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$

Offline JimmyGogool

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #10 on: June 27, 2014, 11:31:31 am »
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?

Offline jobarjo

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #11 on: August 11, 2014, 06:29:47 am »
Hi

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

modprobe dmac  doesn't find the module

Offline rose28357

  • Hero Member
  • *****
  • Posts: 567
  • Karma: +28/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #12 on: August 11, 2014, 07:30:03 am »
should be modprobe gmac ???
or modeprobe bcmdhd for the CT internal WiFi.

Offline MrDialUp

  • Newbie
  • *
  • Posts: 23
  • Karma: +3/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #13 on: August 17, 2014, 02:43:40 am »
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.

« Last Edit: August 17, 2014, 09:23:42 am by MrDialUp »

Offline c128

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: How to build ubuntu 14.04 core Nand Image
« Reply #14 on: August 23, 2014, 04:29:30 am »
Thanks for this image  :)

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.

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.
« Last Edit: August 23, 2014, 04:46:27 am by c128 »