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

« back to all changes in this revision

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

  • Committer: Adam Conrad
  • Date: 2016-04-22 11:40:33 UTC
  • Revision ID: adconrad@0c3.net-20160422114033-vom9id9ph274tf6b
Copy xenial -> yakkety, and add yakkety to CONF.sh

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|ubuntukylin)
 
22
            DEFAULT_PRESEED='file=/cdrom/preseed/ubuntu.seed'
 
23
            ;;
 
24
        kubuntu)
 
25
            DEFAULT_PRESEED='file=/cdrom/preseed/kubuntu.seed'
 
26
            ;;
 
27
        kubuntu-plasma5)
 
28
            DEFAULT_PRESEED='file=/cdrom/preseed/kubuntu-plasma5.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
        lubuntu)
 
55
            DEFAULT_PRESEED='file=/cdrom/preseed/lubuntu.seed'
 
56
            ;;
 
57
        ubuntu-gnome)
 
58
            DEFAULT_PRESEED='file=/cdrom/preseed/ubuntu-gnome.seed'
 
59
            ;;
 
60
        ubuntu-mate)
 
61
            DEFAULT_PRESEED='file=/cdrom/preseed/ubuntu-mate.seed'
 
62
            ;;
 
63
        *)
 
64
            DEFAULT_PRESEED=
 
65
            ;;
 
66
    esac
 
67
    if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
68
        case $PROJECT in
 
69
            ubuntu|ubuntu-*)
 
70
                ;;
 
71
            *)
 
72
                FRONTEND_BACKGROUND="FRONTEND_BACKGROUND=original"
 
73
                DEFAULT_PRESEED="${DEFAULT_PRESEED:+$DEFAULT_PRESEED }$FRONTEND_BACKGROUND"
 
74
                ;;
 
75
        esac
 
76
    fi
 
77
}
 
78
 
 
79
default_language() {
 
80
    case $PROJECT in
 
81
        ubuntukylin)
 
82
            KERNEL_PARAMS="${KERNEL_PARAMS:+$KERNEL_PARAMS }locale=zh_CN keyboard-configuration/layoutcode?=cn"
 
83
            ;;
 
84
    esac
 
85
}
 
86
 
 
87
list_kernel_abis() {
 
88
    perl -le '
 
89
        BEGIN { %images = map { $_ => 1 } @ARGV; $found = 0; %abis = (); }
 
90
        while (<STDIN>) {
 
91
            chomp;
 
92
            if (/^[^[:space:]]/) {
 
93
                $found = exists $images{$_};
 
94
            } elsif ($found and /^[[:space:]]+kernel-image-([^[:space:]]*)-di /) {
 
95
                $abis{$1} = 1;
 
96
            }
 
97
        }
 
98
        END { print for sort keys %abis; }' "$@" <MANIFEST.udebs
 
99
}
 
100
 
 
101
check_kernel_sync() {
 
102
    [ "$CDIMAGE_INSTALL_BASE" = 1 ] || return 0
 
103
    for abi in $(sed -n 's/^kernel-image-\([^ ]*\)-di .*/\1/p'); do
 
104
        # If any parameters were passed, then they represent a list of ABI
 
105
        # suffixes we're interested in.
 
106
        if [ "$#" -gt 0 ]; then
 
107
            local allowed=
 
108
            for allow_abi; do
 
109
                case $abi in
 
110
                    *-$allow_abi)
 
111
                        allowed=1
 
112
                        break
 
113
                        ;;
 
114
                esac
 
115
            done
 
116
            if [ -z "$allowed" ]; then
 
117
                continue
 
118
            fi
 
119
        fi
 
120
        if ! grep -q -- "-$abi-di\$" list; then
 
121
            echo "debian-installer has kernel ABI $abi, but no corresponding udebs are on the CD!" >&2
 
122
            exit 1
 
123
        fi
 
124
    done
 
125
}
 
126
 
 
127
initrd_suffix() {
 
128
    if zcat -t "$1" >/dev/null 2>&1; then
 
129
        echo .gz
 
130
    elif bzcat -t "$1" >/dev/null 2>&1; then
 
131
        echo .bz2
 
132
    # TODO: This only works if there is at least one dot in $1; fortunately
 
133
    # this is currently always true.
 
134
    elif lzcat -S ".${1##*.}" -t "$1" >/dev/null 2>&1; then
 
135
        # .lzma would be more conventional, but we use .lz to avoid creating
 
136
        # trouble for boot loaders that might need to read from 8.3
 
137
        # filesystems without implementing support for long file names (e.g.
 
138
        # syslinux on FAT USB sticks).
 
139
        echo .lz
 
140
    fi
 
141
}
 
142
 
 
143
HUMANPROJECT="$(echo "$CAPPROJECT" | sed 's/-/ /g')"
 
144
 
 
145
# Add an option to the mkisofs options for this CD _only_ if it's not
 
146
# already set. $1 is the opts file location, "$2" is the new
 
147
# option. Call this with _logical groupings_ of options
 
148
add_mkisofs_opt() {
 
149
   OPTS_FILE=$1
 
150
   NEW_OPT="$2"
 
151
 
 
152
   if ! ( grep -q -- "$NEW_OPT" $OPTS_FILE 2>/dev/null) ; then
 
153
       echo -n "$NEW_OPT " >> $OPTS_FILE
 
154
   fi
 
155
}