Difference between revisions of "Debian/ImagingServer"

From Servfire
Jump to: navigation, search
Line 1: Line 1:
== Work in progress ==
+
= Work in progress =
=== Base Installation ===
+
== Base Installation ==
 
<pre>
 
<pre>
 
apt-get install tftpd-hpa syslinux initramfs-tools nfs-kernel-server
 
apt-get install tftpd-hpa syslinux initramfs-tools nfs-kernel-server
Line 15: Line 15:
 
</pre>
 
</pre>
  
=== Building the initramfs ===
+
== Building the initramfs ==
==== Add squeeze-backports to sources.list ====
+
=== Add squeeze-backports to sources.list ===
 
<pre>
 
<pre>
 
echo 'deb http://backports.debian.org/debian-backports squeeze-backports main' >> /etc/apt/sources.list
 
echo 'deb http://backports.debian.org/debian-backports squeeze-backports main' >> /etc/apt/sources.list
Line 23: Line 23:
 
</pre>
 
</pre>
  
==== Copy out config ====
+
=== Copy out config ===
 
<pre>
 
<pre>
 
cp -r /etc/initramfs-tools ~/irfs
 
cp -r /etc/initramfs-tools ~/irfs
Line 30: Line 30:
 
</pre>
 
</pre>
  
==== Add script - ~/irfs/hooks/union ====
+
=== Add script - ~/irfs/hooks/union ===
 
<pre>
 
<pre>
 
#!/bin/sh -e
 
#!/bin/sh -e
Line 39: Line 39:
 
</pre>
 
</pre>
  
==== Add script - ~/irfs/scripts/nfs-bottom/union ====
+
=== Add script - ~/irfs/scripts/nfs-bottom/union ===
 
<pre>
 
<pre>
 
#!/bin/sh -e
 
#!/bin/sh -e
Line 59: Line 59:
 
</pre>
 
</pre>
  
==== Build initramfs ====
+
=== Build initramfs ===
 
<pre>
 
<pre>
 
mkinitramfs -d ~/irfs -o /srv/tftp/initramfs-$(uname -r) -v
 
mkinitramfs -d ~/irfs -o /srv/tftp/initramfs-$(uname -r) -v
 
</pre>
 
</pre>
  
=== /srv/tftp/pxelinux.cfg/default ===
+
== /srv/tftp/pxelinux.cfg/default ==
 
<pre>
 
<pre>
 
UI menu.c32
 
UI menu.c32

Revision as of 07:46, 27 December 2012

Work in progress

Base Installation

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) >> /etc/exports

exportfs -av

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

echo 'fuse' >> ~/irfs/modules

Add script - ~/irfs/hooks/union

#!/bin/sh -e

. /usr/share/initramfs-tools/hook-functions

copy_exec /usr/bin/unionfs-fuse /bin/unionfs-fuse

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

#!/bin/sh -e

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

mkdir /nfsroot
mkdir /memroot

mount -n -o move /root /nfsroot
mount -n -t tmpfs none /memroot

unionfs-fuse -o cow,allow_other /memroot=rw,/nfsroot=ro /root

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