4/22/2016

PINE64: install Oracle JDK 8

This post show how to install Oracle JDK 8 on PINE64.

  1. Download jdk-8u77-linux-arm64-vfp-hflt.tar.gz from Oracle
  2. Extract the downloaded file to /opt
    $ sudo tar zxvf jdk-8u77-linux-arm64-vfp-hflt.tar.gz -C /opt
  3. Set default java and javac to the extracted JDK 8
    $ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_77/bin/javac 1
    $ sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_77/bin/java 1
  4. If you already installed the other JDK like openjdk, update the configuration
    $ sudo update-alternatives --config javac
    $ sudo update-alternatives --config java
  5. Check the commands
    $ java -version
    $ javac -version
  6. This is a sample code of Sample.java
    public class Sample {
      public static void main(String[] args) {
        System.out.println("Java world on PINE64!!");
      }
    }
    
  7. Compile the code and run
    $ javac Sample.java
    $ java Sample

4/10/2016

PINE64: modify file system size to max of SD card

You will find the route directory /dev/mmcblk0p2 is 3.5GB even if you install Ubuntu into more than 4GB micro SD card. I am using 16GB micro SD card.
$ df -h | grep /dev/mmcblk0p2
/dev/mmcblk0p2  3.5G  690M  2.6G  21% /

The size can be changed to the max size of SD card using fdisk.
$ sudo fdisk /dev/mmcblk0
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-31422463, default 2048): 143360
Last sector, +sectors or +size{K,M,G,T,P} (143360-31422463, default 31422463):

Created a new partition 2 of type 'Linux' and of size 14.9 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

After this, reboot PINE64:
$ sudo reboot


Once OS starts, you can resize the partition.
$ sudo resize2fs /dev/mmcblk0p2
[sudo] password for ubuntu:
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 3909888 (4k) blocks long.

You will see the size is changed.
$ df -h | grep /dev/mmcblk0p2
/dev/mmcblk0p2   15G  691M   14G   5% /

4/07/2016

PINE64: change time zone on Ubuntu

You can change the time zone with timedatectl.
sudo timedatectl set-timezone Asia/Tokyo

PINE64+ arrive and set Ubuntu up



PINE64+ with 2GB memory arrived at last!

I set Ubuntu up on it.
As Sunxi described, longsleep build minimum Ubuntu image. I downloaded the image .xz file from here to my Windows 10, then extracted the .img file by 7zip.
It is flashed to SD card by Win32 Disk Imager.
After that, the SD card is inserted to PINE64+, and booted. You can log in as ubuntu with password ubuntu. Once boot up, if you connect LAN, the board gets automatically an IP address from DHCP server. We can access it remotely because SSH server is already installed.