Howto create a fully working Linaro Sd-card for Cubie 512 or 1GB version with SATA power-activated

瀏覽次數:6,717 次
跳到第一則未讀訊息

Martin Wild

未讀,
2012年12月4日 下午1:00:312012/12/4
收件者:cubie...@googlegroups.com
#This is a full tutorial how to make a booting Cubieboard Linaro SD-card with network SATA and Lightdm .
#This tutorial requires you to have basic linux knowledge and the know-how how to use a shell.
#All done here is tested on an standard 64bit Ubuntu 12.04 (which is the base for the Linaro rootfs).
#All commands in this tutorial can be copied and executed as they are. Choose yourself a working directory ,and stay there
#unless you need cd somewhere else. !BEWARE! when something gets written to your SD-card make sure to change the path to
#YOUR SD-CARD or you will probably loose something..
#I hope i didnt miss something important, but with this here and GOOGLE everyone should make it!

#1.Get an PC, an Cardreader and install Ubuntu 12.04
#First you should install GIT and wget for you will need it for sure...
#So open a terminal , create and cd into your working dir and begin with:

sudo apt-get install git wget

#Createing a booting Linaro (Ubuntu) SDcard to start on cubieboard:
#download the needed automake-tools , the Cubieboard hardwarepack and an Linaro rootfs...

sudo git clone https://github.com/linux-sunxi/sunxi-bsp/
cd sunxi-bsp
sudo wget http://dl.linux-sunxi.org/amery/sunxi-3.0/20121109-1024/cubieboard_hwpack.tar.xz
sudo wget http://releases.linaro.org/latest/ubuntu/precise-images/alip/linaro-precise-alip-20121124-519.tar.gz

#Now we write everything to your SD-Card ,and make sure your SD-Card is /dev/sdc (or change this) because
#EVERYTHING CONTAINING THIS DRIVE WILL BE OVERWRITTEN!!!

sudo ./scripts/sunxi-media-create.sh /dev/sdc cubieboard_hwpack.tar.xz linaro-precise-alip-20121124-519.tar.gz
sudo eject /dev/sdc

#if you have a Cubieboard 512Mb you need a different Hardwarepack. everything else stays the same.

git clone https://github.com/linux-sunxi/sunxi-bsp/
cd sunxi-bsp
wget http://dl.linux-sunxi.org/amery/sunxi-3.0/20121109-1024/cubieboard_512_hwpack.tar.xz
wget http://releases.linaro.org/latest/ubuntu/precise-images/alip/linaro-precise-alip-20121124-519.tar.gz
./scripts/sunxi-media-create.sh /dev/sdc cubieboard_512_hwpack.tar.xz linaro-precise-alip-20121124-519.tar.gz
eject /dev/sdc

#those are Specific hardwarepacks build by amery and an actual standard linaro rootfs,
#which will give you a bootable linaro sdcard with working sata driver, lightdm and activated ssh (user: linaro pass:linaro)
#different linaro rootfs-packs can be found under http://releases.linaro.org/latest/ubuntu/precise-images/


#Howto make SATA work:

#now you need to get bin2fex / fex2bin to convert your script.bin to script.fex to be
#able to edit it..

cd ..
sudo git clone https://github.com/linux-sunxi/sunxi-tools
cd sunxi-tools
sudo make

#now youve got the tools you need.

#copy your script.bin (from the 1. Partition of your sdcard) to a place where you want to edit it
#(lets use sunxi-tools to make it easy )
#now convert script.bin to .fex with

./bin2fex script.bin script.fex

#open script.fex with an texteditor (eg. vi,nano)
#and search for the SATA-Section
#find the line

sata_power_en =

#and change to

sata_power_en = port:PB08<1><default><default><0> 

#save and convert back with

./fex2bin script.fex script.bin

#now just copy back script.bin to your sdcard and start your cubie
#if everything went right the hdd spins now up at boot

#Now make sure the SATA module is loaded

sudo lsmod

#that should bring up among others this line:

sw_ahci_platform

#if not start it manually by doing

sudo modprobe sw_ahci_platform

#or by adding "sw_ahci_platform" permanetly to /etc/modules

#now everything should be ready to use your hdd.

#This should be all to get started. this tutorial should work with other rootfs like Arch / Debian as well as long as they are
#build as HARD-FLOAT!!

Regards , Martin



Alejandro Mery

未讀,
2012年12月4日 下午1:30:332012/12/4
收件者:cubie...@googlegroups.com
Hi.

instead of duplicating/adding tutorials in the mailing list to pinch
them in the forum-ish interface, can't you link the tutorials in the
wiki? There is nothing cubieboard specific beside the choice of the
hwpack. And wiki pages are easier to improve/fix/update than "forum
posts"
please don't point to a particular hwpack in time in tutorials, there
is a `latest` symlink for that. Also there are separated hwpacks for
512 and 1GB models.



> cd ..
> sudo git clone https://github.com/linux-sunxi/sunxi-tools
> cd sunxi-tools
> sudo make

`make tools` should do this for you.

>
> #now youve got the tools you need.
>
> #copy your script.bin (from the 1. Partition of your sdcard) to a place
> where you want to edit it
> #(lets use sunxi-tools to make it easy )
> #now convert script.bin to .fex with
>
> ./bin2fex script.bin script.fex
>
> #open script.fex with an texteditor (eg. vi,nano)
> #and search for the SATA-Section
> #find the line
>
> sata_power_en =
>
> #and change to
>
> sata_power_en = port:PB08<1><default><default><0>

eh? that was fixed a month ago.
https://github.com/linux-sunxi/sunxi-boards/commit/0c60d43c340b0ee5bc0dbef746530877301acd17

and as a general rule documenting bug work-arounds is a bad idea.
documentation needs to be pristine, and bugs fixed in the source.

can you give http://dl.linux-sunxi.org/amery/sunxi-3.0/20121204-1829/
a try? if they work, I'll re-point the symlink. I can't test myself at
the moment.


Thanks,
Alejandro

Roman Mamedov

未讀,
2012年12月4日 下午1:37:532012/12/4
收件者:cubie...@googlegroups.com
On Tue, 4 Dec 2012 10:00:31 -0800 (PST)
Martin Wild <lilc...@gmail.com> wrote:

> #This is a full tutorial how to make a booting Cubieboard Linaro SD-card
> with network SATA and Lightdm .
> #This tutorial requires you to have basic linux knowledge and the know-how
> how to use a shell.

Why not simply publish the SD card image that you created by these steps?

Or perhaps not instead of tutorial, but *in addition* to it, in case some
(hint: most) people don't want to deal with multiple complicated steps (a
tutorial starting with "install Ubuntu 12.04", man that's score 10 out of 10)
just to have their cubieboard boot up with an OS they can use.

It is unfortunate to see a scarcity of ready-to-use images, but plenty of
tutorials, "yadda yadda, git clone this, wget that, sudo make this" (of course
half of the URLs will no longer work and stuff that according to description
should simply compile, actually doesn't, with mysterious errors).

It's like if instead of text editors we had only tutorials everywhere, "well
guys here's how to write your own text editor from scratch, requires only 'ed'
and basic programming language knowledge".
--
With respect,
Roman

~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Stallman had a printer,
with code he could not see.
So he began to tinker,
and set the software free."
signature.asc

Ulisses Montenegro

未讀,
2012年12月4日 下午1:49:492012/12/4
收件者:cubie...@googlegroups.com
AFAICT, the Cubieboard is not a ready-to-use product, and was never meant to be. Just like the Raspberry Pi and the various others ARM/Linux embedded platforms out there, there is no "one size fits all" approach, because some people want headless servers, while others want multimedia and others yet want to use the Cubie for home automation.

You are free to build an image and make it available for anyone else who shares your vision on what they should be running on their Cubies (just remember to check the license of everything bundled in there), but in the long run it's MUCH better to have instructions on how to build your own flavor of Linux/Android based on your needs rather than having to tweak the finished work of someone else...
--
“If debugging is the process of removing software bugs, then programming must be the process of putting them in.” - Edsger Dijkstra

Martin Wild

未讀,
2012年12月4日 下午2:32:462012/12/4
收件者:cubie...@googlegroups.com
Unfortunately i have  no webspace to upload ready-to-use images, and i ask myself for a while why there is not already  such a link on Cubieboard.org. ;)
So i decided to write some startup-help for all the people (like me) who get their Cubieboard and aint got infinite time to search the web before they can start playing around.
this was never an attempt to make an one-size-fits-all solution like RPI but to give a base to build up upon.
Anyways it would be a good thing to have an alternative os than Android (which is also the finished work of someone else) to download on cubieboard.org when i look at all those "systemimage-Posts" in the forum.

(btw: "a tutorial starting with "install Ubuntu 12.04", man that's score 10 out of 10" OK, thats one really big leap for someone only using an Iphone before (lol) , but i never intended to explain someone howto turn on his Computer :-) )






Roman Mamedov

