Jump to content

Cubietruck: Boot to SATA (via NAND)


JacksGT

Recommended Posts

Hi (and happy new year everyone!),

 

I recently put a SSD in my Cubietruck and installed the Cubietruck Vanilla Image (with Kernel 4.x) on it.

This is working fine, but what bugs me is the fact that I still need to have a microSD-card installed.

 

As far as I understood, the bootloader cannot directly boot to SATA (missing drivers). How does the bare Image on the microSD-card achieve this?

And even more important: How can I move the 'important' part (which does the bootloading and SATA drivers) to NAND so I can boot without a microSD-card installed?

 

Thanks in advance!

Link to comment
Share on other sites

Here is what I have so far:

- a working system with Kernel 3.4 on NAND

- a working system with Kernel 4.x on SATA (SSD)

 

I can boot into the NAND system without an sdcard and it does see the SSD.

But how do I tell the NAND system to run the system on the SSD? (InitRamDisk?)

Link to comment
Share on other sites

Kernel 4.x does not support NAND ... but in theory it could be possible to load recent u-boot even it does not have NAND support. Recent uboot support booting directly from SATA. It might work but since I haven't try this, I can't tell you how.

Link to comment
Share on other sites

Kernel 4.x does not support NAND

I know, I don't need to be able to read/write from NAND on the the second system (SSD) once it is booted.

 

I thought this is possible because the documentation says under "How to install to NAND, SATA & USB?":

You can create up to three scenarios:

  • boot from SD, system on SATA / USB
  • boot from NAND, system on NAND
  • boot from NAND, system on SATA / USB

[1] http://www.armbian.com/documentation/

 

EDIT:

Maybe to clarify my question:

What does the (Vanilla) SD-Card image [2] do to boot from SATA and how can I duplicate this behaviour on NAND?

 

[2] http://mirror.igorpecovnik.com/Armbian_4.5_Cubietruck_Debian_jessie_4.2.3.zip

Link to comment
Share on other sites

What I tried now was exchanging "nand_root=/dev/nand2" with "nand_root=/dev/sda1" in the /boot/uEnv.txt on /dev/nand1.

It did definitely work (identified by hostname), however it complains about missing kernel modules (e.g. not being able to type any input, but ethernet was working).

 

Could you tell me what happens on the SD-card when I run sata-install (Vanilla kernel)? Because afterwards the SD-card obviously only boots to SATA (if present), whereas before it launches its own OS.

Link to comment
Share on other sites

Could you tell me what happens on the SD-card when I run sata-install 

 

https://github.com/igorpecovnik/lib/blob/master/scripts/nand-sata-install/usr/lib/nand-sata-install/nand-sata-install.sh

Check the script. What you are trying to accomplish is more complex than understanding this. I can answer to any "why" from the script but I can't tell you how to boot vanilla kernel with help from NAND. If I had that answer it would already be in the script.

Link to comment
Share on other sites

https://github.com/igorpecovnik/lib/blob/master/scripts/nand-sata-install/usr/lib/nand-sata-install/nand-sata-install.sh

Check the script. What you are trying to accomplish is more complex than understanding this. I can answer to any "why" from the script but I can't tell you how to boot vanilla kernel with help from NAND. If I had that answer it would already be in the script.

I have seen that script online, but it is not the same as on the most recent version of the Cubietruck Vanilla image.

https://paste.teknik.io/2664

 

But I managed to find what I was looking for:

# if we have boot script
if [ -f /boot/boot.cmd ]; then
    sed -e 's,root=\/dev\/mmcblk0p.,root=/dev/'"$DESTPART"',g' -i /boot/boot.cmd
    mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
fi

Which basically translates to "in /boot/boot.cmd set root=/dev/sda" (and then update the image)

 

If I understand correctly, the hardware could (theoretically) read a bootloader from NAND, right?

Couldn't I then just copy the SD-card image onto NAND?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines