Package: debian-handbook Severity: wishlist Tags: patch Thomas Goirand <[email protected]> sent me the attached patch to suggest the usage of yum instead of rpmstrap (in the section concerning Xen).
This should be included in the next edition of the book covering wheezy. (It probably applies to the current squeeze version but it's new content and thus should be pushed in the next major edition and not in the already released book) There's some further work to do: <programlisting> should be used instead of <screen> for simple listings, a </para> is missing, indentation is not correct, and some other markup is missing. We should also think about where to best include it. Cheers, -- Raphaël Hertzog ◈ Debian Developer Get the Debian Administrator's Handbook: → http://debian-handbook.info/get/
>From bc528efa1f39a340fc9ab608ac324ac8006b6bd4 Mon Sep 17 00:00:00 2001 From: Thomas Goirand <[email protected]> Date: Sun, 13 May 2012 04:57:00 +0000 Subject: [PATCH] Added notes about bootstraping a virtual machine with Yum. --- en-US/12_advanced-administration.xml | 89 ++++++++++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 9 deletions(-) diff --git a/en-US/12_advanced-administration.xml b/en-US/12_advanced-administration.xml index 5575da7..08b4ed0 100644 --- a/en-US/12_advanced-administration.xml +++ b/en-US/12_advanced-administration.xml @@ -1618,15 +1618,6 @@ Disk identifier: 0x00039a9f <sidebar> <title><emphasis>GOING FURTHER</emphasis> Installing a non-Debian system in a domU</title> - <para>If the Xen image is not meant to run Debian but another - system, another potentially interesting option is - <literal>--rpmstrap</literal>, to invoke - <command>rpmstrap</command> in order to initialize a new - RPM-based system (such as Fedora, CentOS or Mandriva). Other - methods include <literal>--copy</literal>, to copy an image - from an existing system, and <literal>--tar</literal>, to - extract the system image from an archive.</para> - <para>In case of a non-Linux system, care should be taken to define the kernel the domU must use, using the <literal>--kernel</literal> option.</para> @@ -2534,6 +2525,86 @@ root@server's password: </computeroutput> <para>All these subcommands take a virtual machine identifier as a parameter.</para> </section> + <section> + <title>Installting an RPM based system in Debian with yum</title> + <para>If the Xen image is meant to run a Debian (or one of its + derivative), you can use debootstrap to initialize your domU. + But if you need to install an RPM based system (such as Fedora, + CentOS or Scientific Linux), you can use yum directly (yum is + also packaged in Debian).</para> + + <para>To do so, you need to setup a yum.conf file containing + the necessary parameters, including the path to the source RPM + repositories, path to the plugin configuration, and destination + folder. For this example, we will pretend that your environment + will be stored in /var/tmp/yum-bootstrap. The file + /var/tmp/yum-bootstrap/yum.conf file should look like this:</para> + +<screen><userinput>[main] +reposdir=/var/tmp/yum-bootstrap/repos.d +pluginconfpath=/var/tmp/yum-bootstrap/pluginconf.d +cachedir=/var/cache/yum +installroot=/path/to/destination/domU/install +exclude=$exclude +keepcache=1 +#debuglevel=4 +#errorlevel=4 +pkgpolicy=newest +distroverpkg=centos-release +tolerant=1 +exactarch=1 +obsoletes=1 +gpgcheck=1 +plugins=1 +metadata_expire=1800</userinput></screen> + + <para>Inside "/var/tmp/yum-bootstrap/repos.d", you should put the descriptions + of your RPM source repositories, just as in /etc/yum.repo.d in + an already installed RPM-based system. Here is an example for a + CentOS 6 installation:</para> + +<screen><userinput>[base] +name=CentOS-6 - Base +#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os +gpgcheck=1 +gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 + +[updates] +name=CentOS-6 - Updates +#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates +gpgcheck=1 +gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 + +[extras] +name=CentOS-6 - Extras +#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras +gpgcheck=1 +gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 + +[centosplus] +name=CentOS-6 - Plus +#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus +gpgcheck=1 +gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 +</userinput></screen> + + <para>Finally, your pluginconf.d/installonlyn.conf file should contain the + following: +<screen><userinput>[main] +enabled=1 +tokeep=5 +</userinput></screen> + + <para>Once all this is setup, make sure you have rpm + installed properly. Invoke: mkdir -p /var/lib/rpm, then rpm --rebuilddb + to make sure rpm will work. Then to install CentOS 6, do:</para> + +<screen><userinput>yum -c /var/tmp/yum-bootstrap/yum.conf -y install coreutils basesystem centos-release yum-basearchonly initscripts</userinput></screen> + </section> </section> </section> <section id="sect.automated-installation"> -- 1.7.10

