summaryrefslogtreecommitdiff
path: root/templates/iso
blob: 2b65c2658053301ce4b8452499846d68a8c22c09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# NB: MUST be included before other templates defining cleanup and prepare
#

if [[ -z $ISO_TYPE ]]; then
    # default
    ISO_TYPE='cdemu'
    
    # guess :)
    [[ -n $MOUNTTARGET ]] && ISO_TYPE='fuseiso'
    [[ -n $CDEMU_NO ]] && ISO_TYPE='cdemu'
fi

case $ISO_TYPE in
    'fuseiso') inherit fuseiso;;
    'cdemu')   inherit cdemu;;
    *) die "Unknown ISO_TYPE: '$ISO_TYPE'";;
esac


# wrapper phases

iso_prepare () {
    default_prepare
    ${ISO_TYPE}_prepare
}

iso_cleanup () {
    default_cleanup
    ${ISO_TYPE}_cleanup
}

# we need to OVERRIDE and not EXPORT, to not execute them twice
# as they are already exported in the other template
OVERRIDE prepare cleanup
# vim:ft=sh