PDA

View Full Version : Creating a Bootstrap Installation of Debian 3.1 SID using grml 0.8


castaway
11-01-2006, 02:34 PM
Creating a Bootstrap Installation of Debian 3.1 SID Using grml 0.8
--A Beginner's Guide to Bootstrapping--


***INTRODUCTION***

The Debian bootstrapping technique has several functions:

1. It sets up a "sandbox" in your Debian system for testing a program. Should the program be faulty and damage the operating system, it is ONLY the sandbox operating system that is damaged. To set up a sandbox, see this website:

http://www.debian-administration.org/articles/426

2. It sets up a localized environment for running 32-bit-specific programs in a 64-bit amd64 installation.

3. It can be used, with additional steps, to install the Debian operating system on your hard drive. But note that bootstrapping can only create a 64-bit operating system from a running 64-bit system. You cannot create a 64-bit system from a 32-bit installation, whether the 32-bit system is installed on your hard drive or the ram drive of a living distribution such as grml 0.8.

The following directions describe how to use the grml 0.8 cdrom to create a bootstrap installation of SID.

* All device ID's, e.g. hda2, are to be replaced with your own device ID's.
* Data preceded and followed by ##### represent text to be entered into a file or text that is currently in a file.
* The linux boot manager (lilo or grub) will be installed on the root partition. You will have to use a separate boot manager on the master boot record (MBR) to access your new linux root partition.

***INSTALLATION PROCEDURE***

# obtain grml from:

http://grml.org/download/

# boot from the grml cdrom and install grml into ram

# create root and swap partitions

cfdisk /dev/hda

# format your root partition

mkfs.ext3 /dev/hda2

# mount your root partition

mkdir /mnt/bootstrap
mount -o rw,suid,dev /dev/hda2 /mnt/bootstrap

# format your swap partition

mkswap -f /dev/hda1

# mount your swap partition

swapon /dev/hda1

# get the basic packages from debian

cdebootstrap sid /mnt/bootstrap ftp://ftp.tugraz.at/mirror/debian/

# copy necessary networking files from grml

cp /etc/resolv.conf /mnt/bootstrap/etc/resolv.conf
cp /etc/network/interfaces /mnt/bootstrap/etc/network/interfaces
cp /etc/hosts /mnt/bootstrap/etc/hosts

# setup up your new partition's network interface card

nano /mnt/bootstrap/etc/network/interfaces

-- revise the interfaces file so that it reads:

#####
## /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
#####

-- to Exit & Save, type <Ctrl>+X, Y, <Enter>

# Create a sources.list for apt on your new partition

nano /mnt/bootstrap/etc/apt/sources.list

-- enter the following:

#####
## /etc/apt/sources.list
deb http://ftp.us.debian.org/debian/ sid main contrib non-free
######

# chroot into your new partition

chroot /mnt/bootstrap /bin/bash

# determine the linux-image you want to install

apt-get update
apt-cache search linux-image | more

# install the linux kernel image you have chosen (The example below uses 2.6.18-1-k7)

apt-get install locales
dpkg-reconfigure locales
aptitude install linux-image-2.6.18-1-k7

-- ignore the notice regarding lilo configuration; choose NOT to abort the kernel installation

# setup device parameters in fstab

nano /etc/fstab

-- example file:

#####
## /etc/fstab
# filesystem mountpoint type options dump pass
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1
/dev/hda1 none swap defaults 0 0
proc /proc proc defaults 0 0
usbfs /proc/bus/usb usbfs devmode=0666 0 0
/dev/cdrom /cdrom iso9660 ro,user,noauto 0 0
/dev/fd0 /floppy auto rw,user,noauto 0 0
######

# add additional directories used by your version of fstab

mkdir /cdrom
mkdir /floppy

# mount the files system for handling devices

mount -a
exit
mount --bind /dev /mnt/bootstrap/dev
chroot /mnt/bootstrap /bin/bash

# install a boot manager, either LILO or GRUB:

-- lilo & grub are broken in sid: use the etch versions instead

nano /etc/apt/sources.list (change "sid" to "etch")

{LILO}

apt-get install lilo
liloconfig (select boot screen; accept all defaults)
lilo (must always be run after running liloconfig)

# open lilo.conf to see if corrections are needed

nano /etc/lilo.conf

-- example file:

#####
image=/boot/vmlinuz-2.6.18-1-k7
label="Lin 2.6.18img0"
initrd=/boot/initrd.img-2.6.18-1-k7
read-only
#####

{GRUB}

-- grub may have difficulty installing SATA drives automatically!

apt-get install grub
grub-install /dev/hda2
update-grub

# open grub/menu.lst to see if corrections are needed

nano /boot/grub/menu.lst

-- example file:

#####
title Debian GNU/Linux, kernel 2.6.18-1-k7
root (hd0,1)
kernel /boot/vmlinuz-2.6.18-1-k7 root=/dev/hda2 ro
initrd /boot/initrd.img-2.6.18-1-k7
savedefault
#####

# change /etc/apt/sources.list back to "sid" again

nano /etc/apt/sources.list (change "etch" to "sid")

# configure password security; set root password; add User'sName and pasword; set your computer's name; set time zone

shadowconfig on
passwd
adduser UserName
echo HostName > /etc/hostname
tmzconf

# leave chroot and reboot into your newly installed operating system

exit
reboot -n

***SUGGESTED ADDITIONS TO YOUR BASIC SYSTEM***

Install these programs in the order listed. They are installed at the root prompt using "apt-get install program-name".

<DESCRIPTION> <PROGRAM-NAME> <CONFIGURATION COMMAND>
X-window system xorg dpkg-reconfigure xserver-xorg
(install with "aptitude install xorg"
Windows manager icewm, icemc icemc
Screen saver xscreensaver xscreensaver
Graphic signon gdm gdmsetup
(starts x-windows; chooser if multiple window managers installed)
Gnome gnome-desktop-environment (already configured)

***COMPACTING YOUR INSTALLATION***

# get program to identify any unused .debs

apt-get install deborphan

# remove unnecessary programs

apt-get clean
dpkg --purge ppp pppoe pppconfig pppoeconf
deborphan
dpkg --purge unused-deb-#1 unused-deb-#2 etc

# determine the final size of your installation

du . --human-readable --total | grep total