~tsimonq2/debian-cd/lubuntu-cosmic-changes

« back to all changes in this revision

Viewing changes to tools/boot/oneiric/common.sh

  • Committer: Colin Watson
  • Date: 2011-04-30 16:06:44 UTC
  • Revision ID: cjwatson@canonical.com-20110430160644-0g6ldw3d4rpilkin
add CONF.sh bits for oneiric; copy natty -> oneiric elsewhere

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# This file provides some common code that is intented to be called
 
3
# by the various boot-<arch> scripts.
 
4
 
 
5
 
 
6
# install_languages decompacts the language packs, you should give the path
 
7
# to the CD temporary tree.
 
8
# This function should be called for all bootable images.
 
9
install_languages() {
 
10
    # Param $1 is the CD directory
 
11
    if [ -f "$MIRROR/dists/$DI_CODENAME/main/disks-$ARCH/current/xlp.tgz" ]
 
12
    then
 
13
        mkdir $1/.xlp
 
14
        (cd $1/.xlp; \
 
15
        tar zxf $MIRROR/dists/$DI_CODENAME/main/disks-$ARCH/current/xlp.tgz )
 
16
    fi
 
17
}
 
18
 
 
19
default_preseed() {
 
20
    case $PROJECT in
 
21
        ubuntu)
 
22
            DEFAULT_PRESEED='file=/cdrom/preseed/ubuntu.seed'
 
23
            ;;
 
24
        kubuntu)
 
25
            DEFAULT_PRESEED='file=/cdrom/preseed/kubuntu.seed'
 
26
            ;;
 
27
        kubuntu-netbook)
 
28
            DEFAULT_PRESEED='file=/cdrom/preseed/kubuntu-netbook.seed'
 
29
            ;;
 
30
        edubuntu)
 
31
            DEFAULT_PRESEED='file=/cdrom/preseed/edubuntu.seed'
 
32
            ;;
 
33
        xubuntu)
 
34
            DEFAULT_PRESEED='file=/cdrom/preseed/xubuntu.seed'
 
35
            ;;
 
36
        ubuntu-server)
 
37
            DEFAULT_PRESEED='file=/cdrom/preseed/ubuntu-server.seed'
 
38
            ;;
 
39
        ubuntu-mid)
 
40
            DEFAULT_PRESEED='file=/cdrom/preseed/mid.seed'
 
41
            ;;
 
42
        ubuntu-netbook)
 
43
            DEFAULT_PRESEED='file=/cdrom/preseed/ubuntu-netbook.seed'
 
44
            ;;
 
45
        jeos)
 
46
            DEFAULT_PRESEED='file=/cdrom/preseed/jeos.seed'
 
47
            ;;
 
48
        ubuntustudio)
 
49
            DEFAULT_PRESEED='file=/cdrom/preseed/ubuntustudio.seed'
 
50
            ;;
 
51
        mythbuntu)
 
52
            DEFAULT_PRESEED='file=/cdrom/preseed/mythbuntu.seed'
 
53
            ;;
 
54
        ubuntu-moblin-remix)
 
55
            DEFAULT_PRESEED='file=/cdrom/preseed/moblin-remix.seed'
 
56
            ;;
 
57
        *)
 
58
            DEFAULT_PRESEED=
 
59
            ;;
 
60
    esac
 
61
    if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
62
        case $PROJECT in
 
63
            ubuntu|ubuntu-*)
 
64
                ;;
 
65
            *)
 
66
                DEFAULT_PRESEED="${DEFAULT_PRESEED:+$DEFAULT_PRESEED }FRONTEND_BACKGROUND=original"
 
67
                ;;
 
68
        esac
 
69
    fi
 
70
}
 
71
 
 
72
list_kernel_abis() {
 
73
    perl -le '
 
74
        BEGIN { %images = map { $_ => 1 } @ARGV; $found = 0; %abis = (); }
 
75
        while (<STDIN>) {
 
76
            chomp;
 
77
            if (/^[^[:space:]]/) {
 
78
                $found = exists $images{$_};
 
79
            } elsif ($found and /^[[:space:]]+kernel-image-([^[:space:]]*)-di /) {
 
80
                $abis{$1} = 1;
 
81
            }
 
82
        }
 
83
        END { print for sort keys %abis; }' "$@" <MANIFEST.udebs
 
84
}
 
85
 
 
86
check_kernel_sync() {
 
87
    [ "$CDIMAGE_INSTALL_BASE" = 1 ] || return 0
 
88
    for abi in $(sed -n 's/^kernel-image-\([^ ]*\)-di .*/\1/p'); do
 
89
        # If any parameters were passed, then they represent a list of ABI
 
90
        # suffixes we're interested in.
 
91
        if [ "$#" -gt 0 ]; then
 
92
            local allowed=
 
93
            for allow_abi; do
 
94
                case $abi in
 
95
                    *-$allow_abi)
 
96
                        allowed=1
 
97
                        break
 
98
                        ;;
 
99
                esac
 
100
            done
 
101
            if [ -z "$allowed" ]; then
 
102
                continue
 
103
            fi
 
104
        fi
 
105
        if ! grep -q -- "-$abi-di\$" list; then
 
106
            echo "debian-installer has kernel ABI $abi, but no corresponding udebs are on the CD!" >&2
 
107
            exit 1
 
108
        fi
 
109
    done
 
110
}
 
111
 
 
112
initrd_suffix() {
 
113
    if zcat -t "$1" >/dev/null 2>&1; then
 
114
        echo .gz
 
115
    elif bzcat -t "$1" >/dev/null 2>&1; then
 
116
        echo .bz2
 
117
    elif lzcat -S '' -t "$1" >/dev/null 2>&1; then
 
118
        # .lzma would be more conventional, but we use .lz to avoid creating
 
119
        # trouble for boot loaders that might need to read from 8.3
 
120
        # filesystems without implementing support for long file names (e.g.
 
121
        # syslinux on FAT USB sticks).
 
122
        echo .lz
 
123
    fi
 
124
}
 
125
 
 
126
HUMANPROJECT="$(echo "$CAPPROJECT" | sed 's/-/ /g')"
 
127