Installation and Configuration of CentOS7 Diskless OS for x86_64 and armv7

Table of Contents

Intro

The following guide describes the installation and configuration of CentOS7 for use with diskless clients running x86_64 (e.g. VME Controllers) or armv7 (VTPs). It's my hope that this will be useful to anyone left to do this on their own.

This guide assumes that you have a DHCP that can be configured with these parameters

filename "linux-install/pxelinux.0";
next-server 129.57.xxx.xxx;

Where next-server should reflect the IPv4 address of your host machine.

It also assumes that your host machine and VME/VTP have DNS entries.

A separate walk-through will discuss using the dnsmasq package to provide both of these services for a private network.

The Boot Process

VME:

BIOS configured for PXE (check your settings from these pages)

  • DHCP provides info to connect to bootloader
    • ip address
    • tftp server address (your machine's hostname)
    • tftp filename to load (pxelinux.0)
  • pxelinux
    • boot environment configured pxelinux.cfg/<address files>
    • tftp to get kernel and initial ramdisk
  • kernel
    • loads up operating system filesystem using NFS

VTP:

uboot loaded on power up

  • uboot
    • environment loaded from env.txt on microSD
    • tftp to get kernel and initial ramdisk
  • kernel
    • loads up operating system filesystem using NFS

Host packages to install

nfs-utils, tftp-server, syslinux-tftpboot, syslinux
  • I installed these on my host system using yum
yum install nfs-utils tftp-server dnsmasq syslinux-tftpboot syslinux

Download

centos7_dist

Download and install the latest centos7_dist package https://github.com/JeffersonLab/centos7_dist/archive/rc3.tar.gz

  • I extracted the package in my home directory with:
tar zxvf centos7_dist-rc3.tar.gz -C ${HOME}

This unpacks in the directory ${HOME}/centos7_dist-rc3

tgz’s

Download and install the root and tftp pair for your module(s).

I downloaded these and moved them into the tgz directory

mv -v root*.tgz tftp*.tgz ${HOME}/centos7_dist-rc3/tgz/

Configure the distribution

VME OS

The configuration file to adapt for your system is x86_64-rc3.cfg Make sure the ones below are set for your environment.

  • CLIENT_HOSTNAME[n]

    I only have one VME controller at the moment, it's hostname will be rocvme1.jlab.org. But's short hostname is what is needed here:

    CLIENT_HOSTNAME[0]=rocvme1
    
  • NFS_PATH

    This is where the centos7 filesystem will be unpacked. The default works fine for me.

    NFS_PATH=/diskless/CentOS7/x86_64
    
  • TFTP_PATH

    Sometimes this path will be different for different types of tftp servers. I'm using tftp-server on RHEL 7. So this path is the default:

    TFTP_PATH=/var/lib/tftpboot
    

Install with diskless_gen.sh

  • As root, in your centos7_dist-rc3 directory, execute

    ./diskless_gen.sh -f x86_64-rc3.cfg -E
    

    This command will

    • install boot files
    • install the operating system files
    • configure nfs
    • setup pxelinux.cfg files

VTP OS

The configuration file to adapt for your system is armv7-rc3.cfg The VTP needs one extra variable defined

  • CLIENT_HOSTNAME[n]

    I only have one VTP, it's hostname will be rocvtp1.jlab.org. It's short hostname is all that's needed here:

    CLIENT_HOSTNAME[0]=rocvtp1
    
  • VTP_MAC_ADDR

    This parameter is used in the generation of the VTPs environment file. The MAC address is unique for each VTP, and can be obtained from Ben Raydo.

    VTP_MAC_ADDR="ce:ba:f0:03:cc:ff"
    

Install with diskless_gen.sh

  • As root, in your centos7_dist-rc3 directory, execute

    ./diskless_gen.sh -f armv7-rc3.cfg -E
    

Generate the VTP’s U-boot environment

diskless_gen.sh -e
  • Copy the resulting file output/env.bin to the VTPs microSD FAT partition.

Enable and start the NFS-server service

  • As root, execute

    systemctl enable nfs-server.service
    systemctl start nfs-server.service
    

Enable and start the TFTP server

  • As root, execute

    systemctl enable tftp
    systemctl start tftp
    

Author: Bryan Moffit

Email: moffit@jlab.org

Created: 2020-11-10 Tue 07:03

Validate