Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


install_centos_6.5_on_pc_engine_s_apu_over_pxe

PC Engines APU - Install CentOS 6.5 64bit over PXE

This guide wil help you install a CentOS 6.5 PXE server, and then let you install CentOS 6.5 64bit on the PC Engine's APU.

If you need to mass install APU's using PXE, you'll have to look into unattended Kickstart installations.

Starting points:

  • You'll have to create a CentOS 6.5 VM/machine yourself. This guide is using IP address 192.168.1.15/24 for the PXE server.
  • Connect the APU and PXE machine to the same (V)LAN.
  • Serial connection, e.g. an USB-to-serial adapter.

Post install:

  • Update your APU after install!

Install and configure a PXE (Preboot Execution Environment) server

Install the needed packages

yum install tftp-server syslinux httpd dhcp

Configure the xinetd TFTP service

Edit /etc/xinetd.d/tftp. Enable the service and change the server_args.

# default: off
# description: The tftp server serves files using the trivial file transfer \
#	protocol.  The tftp protocol is often used to boot diskless \
#	workstations, download configuration files to network-aware printers, \
#	and to start the installation process for some operating systems.
service tftp
{
	socket_type		= dgram
	protocol		= udp
	wait			= yes
	user			= root
	server			= /usr/sbin/in.tftpd
	server_args		= -s /tftpboot
	disable			= no
	per_source		= 11
	cps			= 100 2
	flags			= IPv4
}

Setup TFTP directory and files

mkdir -p /tftpboot/pxelinux.cfg
mkdir -p /tftpboot/centos6/x86_64
cp /usr/share/syslinux/pxelinux.0 /tftpboot/
cp /usr/share/syslinux/menu.c32 /tftpboot/
cp /usr/share/syslinux/memdisk /tftpboot/
cp /usr/share/syslinux/mboot.c32 /tftpboot/
cp /usr/share/syslinux/chain.c32 /tftpboot/

Edit PXE default

Edit /tftpboot/pxelinux.cfg/default

serial 0 115200
default centos-serial
prompt 0
timeout 0

label centos-serial
  kernel centos6/x86_64/images/pxeboot/vmlinuz console=ttyS0,115200n8
  append initrd=centos6/x86_64/images/pxeboot/initrd.img method=http://192.168.1.15/centos6/x86_64 devfs=nomount console=ttyS0,115200n8

Mount CentOS iso

Download the CentOS minimal iso and mount this file.

cd /var/tmp
wget http://ftp.tudelft.nl/centos.org/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso
mount -o loop /var/tmp/CentOS-6.5-x86_64-minimal.iso /tftpboot/centos6/x86_64/

Configure DHCPd

Edit /etc/dhcp/dhcpd.conf. Change your domain, nameservers and ip-adresses.

# dhcpd.conf
#
# option definitions common to all supported networks...
option domain-name "yourdomain.com";
option domain-name-servers ns1-ip-address, ns2-ip-address;

default-lease-time 600;
max-lease-time 7200;

ddns-update-style none;
authoritative;
log-facility local7;


subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.100 192.168.1.110;
  option routers 192.168.1.1;

  allow booting;
  allow bootp;
  next-server 192.168.1.15;
  filename "pxelinux.0";
}

option option-128 code 128 = string;
option option-129 code 129 = text;

Configure httpd

Create /etc/httpd/conf.d/pxeboot.conf

Alias /centos6/x86_64 /tftpboot/centos6/x86_64

<Directory /tftpboot/centos6/x86_64>
 Options Indexes FollowSymLinks
 Order Deny,Allow
 Deny from all
 Allow from 127.0.0.1 192.168.1.0/24
</Directory>

Configure SELinux

Configure SE Linux read/write rights to the tftpboot directory.

yum -y install policycoreutils-python
semanage fcontext -a -t tftpdir_rw_t '/tftpboot(/.*)?'
restorecon -R -v /tftpboot

Configure iptables

Add rules to /etc/sysconfig/iptables to allow http, tftp and dhcp traffic.

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -p udp --dport 69 -j ACCEPT
-A INPUT -i eth0 -p udp --dport 67:68 --sport 67:68 -j ACCEPT

Add tftp conntrack module to /etc/sysconfig/iptables-config

IPTABLES_MODULES="ip_conntrack_tftp"

Start services

If you want this to survive a reboot then you'll need to copy the files from the iso file, or mount it at boot.

For example using the /etc/rc.local file:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

mount -o loop /var/tmp/CentOS-6.5-x86_64-minimal.iso /tftpboot/centos6/x86_64/

Configure services to start at boot, and start services.

chkconfig xinetd on
chkconfig httpd on
chkconfig dhcpd on
service iptables restart
service xinetd start
service httpd start
service dhcpd start

Install CentOS on the APU

Firmware update

I had to install the latest beta firmware update, because i couldn't enter the BIOS setup, with the stock firmware. Maybe you don't need this step.

Boot PXE

  • Connect to APU via serial, for example with minicom or screen. You can quit screen with <ctrl>-<a> :quit.
screen /dev/cu.usbserial 115200
  • Power on the APU
  • Press F12
Build date: Apr  5 2014
System memory size: 4592 MB

Press F12 for boot menu.

Select boot device:

1. AHCI/0: SuperSSpeed S328 16GB ATA-7 Hard-Disk (15258 MiByte
2. iPXE (PCI 00:00.0)
3. Payload [setup]
4. Payload [memtest]
  • Select iPXE
net0: 00:0d:b9:33:CA:FE using rtl8168 on PCI01:00.0 (open)
  [Link:down, TX:0 TXE:0 RX:0 RXE:0]
  [Link status: Down (http://ipxe.org/38086101)]
Waiting for link-up on net0... ok
Configuring (net0 00:0d:b9:33:CA:FE)........... ok
net0: 192.168.1.100/255.255.255.0 gw 192.168.1.1
Next server: 192.168.1.15
Filename: pxelinux.0
tftp://192.168.1.15/pxelinux.0..... ok

PXELINUX 4.02 0x534d43b1  Copyright (C) 1994-2010 H. Peter Anvin et al
Loading centos6/x86_64/images/pxeboot/vmlinuz......
Loading centos6/x86_64/images/pxeboot/initrd.img...
...
  • The system will now boot the CentOS text installer.
  • Select “English” using tab/spacebar.
  • Select “eth0”.
  • Select ipv4 (and ipv6 if needed).
  • Network manager will configure eth0 (dhcp).
           ┌───────────────────────────────────────────────────────┐
           │                                                       │
           │ Waiting for NetworkManager to configure eth0.         │
           │                                                       │
           └───────────────────────────────────────────────────────┘
  • Choose VNC installer or text based… lets try VNC.
              ┌──────────┤ Would you like to use VNC? ├──────────┐
              │                                                  │
              │ Text mode provides a limited set of installation │
              │ options.  It does not allow you to specify your  │
              │ own partitioning layout or package selections.   │
              │ Would you like to use VNC mode instead?          │
              │                                                  │
              │     ┌───────────┐         ┌───────────────┐      │
              │     │ Start VNC │         │ Use text mode │      │
              │     └───────────┘         └───────────────┘      │
              │                                                  │
              │                                                  │
              └──────────────────────────────────────────────────┘
  • Choose a VNC password… or none…
19:36:19 Please manually connect your vnc client to 192.168.1.101:1 to begin the install.
Press <enter> for a shell
19:36:20 Starting graphical installation.
  • Connect with a VNC viewer to 192.168.1.101:1
  • And here it is… the graphical installer! Have fun with CentOS on APU :)

install_centos_6.5_on_pc_engine_s_apu_over_pxe.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1