未讀,
2012年12月4日 下午3:48:472012/12/4
收件者:cubie...@googlegroups.com、ulisses.m...@gmail.com
On Tue, 4 Dec 2012 16:49:49 -0200
Ulisses Montenegro <ulisses.m...@gmail.com> wrote:

> AFAICT, the Cubieboard is not a ready-to-use product, and was never meant
> to be. Just like the Raspberry Pi and the various others ARM/Linux embedded
> platforms out there,

Right -- they're meant for hacking, experimentation in embedded programming,
automation, robotics, etc etc etc; and more time would be left for that (aka
the actual interesting stuff) if everyone doesn't have to solve exactly the
same mundane problem of compiling an OS image from scratch.

> You are free to build an image and make it available for anyone else

Which I did :) But targetting mainly the MK802. Of which there's a myriad of
variants (with/without AXP, 512/1024MB RAM, even with differing RAM MHz), so
it's hard to make one that works on all of them, and there in fact I could see
the point of needing to use a 'from scratch' tutorial.

But with the Cubieboard where there's just 2 variants (512 and 1024 MB),
having two ready to use images seems like a no-brainer.

> rather than having to tweak the finished work of someone else...

Afaik most distros have a concept of "base system", Debian certainly does,
Arch too. It is not a finished work but rather a starting point, where barely
anything would be installed besides an SSH server, shell and a package manager.
And from there you could go any direction you want, be it a headless server,
multimedia player or a desktop with Xorg.
signature.asc

Jose Angel López Otero

未讀,
2012年12月4日 下午4:00:102012/12/4
收件者:cubie...@googlegroups.com
Thank you for the info. A few days ago I'm looking for something like this to enable my SATA drive.

Tested on my cubieboard 1GB

Martin Wild

未讀,
2012年12月6日 下午4:35:552012/12/6
收件者:cubie...@googlegroups.com

Hi,

@ Amery

thanks for the advices, ill try and do better next time !

just wanted to say that i gave your pack at http://dl.linux-sunxi.org/amery/sunxi-3.0/20121204-1829/ a try, and it seems everything working
fine. My cubie is right now running with the new build (Welcome to Linaro 12.11 (GNU/Linux 3.0.52 armv7l)) and no issues till now enountered.

Regards, Martin



Alejandro Mery

未讀,
2012年12月6日 下午6:43:512012/12/6
收件者:cubie...@googlegroups.com
On 06/12/12 22:35, Martin Wild wrote:
> @ Amery
>
> thanks for the advices, ill try and do better next time !

and please reply the right mail next time too :)

>
> just wanted to say that i gave your pack at
> http://dl.linux-sunxi.org/amery/sunxi-3.0/20121204-1829/ a try, and it
> seems everything working
> fine. My cubie is right now running with the new build (Welcome to Linaro
> 12.11 (GNU/Linux 3.0.52 armv7l)) and no issues till now enountered.

awesome! "latest" symlink adjusted and made automatic again

Thanks,
Alejandro Mery

Pawel Janowski

未讀,
2012年12月7日 凌晨4:34:312012/12/7
收件者:cubie...@googlegroups.com
Whats is new/fixed with cubieboard_*hwpack.tar.xz     ?

P.
訊息已遭刪除

Alejandro Mery

未讀,
2012年12月18日 凌晨4:31:002012/12/18
收件者:cubie...@googlegroups.com
On 07/12/12 10:34, Pawel Janowski wrote:
> Whats is new/fixed with cubieboard_*hwpack.tar.xz<http://dl.linux-sunxi.org/amery/sunxi-3.0/20121204-1829/cubieboard_hwpack.tar.xz>

there is nothing really hwpack-specific, it uses the default configs of
whatever is new in the linux, u-boot, mali, cedarx and boards repos.

as it's 3.0, updates mostly mean fixes.

Mateusz Mateusz

未讀,
2013年2月9日 上午11:29:472013/2/9
收件者:cubie...@googlegroups.com
Hello,

I tried different quantal snapshots and hwpacks. I'm doing everything as described in the first message. It says it cannot copy some files from rootfs.

My config: Vbox Ubuntu 12.10 amd64

Any ideas?
Thanks.

===
=== Extracting HW Pack ===
===

===
=== Extracting RootFS ===
===

===
=== Copy U-Boot/SPL to SD Card ===
===
20+0 records in
20+0 records out
20480 bytes (20 kB) copied, 0.0911077 s, 225 kB/s
169+1 records in
169+1 records out
173412 bytes (173 kB) copied, 0.598672 s, 290 kB/s
Copy VFAT partition files to SD Card

