Alpine Install: from a disc to PC Engines APU
Overall description: Alpine Installation from an official image tar file to a second generation PC Engines APU system (apu2, apu3, apu4).
This document will guide you to install Alpine on second generation PC Engines APU systems, it was tested with an apu2d4 and Alpine 3.11.6.
Please note that a more elaborate, updated description is available on GitHub: Installation of Alpine Linux on PCEngines APU3.
Terminology
- BIOS: it's a system embedded into the hardware, that manages the early boot process, see more on the Alpine and UEFI page. Note that PC Engines APU boards have the legacy BIOS (MBR), not UEFI. Nevertheless Alpine Linux can boot from these boards.
- New machine: the APU machine fresh and ready for the installation of the Alpine operating system.
- Bootable USB: the USB-flash disk with the downloaded Alpine iso image as install media; this drive is commonly named USB stick.
- Bootable microSD": a microSD card with the downloaded Alpine iso image as install media;
- Serial port:: the APU has a DB9 connector used as serial port (RS232 protocol) for use as a character console. It is common in "headless" devices.
- Source media: will be the just burned / disk from the downloaded iso file of the Alpine Linux operating system. Will be installed on the usb-port of the APU, or the internal microSD slot, to boot the install.
- Target media: the disk in the APU where the Alpine operating system will be installed. The use of a mSATA disk is recommended, another choice would be microSD (less reliable) or (not convenient) a USB-flash drive.
mSATA, microSD, USB-flash which disk to choose?
Users experienced unreliable or failing installs when booting Alpine from USB flash drive and installing to mSATA. If you want to install on the mSATA drive use microSD as the installation disk, not a USB flash drive. Note that the default installation procedure uses the entire target disk. Recommended set up: For installation - on mSATA: use microSD installation disk - on microSD: use USB flash installation
Booting the Alpine installation disk
- The installation of Alpine Linux on APU has beent tested with the factory BIOS (MBR, no UEFI).
- Create_a_Bootable_USB thumb drive or Bootable microSD with the current standard x86_64 image from the downloads page.
- Attach to the serial port (you probably will need a USB to DB9 cable). PC Engines APU systems do not provide video output. Installation must be performed via a serial console. On a linux system: switch from the graphical desktop to a console (Alt-Ctr-F1) to be able to use the function keys. Start the terminal emulator (minicom, cu) with serial settings: Baud rate: 115200 Data bits: 8 Parity: None Stop bits: 1.
- Power on the APU.
- When BIOS prompted, hit F10 and select to boot from microSD or USB.
- At the boot prompt, quickly type a slash to interrupt the default boot, which has a short timeout.
- Continue entering the remainder of this command at your leisure. It should have only one slash at the start, to be clear:
/boot/vmlinuz-lts modules=loop,squashfs,sd-mod,usb-storage nomodeset console=ttyS0,115200 initrd=/boot/initramfs-lts - Alpine should come up as normal.
Continue as per Installation.
How would be used?
Then choose type of installation .. those are described at Setup modes section at Alpine setup scripts wiki page. "sys" mode is the familiar install to disk well known for usage as main OS to computers.
After all a confirmation question will raised, type "y" if everything are ok and the setup will proceed to erase, format and copy the files to the destination disk choose!
After reboot
- Before rebooting, edit /boot/extlinux.conf.
- Add
SERIAL 0 115200as the first line in the file. - In the
APPENDline, replacequietwithconsole=ttyS0,115200
- Add
- Remove the thumb drive.
- Cross your fingers and reboot. The system should boot properly with console on serial.
- Edit
/etc/update-extlinux.confso that if extlinux.conf is regenerated it will retain these settings:- Update the line with
serial_portto readserial_port=0 - Update the
serial_baudline to readserial_baud=115200 - Update the
default_kernel_optsline to replacequietwithconsole=ttyS0,115200
- Update the line with
- Run
update-extlinux - Examine
/boot/extlinux.conf.- Make sure it looks OK. Compare with /boot/extlinux.conf-old.
- If something looks wrong,
mv /boot/extlinux.conf-old /boot/extlinux.confto roll back the changes and try to figure out what went wrong
- Cross your fingers and reboot. The system should boot properly with console on serial.