+++ /dev/null
-TODO for grml-live
-==================
-
-* make all references to "grml" (hostname, usersetup,...) configurable
-* replace 192.168.... mirrors with something generic and make it configurable
-* provide buildprocess for boot/isolinux stuff
dh_testdir
dh_testroot
dh_clean -k
- dh_installdirs etc/grml/fai/live-initramfs
+ dh_installdirs etc/grml/fai/live-initramfs usr/sbin
# Add here commands to install the package into debian/grml-live.
cp -a etc debian/grml-live/
- install -m 755 initramfs/scripts/init-top/grml debian/grml-live/etc/grml/fai/live-initramfs/grml
+ install -o root -m 755 grml-live debian/grml-live/usr/sbin/grml-live
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
- dh_installdocs TODO docs/grml-live.html
+ dh_installdocs docs/grml-live.html
dh_installexamples
dh_installman docs/grml-live.8
dh_link
packages you would like to include on your very own live-cd without having to
deal with all the details in the core of the system.
+Please notice that you should have a fast network connection as all the Debian
+packages will be installed via network. If you want to use a local mirror
+checkout
+link:http://www.informatik.uni-koeln.de/fai/download/mkdebmirror[mkdebmirror]
+and debmirror.
+
How to get your own live-cd - the easy, fast and simple way
-----------------------------------------------------------
To get a small, Debian-stable and grml based live-cd:
- # TARGET="/grml/chroot/grml_uncompressed" ; mkdir -p $TARGET
+ # export LANG=C ; export LC_MESSAGES=C
+ # TARGET="/grml/chroot/grml_uncompressed"
+ # CDDIR="/grml/chroot/grml_cd"
+ # mkdir -p $TARGET
+
# fai -v -C /etc/grml/fai -cGRML dirinstall $TARGET
- # mksquashfs $TARGET/* /grml/chroot/grml_cd/live/grml.squashfs -noappend
- # cd /grml/chroot/grml_cd/
+ # mksquashfs $TARGET/* $CDDIR/live/grml.squashfs -noappend
+ # cd $CDDIR
# mkisofs -V "my personal grml" -l -r -J -no-emul-boot -boot-load-size 4 \
-boot-info-table -c boot/isolinux/boot.cat \
-b boot/isolinux/isolinux.bin -o /grml/grml.iso .
FAI_CONFIGDIR=/etc/grml/fai/config, a directory shipped by grml-live
out-of-the-box so you shouldn't have to configure anything in this file.
+ /etc/grml/fai/make-fai-nfsroot.conf
+
+TODO
+
+ /etc/grml/fai/NFSROOT
+
+TODO
+
+ /etc/grml/fai/apt/sources.list
+
+This file specifies which mirrors should be used for retreiving the Debian
+packages used for creating the ISO. If you want to use a local mirror you have
+to adjust this file.
+
/etc/grml/fai/config/
The main directory for configuration of FAI/grml-live. More details below.
/etc/grml/fai/config/debconf/
-This directory provides the files for presseding/configuration of debconf
+This directory provides the files for preseeding/configuration of debconf
through files.
/etc/grml/fai/config/hooks/
/etc/grml/fai/config/package_config/
File with lists of software packages to be installed or removed. The different
-classes describe what should find its way to your ISO. When running 'fai -v
--cGRML dirinstall ...' only the files from the directory GRML/ will be taken, if
-you use 'fai -v -cGRML,FOOBAR dirinstall ...' then the files of GRML/ **plus**
-the files from FOOBAR/ will be taken. So just create a new class to adjust it to
-your needs. Please notice that the directory GRML contains a package list
-defining a minimum but still reasonable package configuration.
+classes describe what should find its way to your ISO. When running 'fai -v -C
+/etc/grml/fai -cGRML dirinstall ...' only the files from the directory GRML/
+will be taken, if you use 'fai -v -C /etc/grml/fai -cGRML,FOOBAR dirinstall ...'
+then the files of GRML/ **plus** the files from FOOBAR/ will be taken. So just
+create a new class to adjust it to your needs. Please notice that the directory
+GRML contains a package list defining a minimum but still reasonable package
+configuration.
/etc/grml/fai/config/scripts/
Scripts for customising the ISO within build process.
+ /etc/grml/fai/live-initramfs/
+
+This directory provides the files used for building the initramfs/initrd via
+live-initramfs(8).
+
+TODO
+----
+
+* provide a wrapper script which runs all the necessary command in a single run
+(named grml-live plus configuration file /etc/grml/grml-live.conf)
+
+* replace 192.168.... inside the configuration files for the Debian mirro with
+something generic and make it configurable
+
+* provide buildprocess for boot/isolinux stuff
+
+* explain and provide configuration for use of NFSROOT
+
Bugs
----
-Please report feedback, link:http://grml.org/bugs/[bugreports] and wishes link:http://grml.org/contact/[to us]!
+
+Please report feedback, link:http://grml.org/bugs/[bugreports] and wishes
+link:http://grml.org/contact/[to the grml-team]!
Authors
-------
Michael Prokop <mika@grml.org>.
+
--- /dev/null
+#!/bin/sh
+set -u
+set -e
+
+HOSTNAME=''
+[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
+[ -n "$HOSTNAME" ] || HOSTNAME=grml
+
+echo "$HOSTNAME" > "$target"/etc/hostname
set -u
set -e
+cp /etc/grml/fai/live-initramfs/live.conf "$target/etc/live.conf"
FILE=$(ls -1 "$target"/boot/vmlinuz-* | sort -r | head -1)
KERNELVERSION=$(echo "${FILE##$target/boot/vmlinuz-}")
chroot $target update-initramfs -c -t -k $KERNELVERSION
--- /dev/null
+#!/bin/sh
+set -u
+set -e
+
+if grep -q "small" "$target"/etc/grml_version ; then
+ cp "$target"/etc/runlevel.conf.livecd.small "$target"/etc/runlevel.conf
+else
+ cp "$target"/etc/runlevel.conf.livecd "$target"/etc/runlevel.conf
+fi
set -u
set -e
+USERNAME=''
+[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
+[ -n "$USERNAME" ] || USERNAME=grml
+
cat > "$target"/etc/sudoers << EOF
# sudoers file.
# This file MUST be edited with the "visudo" command as root.
# User privilege specification
root ALL=(ALL) ALL
-# WARNING: This allows the unprivileged grml user to start commands as root
-# WARNING: This is totally insecure and (almost) makes grml a second root account.
-# WARNING: Never allow external access to the grml user!!!
-grml ALL=NOPASSWD: ALL
+# WARNING: This allows the unprivileged $USERNAME user to start commands as root
+# WARNING: This is totally insecure and (almost) makes $USERNAME a second root account.
+# WARNING: Never allow external access to the $USERNAME user!!!
+$USERNAME ALL=NOPASSWD: ALL
# allow editing of files with editor:
-# grml ALL=NOPASSWD: sudoedit
+# $USERNAME ALL=NOPASSWD: sudoedit
# usage examples:
-# grml ALL=NOPASSWD: /sbin/hdparm
-# grml ALL=NOPASSWD: /usr/sbin/hwinfo
+# $USERNAME ALL=NOPASSWD: /sbin/hdparm
+# $USERNAME ALL=NOPASSWD: /usr/sbin/hwinfo
# Cmnd_Alias DEBIAN = /usr/bin/apt-get, /usr/bin/dpkg, /usr/bin/auto-apt, /usr/bin/apt-file
-# grml ALL=NOPASSWD: DEBIAN
+# $USERNAME ALL=NOPASSWD: DEBIAN
# chroot ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
# chroot ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
set -u
set -e
-chroot "$target" addgroup --gid 1000 grml
-chroot "$target" useradd -d /home/grml -m -s /bin/zsh -g 1000 grml
+USERNAME=''
+[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
+[ -n "$USERNAME" ] || USERNAME=grml
+
+chroot "$target" addgroup --gid 1000 $USERNAME
+chroot "$target" useradd -d /home/$USERNAME -m -s /bin/zsh -g 1000 $USERNAME
sed -i 's/^root::/root:*:/' "$target"/etc/shadow
-sed -i 's/^grml::/grml:*:/' "$target"/etc/shadow
+sed -i 's/^$USERNAME::/$USERNAME:*:/' "$target"/etc/shadow
chroot "$target" chsh -s /bin/zsh root
-chroot "$target" chsh -s /bin/zsh grml
+chroot "$target" chsh -s /bin/zsh $USERNAME
set -u
set -e
+USERNAME=''
+[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
+[ -n "$USERNAME" ] || USERNAME=grml
+
cat > "$target"/etc/fstab << EOF
# /etc/fstab - static file system information
# <filesystem> <mountpoint> <type> <options> <dump> <pass>
sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0
devpts /dev/pts devpts noauto,mode=0622 0 0
/dev/fd0 /mnt/floppy auto users,noauto,exec 0 0
-/dev/external /mnt/external auto users,noauto,exec,rw,uid=grml,gid=grml 0 0
-/dev/external1 /mnt/external1 auto users,noauto,exec,rw,uid=grml,gid=grml 0 0
+/dev/external /mnt/external auto users,noauto,exec,rw,uid=$USERNAME,gid=$USERNAME 0 0
+/dev/external1 /mnt/external1 auto users,noauto,exec,rw,uid=$USERNAME,gid=$USERNAME 0 0
/dev/cdrom /mnt/cdrom auto users,noauto,exec,ro 0 0
/dev/dvd /mnt/dvd auto users,noauto,exec,ro 0 0
# some other examples:
set -u
set -e
+HOSTNAME=''
+[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
+[ -n "$HOSTNAME" ] || HOSTNAME=grml
+
cat > "$target"/etc/hosts << EOF
-127.0.0.1 grml localhost
+127.0.0.1 $HOSTNAME localhost
# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)
-::1 ip6-localhost ip6-loopback grml
+::1 ip6-localhost ip6-loopback $HOSTNAME
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
+++ /dev/null
-# grub menu.lst for fai-cd
-
-# Boot automatically after some secs.
-timeout 30
-
-color light-gray/black light-gray/red
-default 6
-
-title |
-root (cd)
-title +------------------------------------------------------+
-root (cd)
-title | FAI-CD (c) 2006, Thomas Lange, lange@debian.org |
-root (cd)
-title | _VERSIONSTRING_ |
-root (cd)
-title +------------------------------------------------------+
-root (cd)
-title |
-root (cd)
-title |
-
-title boot from local disk
-rootnoverify (hd0)
-chainloader +1
-
-title Fully Automatic Installation - demohost (pw: installme)
-password installme
-kernel /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=install ip=192.168.1.1:::::eth0:off hostname=demohost
-initrd /boot/initrd.img
-
-title Fully Automatic Installation with GNOME (pw: installme)
-password installme
-kernel /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=install ip=192.168.1.1:::::eth0:off hostname=gnomehost
-initrd /boot/initrd.img
-
-title Fully Automatic Installation - faiserver (pw: installme)
-password installme
-kernel /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=install ip=192.168.1.250::192.168.1.254:255.255.255.0::xxx:off hostname=faiserver
-initrd /boot/initrd.img
-
-title FAI rescue system, no installation
-kernel /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=sysinfo ip=192.168.1.1:::::eth0:off hostname=demohost
-initrd /boot/initrd.img
--- /dev/null
+# Filename: /etc/grml/grml-live.conf
+# Purpose: main configuration file for grml-live
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sat Sep 15 17:02:32 CEST 2007 [mika]
+################################################################################
+
+# unless this variable is set, grml-live won't execute anything!
+# so set it to '1' if you want to use grml-live
+EXECUTE=1
+
+# output directory of the buildprocess files (the chroot),
+# notice that you need suid,dev,rw permissions there:
+TARGET="/dev/shm/fai" # FIXME / TODO
+# mount -o remount,suid,dev,rw /dev/shm
+
+# which FAI classes do you want to use by default?
+CLASSES="GRML"
+
+# directory of configuration files for FAI:
+FAI_CONFIG=/etc/grml/fai
+
+# specify hostname of the live-system:
+HOSTNAME=grml
+
+# specify user with UID 1000 on live-system:
+USERNAME=grml
+
+# do you want to pass any additional arguments to FAI?
+FAI_ARGS=""
+
+## END OF FILE #################################################################
--- /dev/null
+#!/bin/sh
+# Filename: grml-live
+# Purpose: build process script for generating a (grml based) Linux Live-ISO
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sat Sep 15 18:22:07 CEST 2007 [mika]
+################################################################################
+
+# read configuration files, set some misc variables {{{
+
+# exit on any error:
+set -e
+
+# we need root permissions for the build-process:
+if [ "$(id -u 2>/dev/null)" != 0 ] ; then
+ echo "Error: please run this script with uid 0 (root)." >&2
+ exit 1
+fi
+
+VERBOSE=''
+FORCE=''
+DEBUG=''
+
+# source main configuration file:
+. /etc/grml/grml-live.conf
+
+PN=$(basename $0)
+TMPFILE=$(mktemp)
+# }}}
+
+# clean exit {{{
+bailout() {
+ rm -f "$TMPFILE"
+ [ -n "$1" ] && EXIT="$1" || EXIT="1"
+ [ -n "$2" ] && echo "$2">&2
+ exit "$EXIT"
+}
+trap bailout 1 2 3 15
+# }}}
+
+# check for important variables {{{
+[ -n "$FAI_CONFIG" ] || FAI_CONFIG=/etc/grml/fai
+[ -n "$HOSTNAME" ] || HOSTNAME=grml
+[ -n "$USERNAME" ] || USERNAME=grml
+[ -n "$CLASSES" ] || CLASSES="GRML"
+[ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting."
+# }}}
+
+# usage information {{{
+usage()
+{
+ echo "
+$PN - build process script for generating a (grml based) Linux Live-ISO
+
+Usage: $PN [-c <classe[s]>] [-t <target_directory>] [-F] [-h|--help] [addiontalarguments_for_fai]
+
+Usage examples:
+
+ $PN
+ $PN -c GRML -t /dev/shm/grml
+ $PN -c GRML,GRML_X -t /grml/chroot/grml_uncompressed
+ $PN -c GRML
+
+More details: man grml-live
+ /usr/share/doc/grml-live/grml-live.html
+
+Please send your bug reports, feedback,.. to the grml-team.
+http://grml.org/bugs/
+"
+}
+# }}}
+
+# command line parsing {{{
+
+while getopts ?c:f:t:Fhv: opt; do
+ case "$opt" in
+ c) CLASSES="$OPTARG" ;;
+ F) FORCE=1 ;;
+ h) usage ; bailout 0 ;;
+ t) TARGET="$OPTARG" ;;
+ v) VERBOSE=1 ;;
+ ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;;
+ esac
+done
+shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter
+FAI_ARGS="$*"
+
+# }}}
+
+# some misc checks before executing FAI {{{
+[ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in /etc/grml/grml-live.conf or
+specify it on the command line using the -c|--classes option."
+[ -n "$TARGET" ] || bailout 1 "Error: \$TARGET unset, please set it in /etc/grml/grml-live.conf or
+specify it on the command line using the -t|--target option."
+
+if [ "$EXECUTE" != '1' ] ; then
+ echo "Error: please set EXECUTE=1 in /etc/grml/grml-live.conf to really execute grml-live.">&2
+ echo
+ echo "See 'man grml-live' for more details or execute '$PN --help'">&2
+ echo
+ bailout 1
+fi
+# }}}
+
+# ask user whether the setup is ok {{{
+if [ -z "$FORCE" ] ; then
+ echo
+ echo "$PN - check your configuration (or invoke using -F to force execution without prompting)"
+ echo
+ echo " FAI classes: $CLASSES"
+ echo " target / output directory: $TARGET"
+ [ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS"
+ echo
+ echo -n "Is this ok for you? [y/N] "
+ read a
+ if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
+ bailout 1 "Exiting as requested."
+ fi
+ echo
+fi
+# }}}
+
+# execute FAI {{{
+echo fai -v -C "$FAI_CONFIG" -c"$CLASSES" dirinstall "$TARGET" $FAI_ARGS
+# }}}
+
+## END OF FILE #################################################################
+# vim:foldmethod=marker ts=2 ft=sh ai expandtab tw=80 sw=2