Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A13 => Topic started by: ric.rug on October 12, 2012, 04:25:22 PM

Title: Debian on NAND
Post by: ric.rug on October 12, 2012, 04:25:22 PM
Where can I find a tutorial showing how to install Debian on NAND flash?  ::)

Thx!
Title: Re: Debian on NAND
Post by: olimex on October 12, 2012, 04:49:09 PM
there is no such tutorial at the moment, but Dimitar Gamishev managed to do this, so it's matter of time me to go to his place and drink some beer together... errrr write some tutorials together  ;D
Title: Re: Debian on NAND
Post by: ric.rug on October 12, 2012, 06:13:28 PM
May I help you to write some tutorials.... ehmmmm drink some beer? :P
Title: Re: Debian on NAND
Post by: olimex on October 12, 2012, 07:16:56 PM
You are welcome! Every last friday of the month we have Friday Meetings at Olimex http://olimex.wordpress.com/2012/08/28/%D0%BF%D0%B5%D1%82%D1%8A%D1%87%D0%BD%D0%B8-%D1%81%D1%80%D0%B5%D1%89%D0%B8-fridays-meetings-at-olimex/
where we meet customers and friends and talk about electronics, drink beer, play table tennis etc.
Title: Re: Debian on NAND
Post by: ric.rug on November 08, 2012, 01:24:59 PM
Hi, any news about the procedure to boot Debian from NAND?  :'(
Title: Re: Debian on NAND
Post by: subhagato on November 15, 2012, 07:47:36 AM
Hi, Any update on debian on NAND?
Title: Re: Debian on NAND
Post by: olimex on November 15, 2012, 09:10:52 AM
hno (aka Henrik Nordstrom) works on implementing NAND support in uboot, it's not trivial excersise so it takes time as he should take care for the NAND flsh equal wearing
at the moment there is packer tool in A13-SDK pakage and Dimitar Gamishev made NAND Debian image, BUT according to Henrik and Alejandro the A13-SDK is with GPL violating code and we should not touch it nor re-distribute unless we want to be GPL violators too
so please be patient and wait for the NAND flash support in the community Uboot
Title: Re: Debian on NAND
Post by: oldpenguin on February 21, 2013, 06:49:37 PM
Hello.
Any news on Debian on NAND ?
I don't understand why it can't be done.
I've worked with implementations of u-boot in other boards that support mtd devices. The u-boot is autonomous, and can download an image (in ubifs format) using TFTP and program it into nand.
The ubifs and mtd combination then takes care of flash wear leveling and bad block.

Is this the path that was envisaged by Henrik or are there other ways to do this ?
Title: Re: Debian on NAND
Post by: torqu3e on March 08, 2013, 06:18:01 AM
Yes, is there hope of getting linux booting off the nand? I'd be interested in this so that the sd can be for user data only.
Title: Re: Debian on NAND
Post by: ST on March 27, 2013, 02:37:11 PM
+1.

Any updates on this topic? I need it also...

Thank you!
Title: Re: Debian on NAND
Post by: olimex on March 27, 2013, 06:51:52 PM
Linux on NAND is possible and as I wrote Dimitar done it, but it's done with Allwinner's non GPL bootloader, according to Linux-Sunxi community members I spoke with it's not good to release such image as we become GPL violator as well if we do this
I do not follow the progress on the Linux-sunxi uboot NAND support, I have to ask hno
Title: Re: Debian on NAND
Post by: techn on March 27, 2013, 11:36:15 PM
I have been done some updates to sunxi-bsp. Now it should support creating of livesuit images for sun5i/a13 devices. Please test it and give feedback.

Basic guide/info: http://linux-sunxi.org/BSP
I'll update these instructions there after I have finished the work. Current todo list: sun4i/a10 support, update u-boot to specific version of linux-sunxi repository.

# Create kernel
git clone git://github.com/linux-sunxi/sunxi-bsp.git
./configure # to list all currently supported boards
./configure <selected board>
make linux

