Pivot-oM Diskless Root Image Creation

From Clustergroup
Jump to navigationJump to search

A work in progress to find the best way to create The Pivot-oM Root Image. (Everything in this HOWTO is open for discussion)

Method

The root image is created using Gentoo's Portage and the 'emerge' command so that they can be created for any computer architecture using cross compiling, these images will be created on the fly when a user requests one from the website (caching - so a particular arch only needs to be created once).

keeping the root inside 8Mb would benefit boot up download speed over TFTP on boot when appended to the kernel and also would benefit the webserver by preserving bandwith as much as possible when a user that requested Pivot-oM finally downloads it.

Build

Firstly, a loop file is created and mounted as the %path to install directory%

#This creates an ext2 loop file system of 8Mb
dd if=/dev/zero of=~/Pivot-fS bs=1M count=8
mke2fs -F -m 0 -b 1024 ~/Pivot-fS

#The following mounts the file system
mkdir %path to install directory%
mount -t ext2 -o loop ~/Pivot-fS %path to install directory%
# We are using the Gentoo netboot file system structure 
ROOT="%path to install directory%" emerge netboot-base
# We need uClibc for the basic functionality it provides other programs
ROOT="%path to install directory%" emerge uclibc
# The basic unix/linux tools are to be provided by busybox
ROOT="%path to install directory%" USE="make-symlinks netboot" emerge busybox
# Not sure if this is the best way
ROOT="%path to install directory%" USE="minimal" emerge portage

# Which builds the following to %path to install directory%
# app-shells/bash
# dev-lang/python
# dev-libs/expat
# dev-libs/openssl
# dev-python/python-fchksum
# sys-apps/debianutils
# sys-apps/portage
# sys-apps/sed
# sys-libs/gpm
# sys-libs/ncurses
# sys-libs/zlib