Upgrading Cubian to the Latest Debian on Allwinner A10 / A20

    Under cat 3 scripts that allow you to upgrade Cubian (distribution for boards on Allwinner A10 / A20) to the current version of Debian.
    After executing all the scripts, the current version of Debian will be installed.



    Scripts were tested on a board with Soc Allwinner A10. Update from the version of Cubian-nano-x1-a10-hdmi to Debian 8.3 (relevant at the time of the end of the article). With minimal changes (or maybe without them) should work on the A20. Cubian
    distributions are designed for boards based on Soc Allwinner A10 / A20 . Cubian X1
    distributionOct 08, 2014 was released. It has not been updated since. Available for download through the official torrent (which does not always work, so it is available on the Yandex disk ).
    At its core, Cubian is Debian with a bootloader, settings and scripts specific to Allwinner, in particular for Cubian boards. In principle, all the boards on the A10 / A20 are similar and repeat the reference circuit - there is nothing special to invent / change there.
    To keep the OS and packages up to date (this greatly reduces the cost of preparing and supporting our firmware), you need to thoroughly understand the features of SoC to form a bootloader and manage the entire peripheral. This has already been done by the Cubian distribution team.
    But Cubian is a bit outdated.
    Scripts were created to upgrade sequentially from Cubian to the latest version of Debian with minimal user intervention.
    The scripts were tested on the Allwinner A10 on the DS-110 board , which is almost an analogue of CubieBoard .

    Update Order

    .
    Download Cubian-nano-x1-a10-hdmi.7z, unzip and write the image to a microSD card (for example, using sourceforge.net/projects/win32diskimager ). Just a 2GB card is enough for work, if you plan to develop for Debian - 4 or 8 GB.
    We insert the received card into the board, turn it on. We are waiting for the download to finish.
    Change the password if necessary. The default password is “cubie”.
    Initially, the ip address is obtained by dhcp. You can find out the address on the dhcp server or by logging in to the console (name "cubie", password "cubie").
    The original Cubiebiard board will show its address with a Morse code blinking LED, more on github.com/cubieplayer/Cubian/wiki/Get-started-with-Cubian
    To update this ip address must have access to the Internet.
    We are connected via ssh, port 36000.
    Initially, we have
    cubie@Cubian:~$ cat /etc/*release*
    PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
    NAME="Debian GNU/Linux"
    VERSION_ID="7"
    VERSION="7 (wheezy)"
    ID=debian
    ANSI_COLOR="1;31"
    HOME_URL="http://www.debian.org/"
    SUPPORT_URL="http://www.debian.org/support/"
    BUG_REPORT_URL="http://bugs.debian.org/"

    Preparing to run scripts.
    Install git (pre-setting the time and updating the repositories)
    sudo ntpdate-debian
    sudo apt-get -y install debian-keyring
    sudo apt-get update
    sudo apt-get -y install debian-archive-keyring
    sudo apt-get update	
    sudo apt-get install -y git

    Download update scripts
    git clone https://opensourceclient@bitbucket.org/opensourceclient/prepare-cubian.git

    First script:


    adds convenience (.nanorc, .bashr files), sets the frequency limit (via cpufrequtils), redirects logs to a ram-disk, disables IPv6.
    ./prepare-cubian/cubian_update-1.sh

    The board will be turned off.

    Second script:


    ./prepare-cubian/cubian_update-2.sh

    removes unused packages, adds localization (you need to select the keyboard layout and switching method, choose a font for the console and so on several times), update packages to current versions The
    board will be turned off.

    Third script:


    ./prepare-cubian/cubian_update-3.sh

    upgrades the Debian distribution to the latest version, the kernel remains the same.
    When updating udevil - answer yes.
    The cubian-nandinstall package will also be installed - it is one for A10 / A20 (https://github.com/cubieplayer/Cubian/wiki/Install-Cubian) allows you to copy the contents of the sd card to NAND (if the board has NAND) and in the future boot from NAND.
    The scripts from Cubian (cubian-morsedecode, cubian-morsemsg, cubian-morseshowip-reversed, cubian-networklight, cubian-getip, cubian-morseencode, cubian-morseshowip, cubian-motd-package, cubian-ntpdate) are in / usr / lib / cubian /. From the names, the purpose is clear.
    The board will be turned off.

    As a result, we have


    cubie@Cubian:~ $ cat /etc/*release*
    PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
    NAME="Debian GNU/Linux"
    VERSION_ID="8"
    VERSION="8 (jessie)"
    ID=debian
    HOME_URL="http://www.debian.org/"
    SUPPORT_URL="http://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"


    It is worth saving the image of the SD card as a "reference".

    A few more words


    An important part of Cubian is the cubian-nandinstall package - it allows you to copy an SD card image from a card to NAND. The package itself will install the bootloader on NAND and provide boot from NAND.
    A little bit about SoC Allwiner A10 / A20
    The order of loading SoC Allwiner A10 / A20:
    - if there is an SD card - boot from the SD card, this mode is a recovery mode, you can always boot from the standard image of the SD card.
    - if there is no card, try to boot from NAND.
    - As a rule, uboot is used as a bootloader, which allows you to make a bootloader for further downloading over the network.
    SoC Allwiner A10 / A20 does not have a fixed mac address. Mac address is assigned when the OS boots.
    Video parameters, network settings, GPIO (there are 67 pieces in cubieboard) are configured through the file /boot/script.bin (more linux-sunxi.org/Manual_build_howto ).

    The shell for use as an RDP terminal client is precisely applicable on our board (DS-110).
    It will probably work on other boards on the A10 / A20.
    The following scripts are independent of each other.

    For our board to work (link) as a thin client, you need to run a script


    prepare-cubian/cubian_update-customize.sh

    the necessary packages will be delivered, the console settings made, the shell installed, the specially compiled FreeRDP package the board will be turned off.

    A script is used to update the kernel


    prepare-cubian/cubian_update-kernel.sh

    You can connect to our board to the console through the COM port (USB-toCOM, ttl adapter), port parameters 115200/8-N-1.

    Install development tools


    prepare-cubian/cubian_update-development.sh


    Also popular now: