~ubuntu-branches/ubuntu/trusty/uck/trusty

« back to all changes in this revision

Viewing changes to uck-remaster

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-11-29 16:27:29 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20101129162729-mvttwldbpezfojex
Tags: 2.4.0-0ubuntu1
* New upstream release.
* Depends on gfxboot (<< 4.2.2) | gfxboot-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# along with UCK.  If not, see <http://www.gnu.org/licenses/>.                    #
19
19
###################################################################################
20
20
 
21
 
ISO_IMAGE="$1"
22
 
CUSTOMIZE_DIR="$2"
23
 
REMASTER_HOME=~/tmp
24
 
 
25
21
##################
26
22
# some functions #
27
23
##################
28
24
 
29
25
function usage()
30
26
{
31
 
        echo "Usage: $0 iso-file.iso [customization-scripts-dir]"
 
27
        echo "Usage: $0 [-m] iso-file.iso [customization-scripts-dir]"
32
28
}
33
29
 
34
30
function check_exit_code()
35
31
{
36
32
        RESULT=$?
37
33
        if [ "$RESULT" -ne 0 ]; then
 
34
                if [ x"$use_mount" = x-m ]; then
 
35
                        $SCRIPTS_DIR/uck-remaster-umount "$REMASTER_HOME"
 
36
                fi
38
37
                exit "$RESULT"
39
38
        fi
40
39
}
50
49
#########################
51
50
# input parameter check #
52
51
#########################
 
52
use_mount=
 
53
if [ x"$1" = x-m ]; then
 
54
        use_mount=-m; shift
 
55
fi
 
56
 
 
57
ISO_IMAGE="$1"
 
58
CUSTOMIZE_DIR="$2"
 
59
REMASTER_HOME=${3:-~/tmp}
53
60
 
54
61
if [ -z "$ISO_IMAGE" ]; then
55
62
        usage
119
126
#############
120
127
 
121
128
if [ "$CUSTOMIZE_ISO" = "yes" ] ; then
122
 
        $SCRIPTS_DIR/uck-remaster-unpack-iso "$ISO_IMAGE" "$REMASTER_HOME"
123
 
        check_exit_code
124
 
fi
125
 
 
126
 
if [ "$CUSTOMIZE_INITRD" = "yes" ] ; then
127
 
        $SCRIPTS_DIR/uck-remaster-unpack-initrd "$REMASTER_HOME"
 
129
        $SCRIPTS_DIR/uck-remaster-unpack-iso $use_mount "$ISO_IMAGE" "$REMASTER_HOME"
128
130
        check_exit_code
129
131
fi
130
132
 
131
133
if [ "$CUSTOMIZE_ISO" = "yes" ] && [ "$CUSTOMIZE_ROOTFS" = "yes" ] ; then
132
 
        $SCRIPTS_DIR/uck-remaster-unpack-rootfs "$REMASTER_HOME"
 
134
        $SCRIPTS_DIR/uck-remaster-unpack-rootfs $use_mount "$REMASTER_HOME"
133
135
        check_exit_code
134
136
fi
135
137
 
142
144
        check_exit_code
143
145
fi
144
146
 
145
 
if [ "$CUSTOMIZE_INITRD" = "yes" ]; then
146
 
        echo "Running initrd customization script $CUSTOMIZE_DIR/customize_initrd..."
147
 
        "$CUSTOMIZE_DIR/customize_initrd" "$REMASTER_HOME"
148
 
        check_exit_code
149
 
        echo "Initrd customization script finished"
150
 
fi
151
 
 
152
147
if [ "$CUSTOMIZE_ISO" = "yes" ] && [ "$CUSTOMIZE_ROOTFS" = "yes" ]; then
153
148
        if [ "$COPY_CUSTOMIZE_DIR" = "yes" ]; then
154
149
                cp -a "$CUSTOMIZE_DIR" "$REMASTER_HOME/customization-scripts"
171
166
        read DUMMY
172
167
fi
173
168
 
 
169
if [ "$CUSTOMIZE_INITRD" = "yes" ] ; then
 
170
        $SCRIPTS_DIR/uck-remaster-unpack-initrd "$REMASTER_HOME"
 
171
        check_exit_code
 
172
fi
 
173
 
 
174
if [ "$CUSTOMIZE_INITRD" = "yes" ]; then
 
175
        echo "Running initrd customization script $CUSTOMIZE_DIR/customize_initrd..."
 
176
        "$CUSTOMIZE_DIR/customize_initrd" "$REMASTER_HOME"
 
177
        check_exit_code
 
178
        echo "Initrd customization script finished"
 
179
fi
 
180
 
174
181
###########
175
182
# packing #
176
183
###########