# Create rootfs
wget <rootfs ie. https://releases.linaro.org/13.02/ubuntu/quantal-images/nano/linaro-quantal-nano-20130224-286.tar.gz>
./scripts/mk_ext4_rootfs.sh <rootfs> rootfs.ext4

# Create livesuit image
./scripts/mk_livesuit_img.sh -R rootfs.ext4




Title: Re: Debian on NAND
Post by: vinifr on March 28, 2013, 04:38:06 AM
https://groups.google.com/forum/?fromgroups=#!topic/linux-sunxi/35AkpQYcXdk (https://groups.google.com/forum/?fromgroups=#!topic/linux-sunxi/35AkpQYcXdk)
Title: Re: Debian on NAND
Post by: HeHoPMaJIeH on March 29, 2013, 12:10:33 PM
http://linux-sunxi.org/Buildroot

Just change config file !
Title: Re: Debian on NAND
Post by: ST on March 31, 2013, 10:09:16 AM
I'll buy one as soon as Olimex puts Debian in NAND :)
Title: Re: Debian on NAND
Post by: hanuch on April 05, 2013, 09:06:38 PM
Hi,

I've been trying the scripts mentioned above, but i have problems with the dragon tool. I've run it both in Ubuntu (linux binary and through Wine) and Windows, but it keeps throwing the same problem: "BuildImage level_2 Failed 444". The problem apparently is in AWPluginvector.dll.

Does anybody have an idea of what's going wrong?

Tranks!
Title: Re: Debian on NAND
Post by: techn on April 06, 2013, 08:15:44 PM
Quote from: hanuch on April 05, 2013, 09:06:38 PM
Hi,

I've been trying the scripts mentioned above, but i have problems with the dragon tool. I've run it both in Ubuntu (linux binary and through Wine) and Windows, but it keeps throwing the same problem: "BuildImage level_2 Failed 444". The problem apparently is in AWPluginvector.dll.

Does anybody have an idea of what's going wrong?

Tranks!
Oh. I forgot to mention that 64bit linux is required.

Updated instructions here: http://linux-sunxi.org/BSP#LiveSuit_image
Title: Re: Debian on NAND
Post by: ST on April 06, 2013, 09:36:26 PM
Olimex, please, comment on whether you plan to add Debian on NAND in some near future?
Thank you.

PS: number of views of this thread is now: 1277 . Looks like a pretty hot feature ;)
Title: Re: Debian on NAND
Post by: JohnS on April 07, 2013, 04:27:47 PM
I've read every post, one by one as gradually added, which adds up to quite a few of the reads.

I don't expect Olimex to provide it.  They make hardware, basically.
Title: Re: Debian on NAND
Post by: ST on April 08, 2013, 12:26:18 PM
I'm not that pessimistic, since at least two Olimex guys - Dimitar Gamishev and Henrik Nordstrom - work on it. The question is - how serious Olimex is about this feature...
Title: Re: Debian on NAND
Post by: JohnS on April 08, 2013, 01:17:02 PM
I'm not pessimistic but trying to be realistic.  Most of the software on their site was provided (donated) by users, as is normal if what you really do is make hardware.
Title: Re: Debian on NAND
Post by: olimex on April 08, 2013, 04:39:29 PM
@ST Dimitar Gamishev and Henrik Nordstrom are not Olimex employees
as John said if we could do this we would already do it :)
I guess you didn't read what I wrote above - thre is solution for generation of Linux on NAND it just do not use GPL compliant but properitary closed source Allwinner bootloader if we release such image we will be GPL violator also, until hno releases community uboot which supports NAND flash you can make the image by yourself as you see people gave you tips above what to do, but you will violate GPL too if you decide to publish or deliver board with it to your customer
Title: Re: Debian on NAND
Post by: oldpenguin on April 09, 2013, 06:27:39 PM
Hello all
I am trying to follow the guide from http://linux-sunxi.org/BSP on a debian machine

