+# cmdline handling {{{
+usage() {
+ einfo "$0 - version $VERSION"
+ echo " A wrapper around debootstrap for installing plain Debian via grml"
+ echo
+ einfo "Usage: $0 [options]"
+ echo " Adjust /etc/debootstrap/config and invoke $0 afterwards or use the cmdline option:"
+ echo
+ einfo "Valid options:"
+ echo "
+ -h|--help Print this usage information and exit.
+ -v|--version Show summary of options and exit.
+
+ -t|--target <target> Target partition (/dev/...) or directory.
+ -r|--release <release> Specify release of new Debian system. Supported relases: sarge, etch, lenny and sid.
+ -m|--mirror <URL> Specify mirror which should be used for apt-get/aptitude.
+ -p|--mntpoint <mnt> Specify mountpoint that should be used for mounting the target system.
+ --groot <device> Specify root device for usage in grub (corresponds with \$TARGET).
+ --grub <device> Where do you want to install grub to? Use grub syntax for specifying.
+ --password <pwd> Use specified password as password for user root. Use with caution.
+ --boot_append <appendline> Add specified appendline to kernel whilst booting
+
+"
+}
+
+while [ "$#" -gt "0" ] ; do
+ case $1 in
+ -v|--version)
+ einfo "$0 - version $VERSION"
+ einfo "Send bug reports to Michael Prokop <mika@grml.org>."
+ eend 0
+ exit 0
+ ;;
+ -t|--target)
+ shift
+ TARGET=$1
+ ;;
+ --grub)
+ shift
+ GRUB=$1
+ ;;
+ --groot)
+ shift
+ GROOT=$1
+ ;;
+ --release)
+ shift
+ RELEASE=$1
+ ;;
+ -p|--mntpoint)
+ shift
+ MNTPOINT=$1
+ ;;
+ --password)
+ shift
+ ROOTPASSWORD=$1
+ ;;
+ -m|--mirror)
+ shift
+ MIRROR=$1
+ CHROOTMIRROR=$1
+ ;;
+ -h|--help)
+ usage ; eend 0
+ eend 0
+ exit 0
+ ;;
+ *)
+ eerror "Syntax error."
+ usage ; eend 1
+ exit 1
+ ;;
+ esac
+ shift
+done
+# }}}
+