/pcengines-apu-debian-cd

Deban installer CD for PC Engines APU board with mSATA drive

Primary LanguageShell

Debian installer CD for PC Engines APU board with mSATA drive
=============================================================

Introduction
------------

This is a set of configuration files for building a Debian installation
CD optimized for the APU platform of PC Engines:
http://www.pcengines.ch/apu.htm

This installation is only intended for an mSATA drive on the APU
board. If you plan to boot from SD card, use Voyage Linux instead:
http://linux.voyage.hk/

The configuration files can build either an i386 or amd64 installer for
the APU platform (but not both architectures inside the same path).

In order to build a Debian Wheezy installer, the build machine has to be
a Wheezy host of amd64 or i386 architecture. A Jessie installer can only
be built on a Jessie host.

Before using these scripts, have a look at the files in profiles/, and
you may want to change some options. The "wget_debian_mirror" parameter
should point to a working FTP mirror, so you may want to select a mirror
near you.

The default hostname is set to "apu", unless DHCP delivers a different
name. Default root password is "pcengines", and it is defined in
"profiles/apu.preseed".

By default, the installer asks for the host name (this is the only thing
that is manually entered). If you want to skip the hostname prompt,
comment out the following line to "profiles/apu.preseed":

d-i netcfg/get_hostname seen false

The disk layout does not allocate a swap partition (the APU board has 2
or 4GB RAM). If you need swap, you can add a swapfile in root
partition. The system is optimized for minimal swap usage:
vm.swappiness=1 in /etc/sysctl.d/pcengines_apu.conf

The profile adds an hourly cronjob
(/etc/cron.hourly/pcengines_apu_fstrim) which performs fstrim command on
root and boot partitions once a day.

The kernel boots with "elevator=deadline", which optimizes the I/O
performance for SSD drives.

See also SSD optimization tips:
https://wiki.freeswitch.org/wiki/SSD_Tuning_for_Linux
https://wiki.debian.org/SSDOptimization

If you need a live or rescue CD, you can get a Live CD from Voyage
Linux. It works fine, the only minor issue is that it switches the
serial console to 9600 baud: http://linux.voyage.hk/


Jessie notes
------------

The installer has only had limited testing under Debian Jessie.

The SSH daemon now has `PermitRootLogin without-password` by default,
which disallows the root to login with a password. You either need to
install your public SSH key in root's autorized_keys, or change the SSH
daemon configuration.

Binary releases
---------------

A 64-bit installer ISO image is available at GitHub in Releases section:
https://github.com/ssinyagin/pcengines-apu-debian-cd/releases


Installation
------------

WARNING: this is a fully automated installation. Once you boot from the
USB stick, it will only give you 5 seconds in the initial menu, then in
a couple of minutes it will ask for the hostname, and the rest will be
done automatically, and a new Debian system will be installed on mSATA
SSD drive.

!!! ALL EXISTING DATA ON THE DRIVE WILL BE LOST !!!

The build machine needs to be Debian Wheezy. Other Debian versions or
Ubuntu are not fully tested and there are some issues, not yet fully
investigated.

Both the build machine and the APU board need the Internet connection
during the installation. The installer assumes that eth0 (marked as LAN1
on the APU board) is connected to a network with DHCP service and
Internet access.

The installation ISO image is about 200MB in size.

Build the CD image on the build machine:

## install prerequisites
apt-get update
apt-get install -y simple-cdd git

## get our latest files
mkdir /opt/pcengines
cd /opt/pcengines
git clone https://github.com/ssinyagin/pcengines-apu-debian-cd.git .

## build the installation CD image (32bit or 64bit version). If you need
# to build another ISO image of a different architecture inside the same
# path, delete the contents of "tmp/" subdirectory.

# build-simple-cdd --conf profiles/apu32.conf --dist wheezy --force-root
build-simple-cdd --conf profiles/apu64.conf --dist wheezy --force-root
# build-simple-cdd --conf profiles/apu64.conf --dist jessie --force-root

# In case of a failure, delete the contents of tmp/ subfolder.
# Sometimes problems with accessing the mirror leave garbage in tmp/
# and this breaks the execution of build-simple-cdd

## insert the USB stick into the build machine

## check where your USB stick is
fdisk -l

## copy the installer CD image
# dd if=images/debian-7.7-i386-CD-1.iso of=/dev/sdc bs=16M
dd if=images/debian-7.7-amd64-CD-1.iso of=/dev/sdc bs=16M

## It is recommended to change the default boot sequence, and have mSATA
## drive as the first boot source. Upon booting the board, wait for F12
## prompt and press F12, and edit the default boot settings.

## Insert the USB stick into APU board and connect the serial terminal
## The terminal emulator should be vt220 or xterm (vt100 does not have
## F12). When the prompt for F12 appears, press F12 and select your USB
## stick as boot source.

## In the boot menu, "Install" will do automatic installation.

## ignore the error message and wait 30 seconds. I did not yet manage to
##   go around it:
Undefined video mode number: 314
Press <ENTER> to see video modes available, <SPACE> to continue, or wait 30 sec

## The installation continues, and takes about 15 minutes in total. The
## device will halt after the installation is finished.


Author
------
Stanislav Sinyagin
ssinyagin@k-open.com