4 # shell script command line parameter-processing for:
6 # grml-debootstrap - wrapper around debootstrap for installing plain Debian via
10 # @Release: $Revision: 1.3 $, under the BSD license
11 # @HomeURL: http://xpt.sourceforge.net/
14 # @WARNING: Do NOT modify this file without prior contacting the author.
15 # This script is use for the command line *logic* processing. It should be
16 # as dumb as possible. I.e., it should NOT be more complicated than
17 # copy-paste-and-rename from existing code. All *business-logic* processing
18 # should be handled in the main script, where it belongs.
22 _opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:hv --long \
23 mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,help,version \
26 eerror "Try 'grml-debootstrap --help' for more information."; eend 1; exit 1
28 eval set -- "$_opt_temp"
33 # == Bootstrap options
34 --mirror|-m) # Mirror which should be used for apt-get/aptitude.
35 shift; _opt_mirror="$1"
37 --iso|-i) # Mountpoint where a Debian ISO is mounted to, for use instead
40 --release|-r) # Release of new Debian system (default: stable).
41 shift; _opt_release="$1"
43 --target|-t) # Target partition (/dev/...) or directory.
44 shift; _opt_target="$1"
46 --mntpoint|-p) # Mountpoint used for mounting the target system.
47 shift; _opt_mntpoint="$1"
49 --debopt) # Extra parameters passed to the debootstrap.
50 shift; _opt_debopt="$1"
52 --interactive) # Use interactive mode (frontend).
55 --nodebootstrap) # Skip debootstrap, only do configuration to the target.
60 # == Configuration options
61 --config|-c) # Use specified configuration file, defaults to /etc/debootstr
62 shift; _opt_config="$1"
64 --confdir|-d) # Place of config files for debootstrap, defaults to /etc/debo
65 shift; _opt_confdir="$1"
67 --packages) # Install packages defined in <confdir>/packages. Option arg:
68 shift; _opt_packages="$1"
71 --debconf) # Pre-seed packages using <confdir>/debconf-selections. Option
72 shift; _opt_debconf="$1"
75 --keep_src_list) # Do not overwrite user provided apt sources.list.
78 --hostname) # Hostname of Debian system.
79 shift; _opt_hostname="$1"
81 --password) # Use specified password as password for user root.
82 shift; _opt_password="$1"
85 --bootappend) # Add specified appendline to kernel whilst booting.
86 shift; _opt_bootappend="$1"
88 --groot) # Root device for usage in grub, corresponds with $TARGET in g
89 shift; _opt_groot="$1"
91 --grub) # Target for grub installation. Use grub syntax for specifying
96 --help|-h) # Print this usage information and exit.
99 --version|-v) # Show summary of options and exit.
106 eerror "Internal getopt error!"; eend 1 ; exit 1