4 # shell script command line parameter-processing for:
6 # grml-debootstrap - wrapper around debootstrap for installing plain Debian via
10 # @Release: $Revision: $, under the BSD license
11 # @HomeURL: http://xpt.sourceforge.net/
16 -o +m:i:r:t:p:c:hv --long \
17 mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,config:,packages::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,help,version \
23 # == Bootstrap options
24 --mirror|-m) # Mirror which should be used for apt-get/aptitude.
25 shift; _opt_mirror="$1"
27 --iso|-i) # Mountpoint where a Debian ISO is mounted to, for use instead
30 --release|-r) # Release of new Debian system (default: stable).
31 shift; _opt_release="$1"
33 --target|-t) # Target partition (/dev/...) or directory.
34 shift; _opt_target="$1"
36 --mntpoint|-p) # Mountpoint used for mounting the target system.
37 shift; _opt_mntpoint="$1"
39 --debopt) # Extra parameters passed to the debootstrap.
40 shift; _opt_debopt="$1"
42 --interactive) # Use interactive mode (frontend).
47 # == Configuration options
48 --config|-c) # Use specified configuration file, defaults to /etc/debootstr
49 shift; _opt_config="$1"
51 --packages) # Install packages defined in /etc/debootstrap/packages. Optio
52 shift; _opt_packages="$1"
55 --debconf) # Pre-seed packages using /etc/debootstrap/debconf-selections.
56 shift; _opt_debconf="$1"
59 --keep_src_list) # Do not overwrite user provided apt sources.list.
62 --hostname) # Hostname of Debian system.
63 shift; _opt_hostname="$1"
65 --password) # Use specified password as password for user root.
66 shift; _opt_password="$1"
69 --bootappend) # Add specified appendline to kernel whilst booting.
70 shift; _opt_bootappend="$1"
72 --groot) # Root device for usage in grub, corresponds with $TARGET in g
73 shift; _opt_groot="$1"
75 --grub) # Target for grub installation. Use grub syntax for specifying
80 --help|-h) # Print this usage information and exit.
83 --version|-v) # Show summary of options and exit.
90 eerror "Internal getopt error!"; eend 1 ; exit 1
97 [ "$_opt_debug" ] && {
98 echo "[grml-debootstrap] debug: _opt_mirror=$_opt_mirror"
99 echo "[grml-debootstrap] debug: _opt_iso=$_opt_iso"
100 echo "[grml-debootstrap] debug: _opt_release=$_opt_release"
101 echo "[grml-debootstrap] debug: _opt_target=$_opt_target"
102 echo "[grml-debootstrap] debug: _opt_mntpoint=$_opt_mntpoint"
103 echo "[grml-debootstrap] debug: _opt_debopt=$_opt_debopt"
104 echo "[grml-debootstrap] debug: _opt_interactive=$_opt_interactive"
105 echo "[grml-debootstrap] debug: _opt_config=$_opt_config"
106 echo "[grml-debootstrap] debug: _opt_packages=$_opt_packages"
107 echo "[grml-debootstrap] debug: _opt_debconf=$_opt_debconf"
108 echo "[grml-debootstrap] debug: _opt_keep_src_list=$_opt_keep_src_list"
109 echo "[grml-debootstrap] debug: _opt_hostname=$_opt_hostname"
110 echo "[grml-debootstrap] debug: _opt_password=$_opt_password"
111 echo "[grml-debootstrap] debug: _opt_bootappend=$_opt_bootappend"
112 echo "[grml-debootstrap] debug: _opt_groot=$_opt_groot"
113 echo "[grml-debootstrap] debug: _opt_grub=$_opt_grub"
114 echo "[grml-debootstrap] debug: _opt_help=$_opt_help"
115 echo "[grml-debootstrap] debug: _opt_version=$_opt_version"
118 if [ "$_opt_check_failed" ]; then
119 eerror "Not all mandatory options are set."; eend 1 ; exit 1