f3b4a78b7d7dc7db2699f92deef69241e5fb5170
[grml-debootstrap.git] / grml-debootstrap.clp
1 # -*- shell-script -*-
2
3 #
4 # shell script command line parameter-processing for:
5 #
6 # grml-debootstrap - wrapper around debootstrap for installing plain Debian via
7 # grml
8 #
9 # @Author:  Tong SUN
10 # @Release: $Revision: 1.1 $, under the BSD license
11 # @HomeURL: http://xpt.sourceforge.net/
12 #
13
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.
19
20
21
22 eval set -- `getopt \
23   -o +m:i:r:t:p:c:hv --long \
24     mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,config:,packages::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,help,version \
25   -- "$@"`
26
27 while :; do
28   case "$1" in
29
30   # == Bootstrap options
31   --mirror|-m)         # Mirror which should be used for apt-get/aptitude.
32     shift; _opt_mirror="$1"
33     ;;
34   --iso|-i)            # Mountpoint where a Debian ISO is mounted to, for use instead
35     shift; _opt_iso="$1"
36     ;;
37   --release|-r)        # Release of new Debian system (default: stable).
38     shift; _opt_release="$1"
39     ;;
40   --target|-t)         # Target partition (/dev/...) or directory.
41     shift; _opt_target="$1"
42     ;;
43   --mntpoint|-p)       # Mountpoint used for mounting the target system.
44     shift; _opt_mntpoint="$1"
45     ;;
46   --debopt)            # Extra parameters passed to the debootstrap.
47     shift; _opt_debopt="$1"
48     ;;
49   --interactive)       # Use interactive mode (frontend).
50     _opt_interactive=T
51     ;;
52   #
53
54   # == Configuration options
55   --config|-c)         # Use specified configuration file, defaults to /etc/debootstr
56     shift; _opt_config="$1"
57     ;;
58   --packages)          # Install packages defined in /etc/debootstrap/packages. Optio
59     shift; _opt_packages="$1"
60     _opt_packages_set=T
61     ;;
62   --debconf)           # Pre-seed packages using /etc/debootstrap/debconf-selections.
63     shift; _opt_debconf="$1"
64     _opt_debconf_set=T
65     ;;
66   --keep_src_list)     # Do not overwrite user provided apt sources.list.
67     _opt_keep_src_list=T
68     ;;
69   --hostname)          # Hostname of Debian system.
70     shift; _opt_hostname="$1"
71     ;;
72   --password)          # Use specified password as password for user root.
73     shift; _opt_password="$1"
74     ;;
75   #
76   --bootappend)        # Add specified appendline to kernel whilst booting.
77     shift; _opt_bootappend="$1"
78     ;;
79   --groot)             # Root device for usage in grub, corresponds with $TARGET in g
80     shift; _opt_groot="$1"
81     ;;
82   --grub)              # Target for grub installation. Use grub syntax for specifying
83     shift; _opt_grub="$1"
84     ;;
85
86   # == Other options
87   --help|-h)           # Print this usage information and exit.
88     _opt_help=T
89     ;;
90   --version|-v)        # Show summary of options and exit.
91     _opt_version=T
92     ;;
93   --)
94     shift; break
95     ;;
96   *)
97     eerror "Internal getopt error!"; eend 1 ; exit 1
98     ;;
99   esac
100   shift
101 done
102
103
104 # End