~project-rootstock-developers/project-rootstock/trunk

« back to all changes in this revision

Viewing changes to rootstock

  • Committer: Ricardo Salveti de Araujo
  • Date: 2010-07-14 05:38:28 UTC
  • Revision ID: ricardo.salveti@canonical.com-20100714053828-xarsn997jkwgguu2
rootstock and rootstock.1: updating usage information to be possible to regenerate the man page with help2man

Also updated the man page with "help2man -N ./rootstock -o rootstock.1".

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
#
3
 
#  Copyright (c) 2009 Canonical
 
3
#  Copyright (c) 2009, 2010 Canonical
4
4
#
5
5
#  Author: Oliver Grawert <ogra@canonical.com>
6
6
#
34
34
 
35
35
trap cleanup 1 2 3 6 15
36
36
 
 
37
PROGRAM="$(basename $0)"
 
38
VERSION="0.1.99.3"
 
39
 
37
40
cleanup()
38
41
{
39
42
      echo "I: Cleaning up..."
72
75
 
73
76
usage()
74
77
{
75
 
    echo "usage: $(basename $0) -f <hostname> -l <login name> -p <password> [option]"
76
78
cat <<EOF
77
 
 
78
 
required options:
 
79
Usage: $PROGRAM -f <hostname> [OPTION]...
 
80
Generates Ubuntu armel rootfs tarballs and/or qemu image, to be
 
81
uncompressed onto a root device.
 
82
 
 
83
Note that it does not set up a kernel, modules or bootloader for you.
 
84
Kernel and bootloader need to be set up in a device specific manner,
 
85
modules should be copied to the filesystem after it was uncompressed
 
86
on the target device.
 
87
 
 
88
It also uses a virtual machine and can take long to build your
 
89
filesystem, please be patient and make sure to have enough CPU power
 
90
on the host machine.
 
91
 
 
92
Options:
 
93
 
 
94
Required:
 
95
 
79
96
-f --fqdn <hostname>
80
97
    Hostname to be used for the target system
81
98
 
82
 
additional options:
 
99
Additional:
 
100
 
83
101
-l --login <login name>
84
102
    Login ID of the admin user created during setup
85
103
-p --password <password>
86
104
    Password of the admin user created during setup
87
105
-h --help
88
 
    this help
 
106
    Display this help
89
107
-n --fullname <quoted string>
90
108
    Full Name of the admin user created during setup
91
109
    (default: "Ubuntu System User")
120
138
--swapsize <size in megabyte>
121
139
    Use a different size for the swapfile used by the virtual machine
122
140
    (default: 256M)
123
 
 
124
 
keyboard options:
 
141
--version
 
142
    Print version number
 
143
 
 
144
Keyboard:
 
145
 
125
146
--kblayout <layout>
126
147
    Keyboard layout (i.e. us)
127
148
    (default: buildsystem kblayout)
135
156
    Additional keyboard options
136
157
    (default: buildsystem kboptions)
137
158
 
138
 
output options:
 
159
Output:
 
160
 
139
161
--keepimage
140
162
    Keep the qemu image instead of deleting it
141
163
--notarball
142
164
    Do not roll a tarball of the rootfs (autosets --keepimage)
143
165
 
144
 
extra parameters:
 
166
Extra parameters:
 
167
 
145
168
-q --quiet
146
169
    Quiet operation, only write to log
147
170
 
148
 
advanced options:
 
171
Advanced:
 
172
 
149
173
--kernel-image <http url to kernel .deb>
150
174
    install board specfic kernel package from http accessible deb package inside rootfs
151
175
--copy-package-cache
159
183
    additional mirror to use
160
184
--no-root
161
185
    run rootstock without requiring root access (slower)
 
186
 
 
187
Examples:
 
188
 
 
189
Xubuntu-Desktop (as root): rootstock -f host -l user -p temppwd -i 2G -s xubuntu-desktop
 
190
 
 
191
Minimal Ubuntu (as user): rootstock -f host -l user -p temppwd -i 512M --no-root -s ubuntu-minimal
 
192
 
 
193
Report bugs at https://launchpad.net/project-rootstock/+filebug
162
194
EOF
163
195
    exit 0
164
196
}
165
197
 
 
198
print_version()
 
199
{
 
200
cat <<EOF
 
201
$PROGRAM $VERSION
 
202
 
 
203
Copyright (C) 2009, 2010 Canonical
 
204
License: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
 
205
 
 
206
This is free software: you are free to change and redistribute it.
 
207
There is NO WARRANTY, to the extent permitted by law.
 
208
 
 
209
Written by Oliver Grawert <ogra@canonical.com>.
 
210
EOF
 
211
}
 
212
 
166
213
checkparm()
167
214
{
168
215
    if [ "$(echo $1|grep ^'\-')" ];then
175
222
{
176
223
    if [ -z "$NOSAVELOG" ];then
177
224
        mv $LOG $DIR/
178
 
        echo "I: A logfile was saved as $DIR/$(basename $0)-$STAMP.log"
 
225
        echo "I: A logfile was saved as $DIR/${PROGRAM}-$STAMP.log"
179
226
    fi
180
227
}
181
228
 
600
647
SWAPSIZE=256
601
648
 
602
649
# general defaults
603
 
LOG="$BUILDDIR/$(basename $0)-$STAMP.log"
 
650
LOG="$BUILDDIR/${PROGRAM}-$STAMP.log"
604
651
 
605
652
PACKAGE_CLEANUP="apt-get clean"
606
653
PACKAGE_CLEANUP_SUB="${PACKAGE_CLEANUP}"
752
799
            fi
753
800
            NOROOT=1
754
801
            ;;
 
802
        --version)
 
803
            print_version
 
804
            exit 0
 
805
            ;;
755
806
    esac
756
807
    shift
757
808
done
763
814
 
764
815
# we need root
765
816
if [ $(id -u) != 0 ] && [ ! "$NOROOT" ];then
766
 
    echo "You should run $(basename $0) as root unless you explicit request it by giving --no-root"
 
817
    echo "You should run $PROGRAM as root unless you explicit request it by giving --no-root"
767
818
    exit 2
768
819
fi
769
820