Execute freshclam only if class FRESHCLAM is set
[grml-live.git] / docs / grml-live.txt
index c9c7371..1c6a0e7 100644 (file)
@@ -10,9 +10,10 @@ Linux Live system (CD/ISO)
 Synopsis
 --------
 
-grml-live [-a <architecture>] [-c <classe[s]>] [-C <configfile>] [-g
-<grml_name>] [-i <iso_name> ] [-o <output_directory>] [-r <release_name>] [-s
-<suite>] [-t <template_directory>] [-v <version_number>] [-U <username>] [
+grml-live [-a <architecture>] [-c <classe[s]>] [-C <configfile>] [
+-e <extract_iso_name>] [-g <grml_name>] [-i <iso_name>] [
+-o <output_directory>] [-r <release_name>] [-s <suite>] [
+-t <template_directory>] [-v <version_number>] [-U <username>] [
 -AbBFnNqQuVz]
 
 Description
@@ -53,8 +54,8 @@ Options
 
   -A::
 
-Clean up output directories before attempting the build. Packs the chroot
-into a tar archive, and removes chroot and ISO build directories before exiting.
+Clean up all output directories before running the build process. After finishing,
+clean up the Chroot target and Build target directories.
 
   -a **ARCHITECTURE**::
 
@@ -132,6 +133,11 @@ grml-live this option provides you the option to use your own configuration
 directory. This directory is what's being referred to as ${GRML_FAI_CONFIG}
 throughout this documentation.
 
+  -e **EXTRACT_ISO_NAME**::
+
+The squashfs inside the specified ISO will be extracted and used as the chroot.
+This option is useful for remastering, in combination with -A and -b or -u.
+
   -F::
 
 Force execution and do not prompt for acknowledgment of configuration.
@@ -199,20 +205,15 @@ Specify name of the release.
 
 Specify the Debian suite you want to use for your live-system.  Defaults to
 "squeeze" (being current Debian/stable). Supported values are: etch, lenny,
-squeeze, sid. Debian "squeeze" requires a recent base.tgz
-(${GRML_FAI_CONFIG}/config/basefiles/$CLASSNAME.tar.gz) or a recent version of
-debootstrap.
+squeeze, wheezy, sid. Please be aware that recent Debian suites might require a
+recent base.tgz (${GRML_FAI_CONFIG}/config/basefiles/$CLASSNAME.tar.gz) or a
+recent version of debootstrap.
 
   -t **TEMPLATE_DIRECTORY**::
 
 Specify place of the templates used for building the ISO. By default
 (and if not manually specified) this is /usr/share/grml-live/templates/.
 
-  -T **CHROOT_ARCHIVE**::
-
-Unpack chroot tar archive before starting. Most useful in combination with
--A and -b or -u.
-
   -u::
 
 Update existing chroot instead of rebuilding it from scratch. This option is
@@ -251,12 +252,10 @@ system:
 
 [NOTE]
 
-If you have enough free space inside /dev/shm (being a tmpfs, usually you should
-have >=1GB of RAM) just run "mount -o remount,suid,dev,rw /dev/shm" and use
-/dev/shm as build and output directory - resulting in very fast build process.
-But please be aware of the fact that rebooting your system will result in an
-empty /dev/shm, so please use another directory for $CHROOT_OUTPUT,
-$BUILD_OUTPUT and $ISO_OUTPUT if you plan to create more persistent output. :)
+If you have enough RAM, just run "mount -t tmpfs none /media/ramdisk" to get a
+tmpfs ("RAMDISK"), and use /media/ramdisk as build and output directory - this
+results in a very fast build process. Note that these files will be gone when
+rebooting.
 
 [[main-features]]
 Main features of grml-live
@@ -319,6 +318,10 @@ selected. The following classes are predefined:
 
 * DEBORPHAN: get rid of all packages listed in output of deborphan
 
+* FRESHCLAM: execute freshclam (if it's present) to update clamav definitions
+(increases resulting ISO size ~70MB). By default it's skipped to avoid bigger
+ISO size.
+
 * GRMLBASE: the main class responsible for getting a minimal subset of what's
 defining a Grml system. Important parts of the buildprocess are specified in
 this class as well, so unless you have a really good reason you should always
@@ -401,16 +404,6 @@ GRML_FAI_CONFIG=/etc/grml/fai/config - both pointing to a directory shipped by
 grml-live out-of-the-box so you shouldn't have to configure anything in this
 file.
 
-  ${GRML_FAI_CONFIG}/make-fai-nfsroot.conf
-
-This file is used by make-fai-nfsroot(8) only. Usually you don't have to change
-anything inside this file. If you want to modify NFSROOT though you can adjust
-it there.
-
-  ${GRML_FAI_CONFIG}/NFSROOT
-
-This file specifies the package list for creating the NFSROOT.
-
   ${GRML_FAI_CONFIG}/config/
 
 The main directory for configuration of FAI/grml-live. More details below.
@@ -478,8 +471,7 @@ temporary files), if you plan to use GRML_FULL you should have at least 4GB of
 total free disk space
 
 * fast network access for retrieving the Debian packages used for creating the
-chroot (check out "local mirror" and "NFSROOT" to workaround this problem as far
-as possible)
+chroot (check out "local mirror" to workaround this problem as far as possible)
 
 For further information see next section.
 
@@ -504,7 +496,8 @@ The easiest way to get a running grml-live setup is to just use Grml.
 Of course using grml-live on a plain, original Debian installation is supported
 as well. So there we go.
 
-What we have: plain, original Debian squeeze (6.0).
+What we have: plain, original Debian squeeze (6.0) with debian-backports
+enabled. (This is important for squashfs-tools.)
 
 What we want: build a Grml ISO based on Debian/wheezy for the amd64 architecture
 using grml-live.
@@ -524,17 +517,6 @@ Instructions
   # deb-src http://deb.grml.org/ grml-testing main
   EOF
 
-  # adjust apt-pinning (only prefer squashfs stuff from grml):
-  cat >> /etc/apt/preferences << EOF
-  Package: *
-  Pin: origin deb.grml.org
-  Pin-Priority: 1
-
-  Package: squashfs-tools
-  Pin: origin deb.grml.org
-  Pin-Priority: 996
-  EOF
-
   # get keyring for apt:
   apt-get update
   apt-get --allow-unauthenticated install grml-debian-keyring
@@ -542,12 +524,12 @@ Instructions
   # optionally(!) install basefile so we don't have to build basic
   # chroot from scratch, grab from http://daily.grml.org/
   # mkdir -p /etc/grml/fai/config/basefiles/
-  # mv base.tgz /etc/grml/fai/config/basefiles/I386.tar.gz
-  # mv base64.tgz /etc/grml/fai/config/basefiles/AMD64.tar.gz
+  # mv I386.tar.gz /etc/grml/fai/config/basefiles/
+  # mv AMD64.tar.gz /etc/grml/fai/config/basefiles/
 
   # install relevant tools
-  # please check out http://grml.org/grml-live/#current_state when encountering problems!
-  apt-get -o APT::Install-Recommends=false install grml-live squashfs-tools
+  apt-get install -t squeeze-backports squashfs-tools
+  apt-get --no-install-recommends install grml-live
 
   # adjust grml-live configuration for our needs:
   cat > /etc/grml/grml-live.local << EOF
@@ -627,7 +609,7 @@ Can I use my own (local) Debian mirror?
 
 Yes. Set up an according sources.list configuration as class file in
 ${GRML_FAI_CONFIG}/config/files/etc/apt/sources.list.d/ and adjust the variable
-FAI_DEBOOTSTRAP (if not already using NFSROOT's base.tgz) inside
+FAI_DEBOOTSTRAP (if not already using a base.tgz) inside
 /etc/grml/grml-live.conf[.local]. If you're setting up your own class file don't
 forget to include the class name in the class list (grml-live -c ...).
 
@@ -667,44 +649,29 @@ what you are searching for just run:
   dpkg -i --force-confnew --force-confmiss /path/to/grml-live_..._all.deb
 
 [[create-a-base-tgz]]
-How do I create a base.tgz for use as NFSROOT?
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-First of all build the chroot system:
-
-  mkdir /tmp/nfsroot && cd /tmp/nfsroot
-  debootstrap squeeze /tmp/nfsroot/ http://cdn.debian.net/debian
-  tar zcf base.tgz ./
-
-Then check out where your NFSROOT is located:
-
-  # grep '^NFSROOT' /etc/grml/fai/make-fai-nfsroot.conf
-  NFSROOT=/grml/fai/nfsroot
-
-So as /grml/fai/nfsroot is your NFSROOT place the file under
-/grml/fai/nfsroot/live/filesystem.dir/var/tmp/:
+How do I create a base.tgz?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-  mv base.tgz /grml/fai/nfsroot/live/filesystem.dir/var/tmp/base.tgz
+First of all create the chroot using debootstrap:
 
-or even better use /etc/grml/fai/config/basefiles/$CLASSNAME.tar.gz instead.
-Use I386 as $CLASSNAME for i386 builds and AMD64 for amd64 builds.
+  BASECHROOT='/tmp/basefile'
+  debootstrap wheezy "$BASECHROOT" http://http.debian.net/debian
+  tar -C "$BASECHROOT" --exclude='var/cache/apt/archives/*.deb' -zcf base.tar.gz ./
 
-Now running "grml-live ..." will use this file as main system instead of
-executing debootstrap. Check out the output for the following lines if using
-NFSROOT:
+[TIP]
+By default debootstrap builds a chroot matching the architecture of the running
+host system. If you're using an amd64 system and want to build an i386 base.tgz
+then invoke debootstrap using the '--arch i386' option. Disclaimer: building an
+AMD64 base.tgz won't work if you are using a 32bit kernel system of course.
 
-  [...]
-  Calling task_extrbase
-  Unpacking Debian base archive
-  Extracting /grml/fai/nfsroot/live/filesystem.dir/var/tmp/base.tgz
-  Calling task_mirror
-  [...]
+Then move the base.tar.gz to /etc/grml/fai/config/basefiles/$CLASSNAME.tar.gz.
+Use e.g. I386 as $CLASSNAME for i386 chroots and AMD64 for amd64 chroots.
 
-or if using /etc/grml/fai/config/basefiles/$CLASSNAME.tar.gz for:
+Now executing grml-live should use this file as base system instead of executing
+debootstrap. Check out the output for something like:
 
   [...]
-  ftar: extracting /etc/grml/fai/config/basefiles///AMD64.tar.gz to
-  /grml-live/grml-live_20071029.22138/grml_chroot//
+  ftar: extracting //etc/grml/fai/config/basefiles///AMD64.tar.gz to /srv/grml64_testing/grml_chroot//
   [...]
 
 [TIP]
@@ -758,49 +725,6 @@ And finally place the generated tarball in /etc/grml/fai/config/basefiles/ (note
 that it needs to be uppercase letters matching the class names, so: AMD64.tar.gz
 for amd64 and I386.tar.gz for i386).
 
-[[autobuild]]
-How do I set up an autobuild environment?
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you want to set up a system like link:http://daily.grml.org/[daily.grml.org]
-the Debian package grml-live-buildd provides all you need to start. Start with
-figuring out the cron job script /usr/share/grml-live/buildd/cronjob.sh.
-
-If you want to automatically update the grml-live Debian package on your build
-system based on the git tree of grml-live (so you get bleeding edge of
-development which might is interesting for services like daily.grml.org) the
-provided release_helper.sh script provides everything you need. Execute as root:
-
-  echo "deb file:/home/grml-live-git/grml-live.build-area/ ./" >> /etc/apt/sources.list.d/grml-live.list
-  adduser --disabled-login --disabled-password grml-live-git
-
-Execute 'visudo' to update sudo configuration and add the following line:
-
-  grml-live-git ALL=NOPASSWD: /usr/bin/apt-get
-
-Switch to user grml-live-git and configure the rest:
-
-  su - grml-live-git
-  mkdir grml-live.build-area
-  git clone git://git.grml.org/grml-live.git
-  git config --global user.name "Grml-Live Git Autobuild"
-  git config --global user.email "grml-live-git@$(hostname)"
-
-Finally install a cron job (as user grml-live-git) like:
-
-  30 00 * * * cd /home/grml-live-git/grml-live.git/ && env AUTOBUILD=1 scripts/release_helper.sh >/home/grml-live-git/grml-live-build.log
-
-Tip: To find out the build date of the installed grml-live package just execute:
-
-  % apt-cache policy grml-live | grep 'Installed.*autobuild'
-   Installed: 0.13.1~autobuild1300450381
-
-and run "date -ud @$STRING" where $STRING is the number behind the "autobuild",
-like:
-
-  % date -ud @1300450081
-  Fri Mar 18 12:08:01 UTC 2011
-
 [[download]]
 Download / install grml-live as a Debian package
 ------------------------------------------------