Debian/ImagingServer

From Servfire
Revision as of 08:34, 27 December 2012 by Hell Fire (Talk | contribs)

Jump to: navigation, search

Work in progress

Base Installation

TFTP and NFS server setup

apt-get install tftpd-hpa syslinux initramfs-tools nfs-kernel-server

mkdir -p /srv/tftp

cp /boot/vmlinuz-$(uname -r) /usr/lib/syslinux/{pxelinux.0,menu.c32} /srv/tftp/

mkdir -p /srv/nfs/imageclient

echo '/srv/nfs/imageclient *(ro,sync,no_subtree_check,no_root_squash) >> /etc/exports

exportfs -av

Bootstrap for clients to load

debootstrap --variant=minbase squeeze /srv/nfs/imageclient

Building the initramfs

Add squeeze-backports to sources.list

echo 'deb http://backports.debian.org/debian-backports squeeze-backports main' >> /etc/apt/sources.list
apt-get update
apt-get install unionfs-fuse

Copy out config

cp -r /etc/initramfs-tools ~/irfs


Add script - ~/irfs/scripts/nfs-bottom/ro-nfs

#!/bin/sh -e

case "$1" in
  prereqs)
    echo ""
    exit 0
  ;;
esac

tmpmount() {
  mkdir -p /mnt
  mount -t tmpfs none /mnt
  cp -a $1/. /mnt
  mount -o move /mnt $1
}

tmpmount /root/etc
tmpmount /root/var
tmpmount /root/srv
tmpmount /root/tmp
tmpmount /root/home

Build initramfs

mkinitramfs -d ~/irfs -o /srv/tftp/initramfs-$(uname -r) -v

/srv/tftp/pxelinux.cfg/default

UI menu.c32
DEFAULT 0
TIMEOUT 50
PROMPT 1

LABEL local
MENU LABEL Boot HD
LOCALBOOT 0

LABEL imageclient
MENU LABEL Imaging
KERNEL vmlinuz-++KERNEL_VERSION++
APPEND initrd=initramfs-++KERNEL_VERSION++ boot=nfs nfsroot=++NFSSERVER++:/srv/nfs/imageclient