I installed linaro gnueabihf toolchain and set the PATH.
I've done
git clone git://github.com/linux-sunxi/sunxi-bsp.git
(actually replaced git: by http: because my stupid corporate proxy doesn't allow git access...)
./configure a13_olinuxino
make
Everything went fine
Then I had to install separately the allwinner tools using instructions from http://http://linux-sunxi.org/LiveSuit
As expected, I had to extract the suite manually.
Back to the sunxi-bsp I did
cd ..
wget https://releases.linaro.org/13.02/ubuntu/quantal-images/nano/linaro-quantal-nano-20130224-286.tar.gz
cd sunxi-bsp
./scripts/mk_ext4_rootfs.sh ../linaro-quantal-nano-20130224-286.tar.gz rootfs.ext4
Then
./scripts/mk_livesuit_img.sh -R rootfs.ext4
This time I had to fiddle around with this script because the base installation is not the same and folder structure has changed.
Rigth now I'm stuck with an error. fsbuild fails with the following error:
../cubie/allwinner-pack-tools/pack/pctools/linux/fsbuild200/fsbuild /home/asc/projects/olinuxino/a13/sunxi-bsp/build/a13_olinuxino_livesuit/bootfs.ini /home/asc/projects/olinuxino/a13/sunxi-bsp/build/a13_olinuxino_livesuit/split_xxxx.fex
fsbuild error. The size if filesystem must more than 80k  now is 32
fsbuild failed 338
CPlugin Free lib
CPlugin Free lib

Any idea of what this means ?

Title: Re: Debian on NAND
Post by: techn on April 09, 2013, 09:46:26 PM
Quote from: oldpenguin on April 09, 2013, 06:27:39 PM
Rigth now I'm stuck with an error. fsbuild fails with the following error:
../cubie/allwinner-pack-tools/pack/pctools/linux/fsbuild200/fsbuild /home/asc/projects/olinuxino/a13/sunxi-bsp/build/a13_olinuxino_livesuit/bootfs.ini /home/asc/projects/olinuxino/a13/sunxi-bsp/build/a13_olinuxino_livesuit/split_xxxx.fex
fsbuild error. The size if filesystem must more than 80k  now is 32
fsbuild failed 338
CPlugin Free lib
CPlugin Free lib

Any idea of what this means ?
Hi, Thanks for testing.
Something went wrong during you fiddled scripts. You should use stuff under ./sunxi-bsp/allwinner-tools/

Everything should work fine if you follow latest guide:
./configure # to list all currently supported boards
./configure <selected board>
make linux # generate kernel and modules
wget <rootfs.tar.gz>
make livesuit ROOTFS=<rootfs.tar.gz>

Title: Re: Debian on NAND
Post by: oldpenguin on April 10, 2013, 12:24:45 PM
Hello techn
Thank you very much for your reply.
For some reason, my first clone had missed the allwinner-tools submodule altogether.
Now instead of a full clone (that takes an eternity) I did:
git checkout -f (overwrites my changes)
git pull
make clean
./configure a13_olinuxino
make
make livesuit ROOTFS=rootfs.ext4
But this last command fails getting a13 default files

Changed LIVESUIT_DIR to SOURCE_DIR in the following lines of mk_livesuit_img.sh
make_sys_configs ${SOURCE_DIR}/default/sys_config_linux.fex
make_boot0_boot1
make_bootfs ${SOURCE_DIR}/default/env_linux.cfg
ln -sv "$ROOTFS" ${BUILD_DIR}/rootfs.fex
modify_image_cfg ${SOURCE_DIR}/default/image_linux.cfg
Now the command completes correctly.
The generated file is in output folder
Now I just have to test it  :)


