Skip to content

lawrencecreates/RHEL5-chroot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository provides "chroot-tool", a simple tool designed for quick
and easy chroots.

We plan on using this to provide a RHEL5-compatibility environment for
batch system jobs which require RHEL5, but the local site provides a RHEL6
host environment.

The tool provides basic functionality using "yum", but a complete chroot will
need additional supplements (such as bind mounts).  We include example puppet
manifests for both Condor and PBS sites.

USE:

To create an empty chroot with no installed files:

     chroot-tool create 

To install the base RPMs for RHEL5:

  ./chroot-tool install python rpm yum python gcc make autoconf zlib-devel bzip2-devel openssl-devel ncurses-devel wget sqlite sqlite-devel 

setup the resolv.conf :
  cp /etc/resolv.conf /opt/vhost/chroot/sl5-v1/etc/

Install  mezzanine :
  git clone git@github.com:lawrencecreates/mezzanine.git
  mv mezzanine/ /opt/vhost/chroot/sl5-v1/root/


That list is customized for our site; adjust for yours.

To remove all world-writable directories and setuid binaries from the chroot,
use the "secure" subcommand:

     chroot-tool secure

To test out the resulting chroot, do the following:

chroot /chroot/sl5 bash

BUILDING:

chroot-tool is a self-contained python script.  However, to build it into an
RPM, do the following:

     ./build_rpm

CONFIGURAITON:

There are basically two configuration decisions you must make.

First, decide where to build the chroot in the filesystem; this is kept in
/etc/chroot-tool/tool.cfg; the default is:

root_dir = /chroot/sl5-v1

Second, you will need to decide what yum repositories to enable for the chroot
(these are necessarily different from the system ones!).  You can configure
yum by editing the file /etc/chroot-tool/yum.conf




http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
./configure --prefix=/usr/local



Inside the chroot :

   19  wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
   20  tar xzf Python-2.7.5.tgz 
   21  cd Python-2.7.5
   24  ./configure --prefix=/usr/local
   25  make && make altinstall
   27  cd ..
   30  wget --no-check-certificate  http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
   31  tar xf distribute-0.6.27.tar.gz 
   32  cd distribute-0.6.27
   33  python2.7 setup.py install
   34  /usr/local/bin/easy_install-2.7 virtualenv

   40  virtualenv VENV
   43  . ./activate

   46  cd ..
   48  cd ..
   50   git clone git@github.com:lawrencecreates/mezzanine.git
   51  cd mezzanine/
   54  python setup.py install


   58  mezzanine-project lawrence_creates
   59  cd lawrence_creates/
   65  python manage.py createdb --noinput

About

Script for creating a RHEL5 chroot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 49.3%
  • Python 48.9%
  • Racket 1.8%