Autoinstall Ubuntu 14.04.2 via USB stick on APU board from PC Engines

Autoinstall Ubuntu 14.04.2 via USB stick on APU board from PC Engines

Today I was looking for an easy and automated way to install Ubuntu onto PC Engines apu system board. There are basically two options: PXE boot via one of the Ethernet ports or booting from a USB stick. For better or worse, I decided to pursue the USB stick, after all, how hard can it be ;-).

Turns out, harder than I thought. Booting from USB stick assumes a video console, but the board only features a serial console. A google search leads to a promising thread on PC Engines support forum: APU + Ubuntu 14.04 LTS – install via serial console. Unfortunately this didn’t work for me with 14.04.2. I got errors about undefined video mode and lack of preseed file. Once I worked around these errors, the next challenge was creating a working preseed file that runs without user interaction from zero to a fully installed system.

The following steps finally worked:

Create a Live USB stick with Startup Disk Creator under Ubuntu 14.04.2 Desktop. The USB stick must be preformatted with a FAT filesystem and empty, 2 GB or larger.

Screen Shot 2015-06-29 at 10.09.31 PM

Modify syslinux/syslinux.cfg on USB stick to enable serial console and default to menu.c32 (instead of vesamenu.c32) and set a timeout of 10 seconds before automatically launch install:

   # D-I config version 2.0
   CONSOLE 0
   SERIAL 0 115200 0
   include menu.cfg
   default menu.c32
   prompt 0
   timeout 100
   # ui gfxboot bootlogo

Modify syslinux/txt.cfg on USB stick to pass serial console and initial responses to language queries to the kernel. Disable framebuffer, because there is none on APU:

default install
label install
  menu label ^Install Ubuntu Server
  kernel /install/vmlinuz
  append file=/cdrom/preseed/apupreseed.cfg initrd=/install/initrd.gz debian-installer/locale=en_US.UTF-8 console-setup/layoutcode=us fb=false console=tty0 console=ttyS0,115200n8

Copy menu.c32 from the linux distribution into syslinux on USB stick. If the file can’t be found, install the syslinux-common package:

apt-get install -y syslinux-common
cp /usr/lib/syslinux/menu.c32 syslinux/

Create preseed/apupreseed.cfg on USB stick. That file is answering all the questions posed by the installer. This will set the root password to insecure and create a user account ubuntu with the same password. While sshd will be installed and running, login via ssh will only be allowed for non-root users.
DON’T FORGET TO CHANGE THE PASSWORDS AFTER INSTALL!

d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/wireless_wep string
d-i mirror/country string manual
d-i mirror/http/hostname string archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Zurich
d-i clock-setup/ntp boolean true
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
partman-base  partman/unmount_active  boolean true
d-i preseed/early_command string umount /media
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i passwd/root-login boolean true
d-i passwd/make-user boolean true
d-i passwd/root-password password insecure
d-i passwd/root-password-again password insecure
d-i passwd/user-fullname string Ubuntu User
d-i passwd/username string ubuntu
d-i passwd/user-password password insecure
d-i passwd/user-password-again password insecure
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
tasksel tasksel/first multiselect minimal
d-i pkgsel/include string openssh-server build-essential
d-i pkgsel/upgrade select none
d-i pkgsel/update-policy select none
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note

The USB stick is now ready to be used as an automated installer for the APU board. Plug it into one of the USB ports, connect a serial console to a terminal to watch the process and interrupt the boot sequence to select USB drive (Hit F12 when offered to do so).
The system should erase any flash content, install a new minimal Ubuntu server 14.04.2 and reboot the system. Unless you changed the apupreseed.cfg file, the default passwords are root/insecure and ubuntu/insecure.

Advertisements

5 thoughts on “Autoinstall Ubuntu 14.04.2 via USB stick on APU board from PC Engines

Add yours

  1. Hi,

    Thanks for this post, it’s very interesting and I managed to boot the USB. However, I was unable to finish the process. Although it boots perfectly, during the installation it says the Release file is not valid 😦 So I don’t know how to continue. Do you have any clues? By any chance do you still have your USB image?

    I’ve tried with Ubuntu Server 14.04.2 and 14.04.3, 64 bits version, both with the same result (and several times just in case I was doing something wrong). I also tried Ubuntu Desktop (as you mention at the beginning, although I guess it’s a typo), but it does not even boot, as expected.

    Any clues would be really appreciated! 🙂

    Like

  2. unfortunately I don’t have that image anymore. Sorry it doesn’t work for you. All I remember having had issues with was the content of preseed/apupreseed.cfg file combined with the state of the disk and its partitions. But your issue sounds different.

    Like

    1. Thank you! No problem, I understand 🙂
      Your guide was the best I found online and your config files worked perfectly fine… but it was something else that I couldn’t find out. In the end I installed Voyage Linux, hehe 🙂

      Like

  3. Hello,

    Thanks for this post, it help me a lot but i had a problem at the installation, i have this message :

    Please enter the hostname of the mirror from which Ubuntu will be x
    lqqx downloaded. x k
    x x x x
    x x An alternate port can be specified using the standard x x
    x x [hostname]:[port] format. x x
    x Sx x x
    x x Ubuntu archive mirror hostname: x x
    x x x x
    x x archive.ubuntu.com_

    do you have an idea of what i must do because i’m lost

    Best regards

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: