Showing posts with label chroot. Show all posts
Showing posts with label chroot. Show all posts

Sunday, 28 February 2010

How to Create a GENTOO Distro CHROOT ENVIRONMENT

This article describes how to build a chroot environment for Gentoo distribution.

NOTE: Debian GNU/Linux will be our host system, but these steps should also work for most other Linux based distributions (e.g: Ubuntu).


DOWNLOAD A SMALL MINIMUM GENTOO SYSTEM

First we are going to download a minimal Gentoo system, called STAGE3.

We choose our architecture, in my case x86, and i686 specifically.
http://mirrors.kernel.org/gentoo/releases/x86/autobuilds/current-stage3/
$ wget http://mirrors.kernel.org/gentoo/releases/x86/autobuilds/current-stage3/stage3-i686-*.tar.bz2

There is a list of mirrors here: http://www.gentoo.org/main/en/mirrors.xml

We could download directly from gentoo page too:
$ wget ftp://distfiles.gentoo.org/pub/gentoo/releases/x86/current-stage3/stage3-i686-*.tar.bz2



BUILDING OUR GENTOO DIRECTORY

We create a directory where we will place Gentoo files:

Sunday, 15 March 2009

Creating a FEDORA 10 CHROOT Environment in DEBIAN SID

Fedora is a linux distribution supported by a community: fedoraproject.org and by Red Hat enterprise.
Fedora (Wikipedia)

Current release name is Fedora 10.


Fedora packages are provided in rpm format. We can manage these packages using rpm tool, and use yum to deal with repositories.

Debian sid provides the rpm tool so our first task will be installing it in our Debian system:
#aptitude install rpm

This tool will allow us to install fedora packages in our debian system using a separate database and a different directory than / .


We create the directory to place our Fedora chroot environment:
$mkdir Fedora
$cd Fedora
$mkdir Distro


We are going to download the minimal amount of rpm packages required for our Fedora distro.

Navigating through fedora project web page we can find some mirrors, e.g:
http://glup.uv.es/mirror/fedora/linux/
http://ftp.uni-kl.de/pub/linux/fedora/linux/
Choose one near you.

Within those mirrors we find where packages are:
http://glup.uv.es/mirror/fedora/linux/releases/10/Fedora/i386/os/Packages/
http://ftp.uni-kl.de/pub/linux/fedora/linux/releases/10/Fedora/i386/os/Packages/


We can download every package we need using wget tool.
Although we only show the installing rpm command, you will have to download every rpm package prior to install it.
NOTE: Package version may not coincide, but the same package name and same installing order are mandatory.

If we need some file to satisfy a dependency, but don't know which package contains it, this web page

Sunday, 21 September 2008

Installing GNU/Debian Sid in Ubuntu Hardy using debootstrap and chroot

This article explains how to install GNU/Debian Sid in a previously installed Ubuntu Hardy System. We will use debootstrap and chroot tools to accomplish that. This how-to is not focused on security, it does not tell how to create a restricted chroot environment to improve security.

Ubuntu is a GNU/Debian based distro. Every six months they take GNU/Debian Unstable packages and make a new Ubuntu distribution.
Debian Sid provides more and newer packages. Ubuntu is configured for easiness. Debian has less preconfiguration instead.

chroot runs a command with a special root directory.
chroot comes as part of coreutils package.
$ sudo aptitude install coreutils

debootstrap command bootstraps a basic Debian system (it can also bootstrap other systems).
$ sudo aptitude install debootstrap

$ ls /usr/share/debootstrap/scripts/ #shows which distros and versions you can install with debootstrap:

breezy  edgy  etch-m68k  gutsy  hoary  lenny  sarge  sarge.fakechroot  warty  woody 
dapper  etch  feisty  hardy  hoary.buildd  potato  sarge.buildd  sid warty.buildd  woody.buildd


INSTALLATION BEGINNING

First of all we create the directory where Debian Sid will be installed.
$ mkdir DebianSid


CREATING A LOOPBACK IMAGE TO STORE DEBIAN SID

This step is only necessary if you plan to boot your system from your Debian Sid chroot environment.

$ sudo dd if=/dev/zero of=DebianSidFile bs=1048576 count=10000 #We create DebianSidFile with 10 gigabyte capacity.

$ sudo mkfs.ext3 -b 4096 -L DSid DebianSidFile #Ext3 filesystem creation.

$ sudo mount DebianSidFile DebianSid -t ext3 -o loop #mounting it on DebianSid directory.


INSTALLING A MINIMAL SYSTEM