SD-cards are not created equal. Some makes and models of cards work better than others, and some don't seem to want to work at all. The best cards for the Pine64 seem to be Samsung EVO brand ones. I have tried many others, and while they work most of the time, there are many problems with the machine not booting properly with them: it gets going and then some kernel timeout is evident when loading network or some other drivers. This whole issue is slightly mysterious, since these same cards work fine elsewhere, notably in Raspberry Pi units. It likely has something to do with timing.
Setting up the card is quite easy: download the compressed image file, then uncompress or unzip it. Then write the .img file to the SD card.
When the SD-card in its adapter is plugged into the writer machine, it will appear as /dev/sdb or similar. Use fdisk -l to see which one it is: you don't want to write to disk unit holding the operating system, and it isn't very useful, though easier to undo, to end up with a copy of the image file stored in the /dev directory either!
Many Linux systems automount the partitions on this card on insertion, and at least that helps with determining which device it is. These partitions show up as /dev/sdb1, /dev/sdb2 and so on, for as many partions are present. fdisk -l also will show these. These partitions must be unmounted before being written, since the writing does replace any file systems that might have been there before. By the same token, there is no need to format the card prior to writing. Once the device is determined, write the image file using something like
dd if=pine64-something-linux.img bs=4M of=/dev/sdb
Block size 4M is much more efficient than the default size of 512 bytes (or 0.000512 MB). Once the card is written it can be checked with fdisk -l and even mounted, and the files of the boot and root partitions should be easy to find on the card. Some versions of Linux use two partitions (boot and root), others use only one, yet others may use five or seven, of which not all of them contain real file systems. Whichever applies, if dd was successful and fdisk -l now shows one or more partitions in the relevant /dev/sdb or other volume, we are good to go: Put the card into the SD-card holder. Connect keyboard, mouse, and genuine hdmi monitor, or if we want to see the whole boot-up process, connect a serial terminal to UART0, and power on.
The voltages on the gpios are 3.3V so most of the usb-serial cables with pin-sockets at the end will work fine. RS-232 level voltages have to be translated using a MAX3232 or similar before being connected to the Pine.
UART0 is found on the Expansion port: Pin X7 is Tx from Pine, Pin X8 is RX into Pine, Pins X6 or X9 are Ground. This UART operates at 115200 Baud during boot, so an old glass-tty will probably not be up to the job. Any PC or even another Pine running picocom, or similar will do well. I've had some mysterious problems with minicom not transmitting on some of the USB-Serial devices here, while picocom just works.
See the page on UARTs for more details. There are 6 UARTs on the Pine, of which 5 work right away.
The rest of this section is like a buffet, use what seems useful and disregard the rest.
sudo password is the same as for login (password). Once having been able to log-in as pine64user, or debian, next is to update and get things going.
This is also useful in order to upgrade the system to the latest (and presumably greatest) later on.
sudo su - apt-get install -f resize_rootfs.sh pine64_update_uboot.sh pine64_update_kernel.sh reboot
Then after reboot, get some various necessary items in (such as the vim editor!):
apt-get update apt-get upgrade apt-get install vim
One or more of general Documentation, manual pages, and kernel-dev is also nice to have
apt-get install manpages manpages-dev linux-manual-3.16 apt-get install glibc-doc glibc-doc-reference
For sound, a bug-fix said to get rid of the pulseaudio and put regular alsa in there instead. But there is no pulseaudio to be removed, so I just tried the rest of the recipe:
apt-get install alsa-base alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0
However, it seems to be sufficient with just the libasound2 packages for the recording-loop program.
apt-get install libasound2-dev libasound2-doc
May set EDITOR=vi and use visudo to edit and add
pine64user ALL=(ALL) NOPASSWD: ALL
In order to upgrade the system to the latest on, similar commands as were used initially are done, after having put the following into /etc/apt/sources.list:
deb http://ftp.us.debian.org/debian jessie main contrib non-free deb-src http://ftp.us.debian.org/debian jessie main contrib non-free deb http://security.debian.org/ jessie/updates main contrib non-free deb-src http://security.debian.org/ jessie/updates main contrib non-free deb http://ftp.us.debian.org/debian jessie-updates main contrib non-free deb-src http://ftp.us.debian.org/debian jessie-updates main contrib non-free deb http://httpredir.debian.org/debian jessie-backports main contrib non-free
(But in the installations since 2016-08 sometime, these are already present)
2017-10-01: this all applied to the older longsleep Jessie systems kernels. With the more recent work done by ayufan, the update scripts take arguments, indicating the edition or version to be used, something like this for 0.7.19. Check https://github.com/ayufan-pine64/linux-build/releases for the latest info on this.
pine64_update_uboot.sh 0.7.19 pine64_update_kernel.sh 0.7.19 pine64_update_package.sh 0.7.19 reboot apt update apt upgrade apt dist-upgrade
Some Other things that may be of interest, as some of the recent installations don't have all the desired things in them:
apt install binutils less file apt install man-db manpages manpages-dev apt install i2c-tools libi2c-dev python-smbus apt install libasound2-dev libasound2-doc apt install sqlite3 libsqlite3-dev sqlite3-doc apt install zlib1g-dev apt install libX11-dev libxcb-doc apt install gnuplot apt install ntp apt install bc apt install wavemon
I have also tried some of the newer 4.13 kernel distributions, but while these work well for simple things, the gpios, uarts, and i2c are not supported here, making this rather less useful. Not even sysfs; so only /dev/mem or kernel modules might be made to work. And since one of the great benefits of the PineA64 is its large number of useful gpios, this will have to await further developments.
2019-10-11 update:
Armbian with 4.19 kernels work quite well. With 5.3.9 kernel even better. There are device-overlays available for enabling i2c and spi busses and uarts 1,2, and 3. uart0 is enabled from the beginning, with the uboot and kernel startup messages. These are specified in /boot/armbianEnv.txt and there is info about the various options in /boot/dtb/allwinner/overlay/README.sun50i-a64-overlays
Although uart4 is also an option, it seems that this doesn't quite make it there.
2024-09-14
Armbian, Kernel 6.6
On installation, it only has a minimum amount of software, making the installation image nice and small. Neither the C compiler and associated tools exist, nor do the networking utilities, such as ifconfig, netstat etc.
apt update apt upgrade apt install vim gcc apt install build-essential apt install net-tools apt install binutils less file apt install man-db manpages manpages-dev apt install i2c-tools libi2c-dev apt install sqlite3 libsqlite3-dev sqlite3-doc apt install zlib1g-dev apt install ntpsec
Edit the /usr/share/vim/vim??/default.vim to get rid of incsearch and add
set nowrap set tabstop=4 set shiftwidth=4 set showmode set undolevels=0 set hlsearch set bg=dark
New GPIOs
The sysfs GPIO (/sys/class/gpio... what I used to call userland-gpio), is deprecatete and we are supposed to be using the gpio-device, gpiod. On Raspberry Pi devices these are already being removed; the pineA64 still has sysfs.