Linaro running from NAND


Home Forums Single board computers Cubieboard Linaro running from NAND

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3004
    PMB
    Keymaster

    These are just a series of notes I am making as a reference.
    .
    I got the Cubieboard-1 because it had a SATA port and I wanted to experiment with a server. I definitely don’t need it to run Android. So the first thing to do was install a Linux distro to NAND.
    Looking at the Cubieboard main site, the options for the V1 board are now limited. The server image link popped up a “no longer available” message. so I downloaded the Linaro desktop version.
    .
    PC Tools for working with these ARM boards are absolute shit.
    .
    The only option for Linux was 64bit, so that was out. For Windows the option was PhoenixSuit (PS). Since I still have the old Win-XP dual boot on a laptop, I downloaded it. I had to de-rar the download on the Linux computer and copy the folder over to Windows; no problem via the network.
    There are no sensible instruction so I ran the PS, and had all sorts of driver issues. Then I allowed it to update (.07 to .08) and it installed drivers. But that wasn’t the end of it. PS still complained and windows driver messages kept popping up. PS always fails to recognize the Cubieboard. You have to select an image file (also unzipped on Linux – windows sucks) and then with a lot of apparently random restarting of PS and rebooting the Cubieboard (with button pressed), it eventually asked to install the drivers (again), following which it asked about a re-format (I said yes) and it just worked, taking several minutes to install.
    Some mention that reformat is not a good idea. I found that the re-flash failed unless I re-formatted.
    .
    After working on Linaro for a while via SSH I managed to lock i t up. Out with the keyboard, mouse and HDMI monitor. But no luck. It would not boot with a display; just through the text list then to a blank screen. Stuff this; re-flash time – repeat the PhoenixSuit BullShit.
    .
    Questions:
    1. what is the wear-and-tear on the NAND running something like a Linux mail-server?
    2. would it be better to run the the whole thing from the SATA device and leave the NAND image as a backup?
    .
    http://www.bango29.com/cubieboard-part-3-sata-install-with-cubian/
    $ dd if=Cubian-base-r7-arm-a10.img of=/dev/mmcblk0 bs=4096
    $ sync
    $ reboot

    #3007
    PMB
    Keymaster

    Installing and Setup
    .
    After a fresh re-flash.
    Linaro. Username “linaro”, PW “linaro”.
    SSH in and you get these two messages:
    chmod: changing permissions of `/dev/disp’: Operation not permitted
    chmod: changing permissions of `/dev/cedar_dev’: Operation not permitted
    .
    .
    $ locale -a ; produces error messages ?
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    Solution:
    $ sudo locale-gen en_NZ.UTF-8 ; generate missing locale files
    .
    To change locale: ; takes effect after next login
    $ locale -a ; will display available locales (can generate more if needed)
    $ sudo nano /etc/default/locale
    LC_ALL=en_US.UTF-8
    LANG=en_US.UTF-8
    .
    This build based on Ubuntu Quantal Quetzal (12.10)
    Support for Ubuntu 12.10 Quantal Quetzal officially ended on May 16, 2014.
    note: Trusty Tahr = 14.04
    $ sudo apt-get update ; some errors : Some index files failed to download
    .
    Err http://ports.ubuntu.com quantal/main Sources 404 Not Found
    Err http://ports.ubuntu.com quantal/universe Sources 404 Not Found
    Err http://ports.ubuntu.com quantal/main armhf Packages 404 Not Found
    Err http://ports.ubuntu.com quantal/universe armhf Packages 404 Not Found

    W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/quantal/main/source/Sources 404 Not Found
    W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/quantal/universe/source/Sources 404 Not Found
    W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/quantal/main/binary-armhf/Packages 404 Not Found
    W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/quantal/universe/binary-armhf/Packages 404 Not Found
    .
    I did this: (follow the sequence)
    $ sudo apt-get install mc ; failed, errors, not found….. 🙁
    $ sudo nano /etc/apt/sources.list ; add precise (2 lines)
    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ sudo nano /etc/apt/sources.list ; # out quantal (2 lines)
    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ sudo apt-get install mc ; worked OK this time 🙂
    .
    .
    Update users and passwords
    Change the root password:
    $ sudo passwd root ; enter and confirm a new password
    Change the default linaro user password:
    $ sudo passwd linaro ; enter and confirm a new password
    Create new user:
    $ sudo adduser paul ; enter details when prompted, will ask for password
    $ sudo passwd paul ; to change PW if not already set up.
    $ sudo apt-get install mc ; install mc (midnight commander)
    $ sudo apt-get install htop ; install htop
    make user home dir and chown
    $ sudo usermod -a -G admin paul ; example to add user to existing group
    $ id linaro ; reports user info
    $ groups linaro ; reports groups containing user linaro
    Add user to the sudoers file.
    $ sudo adduser sudo
    .
    Change SSH setup
    $ sudo nano /etc/ssh/sshd_config ; change permitrootlogin to no, change port number
    .
    Set hostname in etc/hostname (mail2) and in etc/hosts (mail2.rcbeacon.com mail2)
    . FQDN = mail2.rcbeacon.com
    $ hostname ; display hostname
    $ hostname -f ; display FQDN
    .
    Fixed IP
    $ sudo nano /etc/network/interfaces
    iface eth0 inet static
    address 192.168.1.20
    netmask 255.255.255.0
    gateway 192.168.1.10
    Nameserver
    $ sudo nano /etc/resolv.conf
    nameserver 192.168.1.10
    .
    SATA – to activate at boot ; should already be active
    $ sudo echo “sw_ahci_platform” >> /etc/modules
    SATA drive appears at /dev/sda, sda1 etc.
    $ sudo mkfs -t ext4 /dev/sda1 ; this will format the drive
    Mount before use:
    $ sudo mkdir /media/sdd1
    $ sudo mount /dev/sda1 /media/sdd1 ; to manually mount
    Add to fstab
    $ sudo blkid /dev/sda1 ; to determin UUID
    $ sudo nano /etc/fstab
    UUID=43ce92c0-cf57-4252-b4de-63826a9fbd74 /media/sdd1 ext4 noatime,errors=remount-ro 0 2
    .
    About time for a reboot
    $ sudo reboot
    .
    How to duplicate the NAND image to the SATA drive:
    $ dd if=/dev/nandb of=/dev/sda1 bs=1M
    $ sync
    .
    LAMP install
    $ sudo apt-get install apache2
    Suggested packages: apache2-doc apache2-suexec apache2-suexec-custom ufw
    Recommended packages: ssl-cert
    $ sudo apt-get install mysql-server mysql-client libapache2-mod-auth-mysql php5-mysql
    Suggested packages: libterm-readkey-perl tinyca mailx php5-suhosin php-pear
    Recommended packages: libhtml-template-perl
    ; Gets stuck here: Setting up mysql-server-5.5 (5.5.27-0ubuntu2) …
    login with another window and : $ sudo stop mysql ; stops the restart loop and allows install to complete
    Can’t find a solution to this; file /var/run/mysqld/mysqld.sock is missing
    NOTE:
    Prior to above mentioned quantal-to-precise sources change:
    Useful install ends here…
    After the above mentioned quantal-to-precise sources change:
    Install completes but reports:
    Errors were encountered while processing:
    mysql-server-5.5
    mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1).
    Still missing = /var/run/mysqld/mysqld.sock
    .
    $ sudo service mysql start
    $ dmesg
    $ service mysql status
    .
    So, where to now ????
    ——————————————————————————
    .
    $ sudo mysql_install_db
    error: ???
    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
    try this:
    $ cd /etc/init.d/
    $ mysqld_safe

    $ sudo /usr/bin/mysql_secure_installation
    $ sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
    $ sudo nano /etc/apache2/mods-enabled/dir.conf
    Add index.php to the beginning of index files.
    $ apt-cache search php5- ; list modules that can be installed
    $ sudo apt-get install name of the module
    .
    sudo service apache2 restart
    .
    $ sudo nano /var/www/test_file.php

    To test it browse to: 192.168.1.??/test_file.php
    .
    ——————————————————————————————————-
    ——————————————————————————————————-
    Ref. for LAMP install:
    https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu
    .
    Note:
    $ sudo apt-get install mysql-server mysql-client php5-mysql ; will prompt for root PW
    Or root PW can be set later on like this
    $ mysql -u root
    mysql> USE mysql;
    mysql> UPDATE user SET Password=<your password> WHERE user=”root”;
    mysql> FLUSH PRIVILEGES;
    .
    $ sudo apt-get install phpmyadmin
    Test by browsing to: 192.168.1.??/phpmyadmin
    .
    Fully qualified domain name error notes:
    $ sudo nano /etc/hosts
    1.1 mail.pmb.co.nz mail
    .
    Ref:
    https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu
    .
    NOTES: and old-info.
    .
    View log file:
    $ tail -f /var/log/syslog
    Find a file:
    $ sudo find / -type s | grep mysqld.sock
    .
    or
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = “en_US.utf8”,
    LANG = “en_NZ.UTF-8″
    are supported and installed on your system.
    $ sudo locale-gen fr_FR.UTF-8 ; generate locale
    $ locale -a ; show available locales
    $ locale ; get current locale info
    $ export LANG=en_NZ.utf8
    $ export LANG=”en_NZ.utf8”
    $ sudo nano /etc/default/locale ; add the line “LANG=”en_NZ.UTF-8″”
    .
    /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
    /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
    .
    update: to solve this problem ?? : NOTE: there are many versions of how to solve this problem.
    $ sudo locale-gen en_NZ.UTF-8 ; generate missing locale files
    $ sudo locale-gen en_US.UTF-8 ; generate missing locale files
    $ sudo dpkg-reconfigure locales ; .
    and/or add to the file /etc/environment
    LC_ALL=C
    and/or add to the file /etc/default/locale ; not sure which will work:
    LC_ALL=en_NZ.UTF-8
    LANG=en_NZ.UTF-8
    .
    .
    $ sudo apt-get update ; This returned problems:
    E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
    .
    .

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.