Title: Re: Debian on NAND
Post by: techn on April 10, 2013, 07:29:27 PM
Quote from: oldpenguin on April 10, 2013, 12:24:45 PM
Changed LIVESUIT_DIR to SOURCE_DIR in the following lines of mk_livesuit_img.sh
I think you have old version of allwinner-tools. https://github.com/linux-sunxi/allwinner-tools/tree/master/livesuit/default
Title: Re: Debian on NAND
Post by: oldpenguin on April 10, 2013, 09:03:49 PM
Strange !
I did
git checkout -f
git pull
And got the script with LIVESUIT_DIR instead of SOURCE_DIR
I'm a git newbie. Maybe I am doing something wrong.
Title: Re: Debian on NAND
Post by: techn on April 10, 2013, 09:08:01 PM
Quote from: oldpenguin on April 10, 2013, 09:03:49 PM
Strange !
I did
git checkout -f
git pull
And got the script with LIVESUIT_DIR instead of SOURCE_DIR
I'm a git newbie. Maybe I am doing something wrong.
You could try 'git submodule update' at root of sunxi-bsp. Or at allwinner-tools 'git fetch' and 'git checkout master'
Title: Re: Debian on NAND
Post by: vinifr on April 10, 2013, 11:39:57 PM
https://groups.google.com/forum/#!topic/linux-sunxi/KJ4YL_NzhWw (https://groups.google.com/forum/#!topic/linux-sunxi/KJ4YL_NzhWw)
Title: Re: Debian on NAND
Post by: oldpenguin on April 15, 2013, 12:38:17 PM
My LiveSuit refuses to load any image:

It keeps saying image is invalid with any image (my image or android image from olimex)

The command line shows the following error when I select an image file:

...@hwdev2:~/projects/olinuxino/a13/Livesuit/LiveSuit_For_Linux64/LiveSuit$ ./LiveSuit.sh
You are running on Debian
Load /home/asc/projects/olinuxino/a13/Livesuit/LiveSuit_For_Linux64/LiveSuit/bin/tools.scj failed
LoadTools, LoadToolsPlug failed 203
...@hwdev2:~/projects/olinuxino/a13/Livesuit/LiveSuit_For_Linux64/LiveSuit$

Any idea of what problem this can be ?
Title: Re: Debian on NAND
Post by: oldpenguin on April 15, 2013, 01:22:58 PM
oops  :(
Looks like an old problem

https://www.olimex.com/forum/index.php?topic=538.msg2550#msg2550

I've made it so far and now I can't  program the damned image !
I don't have access to Win7 64 bits.
Any ideas ?

BTW why do they use Windows so much in China ?
Title: Re: Debian on NAND
Post by: oldpenguin on April 15, 2013, 08:25:17 PM
Update !
I resorted to an old faithfull win XP and managed to program the flash
(Driver installed, start livesuit, start board in fel mode and SysUpdate. The sw makes lots of comments about deleting essential files on flash. I just answered yes to everything)

Linux boots ups !

And now the bad surprise: /lib folder is empty ! So the system is isolated from the world and I have no way to put anything inside.

I checked and confirm that a13_olinuxino_hwpack has been created with correct rootfs under sunxi-bsp, but rootfs.ext4 /lib is empty. Don't known why it hasn't been copied.

Time to retry.
Title: Re: Debian on NAND
Post by: olimex on April 16, 2013, 08:24:41 PM
we have some progress today with the help of HEHOPMAJIEH :)
tomorrow if we are lucky will have Debian XFCE4 image which could be burned to A13-OLinuXino-WIFI NAND
Title: Re: Debian on NAND
Post by: oldpenguin on April 16, 2013, 08:56:54 PM
That would be fantastic !
I did manage to generate and program images, but I am struggling with all kind of difficulties.
First I have to manually populate the rootfs.ext4 with kernel modules and call make hwpack after.
Then I tried to activate the 4.3" LCD. Changed the a13_olinuxino.fex and called make livesuit ROOTFS=rootfs.ext4 but it didn't solve. The only way it worked was booting up, mount the nanda partition and change both script.bin and script0.bin
Finally I ended up with a very small root partition (347MB). I also have a nandd partition that is not mountable.
I will have to dig further into the scripts to check if there is some way to changed the partitions size.
But if a pre-built image is available, I will be very happy.


Title: Re: Debian on NAND
Post by: techn on April 16, 2013, 10:50:51 PM
Quote from: oldpenguin on April 15, 2013, 08:25:17 PM
And now the bad surprise: /lib folder is empty ! So the system is isolated from the world and I have no way to put anything inside.

I checked and confirm that a13_olinuxino_hwpack has been created with correct rootfs under sunxi-bsp, but rootfs.ext4 /lib is empty. Don't known why it hasn't been copied.
This sounds like that you are booting to initfs.

Quote from: oldpenguin on April 16, 2013, 08:56:54 PM
called make livesuit ROOTFS=rootfs.ext4 but it didn't solve
Currently it doesn't support .ext4 extension but gzipped rootfs. I'll try to add support for ext4 too.
Title: Re: Debian on NAND
Post by: oldpenguin on April 17, 2013, 11:23:57 AM
Hi techn
Quote from: techn on April 16, 2013, 10:50:51 PM
Quote from: oldpenguin on April 15, 2013, 08:25:17 PM
And now the bad surprise: /lib folder is empty ! So the system is isolated from the world and I have no way to put anything inside.

I checked and confirm that a13_olinuxino_hwpack has been created with correct rootfs under sunxi-bsp, but rootfs.ext4 /lib is empty. Don't known why it hasn't been copied.
This sounds like that you are booting to initfs.
I dont't think so. If I populate my rootfs.ext4 manually, this information will appear in the generated image. I'm just complaining that the lib/modules directory is not being copied automatically.

Quote from: techn on April 16, 2013, 10:50:51 PM
Quote from: oldpenguin on April 16, 2013, 08:56:54 PM
called make livesuit ROOTFS=rootfs.ext4 but it didn't solve
Currently it doesn't support .ext4 extension but gzipped rootfs. I'll try to add support for ext4 too.
I managed to changed the rootfs partition size modifying allwinner-tools/livesuit/a13/default/sys_config_linux.fex
Unfortunately, after boot, the partition size always reports 347M (with df -h), although fdisk -l reports the correct size.
Title: Re: Debian on NAND
Post by: techn on April 17, 2013, 07:36:00 PM
Quote from: oldpenguin on April 17, 2013, 11:23:57 AM
I dont't think so. If I populate my rootfs.ext4 manually, this information will appear in the generated image. I'm just complaining that the lib/modules directory is not being copied automatically.
Didn't notice that part on your post :)
You are right. lib/modules isn't copied there automaticly. modules are located in fat partition.
I did this on purpose. Plan was to add symbolic link from fat partition to to rootfs. That way you don't need to modify rootfs partition everytime you update kernel.

But suggestion welcome :)

Quote from: oldpenguin on April 17, 2013, 11:23:57 AM
I managed to changed the rootfs partition size modifying allwinner-tools/livesuit/a13/default/sys_config_linux.fex
Unfortunately, after boot, the partition size always reports 347M (with df -h), although fdisk -l reports the correct size.
347M most likely comes from rootfs.ext4 size. Maybe there is way to make partition larger without increasing file size. Patches welcome. :)

Btw. I noticed that Ithamar is proceeding with OSS packing tools. Maybe soon we will get replacement.
https://github.com/Ithamar/awutils
Title: Re: Debian on NAND
Post by: usernaME on November 18, 2013, 05:17:15 PM
Hi, what about Debian on NAND??? some good news?
Title: Re: Debian on NAND
Post by: oldpenguin on November 18, 2013, 07:59:04 PM
Unfortunately no

I confirmed a few days ago that mtd drivers are still in experimental state in u-boot and kernel.

So, there is still no reliable way of running something from NAND flash.

It sure works if you just want to play with it. I've been running debian on flash for months, but I won't even try to put something like that in production.

Title: Re: Debian on NAND
Post by: Neksn on March 29, 2015, 06:36:04 PM
Hello,

this post was no update almost 2 years, I want know is there any update or solution for Linux on NAND?

Thank you

Neksn