===
=== Copy rootfs partition files to SD Card ===
===
Linaro rootfs
cp: cannot stat `/tmp/.sunxi-media-create.14897/rootfs/binary/boot/filesystem.dir/*': No such file or directory
Failed to copy rootfs partition data to SD Card

mostafa rahmanzad

未讀,
2013年2月22日 凌晨12:08:122013/2/22
收件者:cubie...@googlegroups.com
i get this error
please help me

--------------------------------------------------------------------------------------------------------------------------------------------------------------
sudo ./scripts/sunxi-media-create.sh /dev/sdb cubieboard_hwpack.tar.xz linaro-precise-alip-20121124-519.tar.gz

===
=== Partitioning /dev/sdb ===
===
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 1.03412 s, 1.0 MB/s
Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 1017 cylinders, 62 heads, 62 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/sdb: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sdb1          2048    133119     131072   c  W95 FAT32 (LBA)
/dev/sdb2        133120   3911679    3778560  83  Linux
/dev/sdb3             0         -          0   0  Empty
/dev/sdb4             0         -          0   0  Empty
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
BLKRRPART: Device or resource busy
This disk is currently in use.
/dev/sdb: failed to reload media
mostafa@mostafa-virtual-machine:~/sunxi-bsp$

Martin Wild

未讀,
2013年2月22日 凌晨2:46:042013/2/22
收件者:cubie...@googlegroups.com
Hi,

Seems your Sdcard is mounted somewhere, and the script cannot unmount it.

Check with "df" where your card is mounted (probably automounted somewhere inside /media/xyz....) unmount it yourself and start the script again.
(Maybe try rebooting. Sometimes Linux does strange things when drives get removed while accessed by a terminal session, and dont respond anymore to umount)

Regards, Martin

steffie....@googlemail.com

未讀,
2013年3月7日 上午9:19:552013/3/7
收件者:cubie...@googlegroups.com
Same Error here. Running Ubuntu 12.10.

Thomas François

未讀,
2013年3月23日 上午11:30:002013/3/23
收件者:cubie...@googlegroups.com
Hi,

when trying: "sudo wget http://releases.linaro.org/latest/ubuntu/precise-images/alip/linaro-precise-alip-20121124-519.tar.gz"

I got the error: ERREUR 404: NOT FOUND.

Is the package still available?

Regards,

Thomas

Pawel Janowski

未讀,
2013年3月23日 上午11:33:352013/3/23
收件者:cubie...@googlegroups.com
try one from these https://releases.linaro.org/latest/ubuntu/quantal-images

P.


--
You received this message because you are subscribed to a topic in the Google Groups "Cubieboard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cubieboard/hKJgJneGVmQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to cubieboard+...@googlegroups.com.
Visit this group at http://groups.google.com/group/cubieboard?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Martin Wild

未讀,
2013年3月23日 下午3:18:382013/3/23
收件者:cubie...@googlegroups.com
If card building fails wih the quantal rootfs use one of the latest Precise roots here:

https://releases.linaro.org/12.11/ubuntu/precise-images

Regards, Martin

ali amiri

未讀,
2013年5月15日 上午10:08:272013/5/15
收件者:cubie...@googlegroups.com
martin I tried your way, but still I get the message mostafa got! unmount my drive and also reset my ubuntu, but still I get the message. If it is important I'm using virtual machine.

Martin Wild

未讀,
2013年5月15日 下午3:06:372013/5/15
收件者:cubie...@googlegroups.com
Hmm,

I dont know how -or if- mostafa solved his problem, so i cannot really help you.
Maybe check your VM-settings how the sdcard gets mounted ,and if your are using some kind of virtual sdcard if it can be mounted/unmounted by the os you are using.
You could also try and use a different virtualisation. (maybe virtualbox, vmware-player or similar), or try some live-linux like ubuntu....




Regards, Martin

Vimal Tank

未讀,
2013年7月4日 晚上8:42:482013/7/4
收件者:cubie...@googlegroups.com
looks like i did wat you have mentioned here, and gives me the sata link is up however i cant see the hdd. . . wat am i doing wrong?

-Vimal Tank

Vimal Tank

未讀,
2013年7月8日 凌晨2:43:002013/7/8
收件者:cubie...@googlegroups.com
Does anybody have an image file for this one, I am stupid I guess I just cant get it working. . .  All I get to the point is where I can see that my sata port is up and can detect the hdd.

In order to get this working, do I need to format my HDD? Coz i am not using a clean hdd! 

-Vimal Tank

On Tuesday, 4 December 2012 23:30:31 UTC+5:30, Martin Wild wrote:
回覆所有人
回覆作者
轉寄
0 則新訊息