Difference between revisions of "COSI Linux Build"

From CSLabsWiki
(Scripts: Remove obsolete section)
(The Metapackage)
Line 24: Line 24:
   
 
Clone [https://github.com/COSI-Lab/lab_creation.git the repository]. Run make_image.sh as root. It will leave the image in /mnt/something.img.
 
Clone [https://github.com/COSI-Lab/lab_creation.git the repository]. Run make_image.sh as root. It will leave the image in /mnt/something.img.
 
=The Metapackage=
 
== Overview ==
 
The metapackage is nothing but a Debian package (that is, it's installable with apt-get) that itself installs other packages. The idea is that, rather than expend lots of bandwidth and cause premature wear on hard drives by re-cloning every time packages are added to the lab build, each machine can keep itself up to date by reinstalling the metapackage (which itself can be easily updated to contain the new packages).
 
 
== Benefits ==
 
* Cloning takes time and puts strain on the hardware if performed frequently. Using a metapackage, each machine will only perform the minimum amount of work necessary to stay updated, and need not be taken out of commission while cloning occurs.
 
* The metapackage itself is a convenient list of the software composing the lab build.
 
 
== Drawbacks ==
 
* The machines will still have to be cloned if there are non-trivial configuration changes.
 
* Some software is not distributed as a Debian package and cannot be included in the metapackage. Such software must be handled on an individual basis and cloned out if a .deb cannot be created.
 
 
== Metapackage Configuration ==
 
Right now, the metapackage is hosted on web2: <tt>http://lab-build.cslabs.clarkson.edu/apt/</tt>. The directory is: <tt>/var/lab_build-www/apt</tt>.
 
 
=== Setup ===
 
There are two main components of the metapackage system. First is the metapackage itself, which will be created with <tt>dpkg</tt>. Second is the repository, which will be created and managed with <tt>reprepro</tt>.
 
 
=== Creating a Metapackage ===
 
The general idea is to create a directory structure that can be understood by dpkg, then to write the <tt>control</tt> (and <tt>postinst</tt>) files to describe the metapackage. Finally, <tt>dpkg</tt> will be used to create a .deb file.
 
* Create the following directory structure: <pre>../cosi-metapackage-<version>/DEBIAN</pre>
 
* Inside the DEBIAN directory, create file <tt>control</tt>. This textfile will describe the metapackage. A sample control file is given below:
 
<pre>
 
Package: cosi-metapackage
 
Version: <version number>
 
Section: main
 
Priority: optional
 
Architecture: amd64
 
Depends: list, of, packages, to, install, here
 
Conflicts: packages, to, be, removed
 
Replaces: packages, to, be, removed
 
Maintainer: <name>
 
Description: Text describing the package
 
</pre>
 
* To add packages to the metapackage, list them under `Depends'. To ensure that certain packages are not installed, or to remove them, add the package name to BOTH `Conflicts' and `Replaces'.
 
* Create file (<tt>postinst</tt>) in the DEBIAN directory. This file will be executed as a script after all of the packages in `Depends' have been installed. It will be used to configure packages that might not be ready-to-run right after being installed. If any packages need this extra step, add the relevant bash commands to this script. A copy of the current postinst can be found in the scripts section.
 
* Return to the directory two levels above DEBIAN. If you don't, <tt>dpkg</tt> will still work if you give it the relative pathname to directory <tt>cosi-metapackage-<version>/</tt>.
 
* Run <pre>dpkg --build cosi-metapackage-<version>/ cosi-metapackage-<version>.deb</pre>which will create in the working directory the .deb file to added to the repository.
 
 
=== Creating a Repository ===
 
* Create a directory for the repository to use. Inside it, create directory <tt>conf</tt>. Inside that, create file <tt>distributions</tt>.
 
* Fill out the <tt>distributions</tt> file with information defining the repository. A sample (the current distributions file) is given below:
 
<pre>
 
Origin: <maintainer name>
 
Label: COSI Lab Build repository
 
Suite: stable
 
Codename: lucid
 
Version: 10.10
 
Architectures: amd64
 
Components: main
 
Description: Text description
 
</pre>
 
* The `Components' field must match the metapackage .deb's control file, otherwise you won't be able to add it to the repository.
 
* From the base repository directory, run <pre>sudo reprepro includedeb <version> /path/to/cosi-metapackage-<version>.deb</pre>
 
* If all goes well, you can now point the <tt>sources.list</tt> file to the base repository directory, and be able to install the metapackage using apt.
 
* If a package must be removed from the repository, run<pre>sudo reprepro remove <version> <packagename></pre>
 
 
 
[[Category:Lab Builds]]
 

Revision as of 16:14, 21 October 2013

Introduction

This page summarizes how to set up and maintain the COSI Lab Build.

The Lab Build is based off of Arch Linux. We use a read-only network drive over NBD. The disk image is created automatically with a script. It uses standard packages with custom configuration that is automatically applied.

Project Members

Current Maintainer

Past Maintainers

Requests

To make requests for the lab build, the preferred method is writing a message on the whiteboard in the space allocated for this purpose. Alternatively, email the maintainer, or open a pull request on the script.

Requests for packages which are in the repositories are very likely to succeed, as well as anything in the AUR. Changes requiring significant configuration are going to take longer.

Initial Configuration

Installation

Here are the steps to setting up the lab build. I will assume that the host has /dev/sda3 formatted to an empty filesystem with significant (>22G) free space. It also assumes that the arch-install-scripts are available.

Clone the repository. Run make_image.sh as root. It will leave the image in /mnt/something.img.