FreeBSD Links

Freebsd.org

OpenPacket Blog

Arquivos

30/08/2005   03/09/2005   06/09/2005   09/09/2005   10/09/2005   03/10/2005  

This page is powered by Blogger. Isn't yours?

<body>

  Usermode Linux with Slackware 9.1 HOWTO

DatuX Usermode Linux with Slackware 9.1 HOWTO
© 2003 http://www.datux.nl/ ? Edwin Eefting edwin@datux.nl

Last updated: 10/05/03

Introduction
This document describes how I installed the latest slackware version (currently 9.1) under UML, without using any prepared bootimages or scripts. There is also a link in this document to a ready-to-run slackware 9.1 installer, and a complete ready-to-run basic 9.1 installation. If there's a new version of slackware, you should be able to create the install image yourself with the help of this document.

Why can't I just install slackware under UML?
UML is something different then programs like VMWare. VMWare provides a complete virtual machine, that comes WITH a bios and thus is able to boot a installation CDROM of any type of operating system. (like a normal computer)

However, UML doesn't provide a virtual machine, i only provides a virtual linux environment, by making users able to start the kernel like a normal program. This means that you can't can ?boot? from a CD-ROM. However, with a little ?fiddeling? (hacking around in the slackware setup scripts) it's still posible to run the slackware setup program under UML. This way you won't need to do the complex stuff to create a root-disk. (according to the UML homepage)

Requirements
Before you can start you first need to comiple a UML-kernel binairy like you normally would do when you want to use UML. Look at http://user-mode-linux.sourceforge.net/ for more info about how to do this.

If you want to install slackware from scratch: The latest .ISO images of slackware. (currently 9.1) At http://www.slackware.org or at http://slackware.datux.nl There is no need to burn them on a CD, you can just use the plain .ISO images with UML.

If you just want a default minimum slackware installation without any hassle just go to http://uml.datux.nl and download the latest UML-image.

Coffee, patience and the ability to think.

The quick and painless way
Download the slackware 9.1 preinstalled image from http://uml.datux.nl , extract it and start UML like this:

psy@phattop:~/uml$ /usr/src/uml-2.4.22/linux ubd1=root_fs ubd2r=/dev/cdrom devfs=nomount root=/dev/ubd11
Checking for the skas3 patch in the host...not found
Checking for /proc/mm...not found
tracing thread pid = 12793
Linux version 2.4.22 (root@phattop) (gcc version 3.2.2) #4 Sun Oct 5 14:13:52 Local time zone must be set--see zic manua
....snip snip....
Tadaaah...you're running a complete virutal linux environment (slackware 9.1) inside of your own Linux enviroment. Nice eh?

If you want to know how it's done read on, otherwise just have fun.

Creating a virtual disk
First we need a virtual disk that we can use as installation target in UML. You could use an existing partion as a target place, but i prefer to use plain files. (because they are easier to copy/move/manage/backup etc..) To create a virtual disk named ?root_fs? type the following command:

psy@phattop:~/uml$ dd if=/dev/zero of=root_fs bs=$((1024*1024)) count=2000
2000+0 records in
2000+0 records out
This will just create a plain empty file of approx. 2gb. This will be the file that we use as our disk and target to install our slackware.

Modifying the original slackware setup disk
Read this chapter if you want to know how to get the slackware installer running under UML or if there is a newer version of slackware you want to use. Otherwise just skip to the next chapter and download a working initrd from http://uml.datux.nl

Getting the original slackware setup-image
We need to get the slackware setup-image that our kernel will use a root filesystem. Normally the installer CDROM is booted from the bios and the root filesystem is automaticly mounted. This image is stored in isolinux/initrd.img. If you use the file command you will see this file is zipped. Copy it to a nice directory and unzip it so that we can work on it. (you need a copy because we will change it!!)

psy@phattop:~/uml$ file /mnt/cdrom/isolinux/initrd.img
/mnt/cdrom/isolinux/initrd.img: gzip compressed data, from Unix, max compression

psy@phattop:~/uml$ cp /mnt/cdrom/isolinux/initrd.img initrd.gz
psy@phattop:~/uml$ gunzip initrd.gz
psy@phattop:~/uml$ file initrd
initrd: Linux rev 1.0 ext2 filesystem data
So now we have a ext2 disk image which contains the root filesystem that is normally used to setup slackware. (it contains the setup program)

Hacking up the slackware setup-image
Lets try to see what happens if we use this initrd setup-image as our root image. Pay attention to how to create the virtual disks:

udb0 will be the installation-image we just unzipped.

udb1 will be the target-image we just created. (root_fs)

udb2 will be our slackware installation CD-ROM (or iso image)

This is what i got:

psy@phattop:~/uml$ /usr/src/uml-2.4.22/linux ubd0=initrd ubd1=root_fs ubd2r=/dev/cdrom devfs=nomount rw
Checking for the skas3 patch in the host...not found
Checking for /proc/mm...not found
tracing thread pid = 8751
Linux version 2.4.22 (root@phattop) (gcc version 3.2.2) #4 Sun Oct 5 14:13:52 Local time zone must be set--see zic manua
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: ubd0=initrd ubd1=root_fs ubd2r=/dev/cdrom devfs=nomount rw root=/dev/ubd0
Calibrating delay loop... 2467.25 BogoMIPS
Memory: 28772k available
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
Checking for host processor cmov support...Yes
Checking for host processor xmm support...No
Checking that ptrace can change system call numbers...OK
Checking that host ptys support output SIGIO...Yes
Checking that host ptys support SIGIO on close...No, enabling workaround
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
VFS: Disk quotas vdquot_6.5.1
Journalled Block Device driver loaded
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x0
JFFS version 1.0, (C) 1999, 2000 Axis Communications AB
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
pty: 256 Unix98 ptys configured
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
PPP generic driver version 2.4.2
Universal TUN/TAP device driver 1.5 (C)1999-2002 Maxim Krasnyansky
SCSI subsystem driver Revision: 1.00
scsi0 : scsi_debug, Version: 0.61 (20020815), num_devs=1, dev_size_mb=8, opts=0x0
Vendor: Linux Model: scsi_debug Rev: 0004
Type: Direct-Access ANSI SCSI revision: 03
blkmtd: error: missing `device' name

Initializing software serial port version 1
mconsole (version 2) initialized on /home/psy/.uml/cJnBNr/mconsole
Partition check:
ubda: unknown partition table
ubdb: unknown partition table
ubdc: unknown partition table
UML Audio Relay (host dsp = /dev/sound/dsp, host mixer = /dev/sound/mixer)
Initializing stdio console driver
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
init started: BusyBox v0.60.5 (2003.02.16-05:06+0000) multi-call binary
proc on /proc type proc (rw)

Site Meter