~xnox/debian-cd/cd-boot-images-ppc64el

« back to all changes in this revision

Viewing changes to tools/groovy/installtools.sh

  • Committer: Dimitri John Ledkov
  • Date: 2020-05-21 09:10:21 UTC
  • mto: This revision was merged to the branch mainline in revision 2057.
  • Revision ID: xnox@ubuntu.com-20200521091021-jh2ksz1sxioumaqf
Add missing tools/groovy

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# Install files in /install and some in /doc
 
4
set -e
 
5
 
 
6
# The location of the tree for CD#1, passed in
 
7
DIR=$1
 
8
 
 
9
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
 
10
    DOCDIR=doc
 
11
 
 
12
    if [ -n "$BOOTDISKS" -a -e $BOOTDISKS/current/$DOCDIR ] ; then
 
13
            DOCS=$BOOTDISKS/current/$DOCDIR
 
14
    elif MANUALDEB="$($BASEDIR/tools/apt-selection cache show "installation-guide-$ARCH")"; then
 
15
            MANUALDEB="$(echo "$MANUALDEB" | grep ^Filename | awk '{print $2}')"
 
16
    else
 
17
            echo "WARNING: Using $DI_CODENAME bootdisk documentation"
 
18
            DOCS=$MIRROR/dists/$DI_CODENAME/main/installer-$ARCH/current/$DOCDIR
 
19
    fi
 
20
 
 
21
    # Put the install documentation in /doc/install
 
22
    if [ "$DOCS" ] && [ -d "$DOCS" ]; then
 
23
        cd $DOCS
 
24
        mkdir -p $DIR/$DOCDIR/install
 
25
        if ! cp -a * $DIR/$DOCDIR/install; then
 
26
            echo "ERROR: Unable to copy installer documentation to CD."
 
27
        fi
 
28
    elif [ "$MANUALDEB" ]; then
 
29
        mkdir -p "$DIR/$DOCDIR/install/tmp" "$DIR/$DOCDIR/install/manual"
 
30
        dpkg -x "$MIRROR/$MANUALDEB" "$DIR/$DOCDIR/install/tmp"
 
31
        mv "$DIR/$DOCDIR/install/tmp/usr/share/doc/installation-guide-$ARCH"/* "$DIR/$DOCDIR/install/manual/"
 
32
        rm -rf "$DIR/$DOCDIR/install/tmp"
 
33
        # just keep the HTML version
 
34
        rm -f "$DIR/$DOCDIR/install/manual/copyright" \
 
35
            "$DIR/$DOCDIR/install/manual/changelog.gz" \
 
36
            "$DIR/$DOCDIR/install/manual"/*/install.*.pdf* \
 
37
            "$DIR/$DOCDIR/install/manual"/*/install.*.txt*
 
38
    else
 
39
        echo "ERROR: Unable to copy installer documentation to CD."
 
40
    fi
 
41
fi
 
42
 
 
43
# Preseed files for special install types
 
44
mkdir -p $DIR/preseed
 
45
PRESEED_ROOT=$BASEDIR/data/$CODENAME/preseed
 
46
for preseed_dir in \
 
47
        $PRESEED_ROOT $PRESEED_ROOT/$ARCH \
 
48
        $PRESEED_ROOT/$PROJECT $PRESEED_ROOT/$PROJECT/$ARCH; do
 
49
    [ -d "$preseed_dir" ] || continue
 
50
    for file in $preseed_dir/*.seed; do
 
51
        cp -a "$file" $DIR/preseed/
 
52
    done
 
53
done
 
54
if [ "$CDIMAGE_DVD" = 1 ] && [ "$PROJECT" != ubuntu-server ]; then
 
55
    # include server on normal DVDs
 
56
    for preseed_dir in \
 
57
            $PRESEED_ROOT/ubuntu-server $PRESEED_ROOT/ubuntu-server/$ARCH; do
 
58
        [ -d "$preseed_dir" ] || continue
 
59
        for file in $preseed_dir/*.seed; do
 
60
            cp -a "$file" $DIR/preseed/
 
61
        done
 
62
    done
 
63
    # we normally preseed tasksel to install the desktop task, but this is
 
64
    # inappropriate on DVDs where much more choice is available
 
65
    if [ -e "$DIR/preseed/$PROJECT.seed" ]; then
 
66
        perl -ni -e '
 
67
            if (/^#/) { $out .= $_ }
 
68
            elsif (m[^tasksel\s+tasksel/first\s]) { print $out; print; print "tasksel\ttasksel/first\tseen false\n"; $out = "" }
 
69
            else { print $out; print; $out = "" }' \
 
70
                "$DIR/preseed/$PROJECT.seed"
 
71
        if [ ! -s "$DIR/preseed/$PROJECT.seed" ]; then
 
72
            rm -f "$DIR/preseed/$PROJECT.seed"
 
73
        fi
 
74
    fi
 
75
fi
 
76
# On live CDs, remove preseed/early_command settings that use the debconf
 
77
# confmodule. Live CDs implement preseed/early_command in casper which
 
78
# doesn't have the confmodule available.
 
79
if [ "$CDIMAGE_LIVE" = 1 ]; then
 
80
    for file in $DIR/preseed/*.seed; do
 
81
        [ -f "$file" ] || continue
 
82
        sed -i '/preseed\/early_command.*confmodule/d' "$file"
 
83
    done
 
84
fi
 
85
 
 
86
if [ "$BACKPORT_KERNEL" ]; then
 
87
    (cd $DIR/preseed/ &&
 
88
    case $ARCH in
 
89
        amd64|i386|arm64|ppc64el|s390x)
 
90
            for file in *.seed; do
 
91
                [ -f "$file" ] || continue
 
92
                cp "$file" hwe-"$file"
 
93
                if grep -q base-installer/kernel/override-image "$file"; then
 
94
                    sed -i -e "s/string linux-virtual/string linux-virtual-$BACKPORT_KERNEL/" hwe-"$file"
 
95
                elif ! grep -q base-installer/kernel/altmeta "$file"; then
 
96
                    echo "d-i  base-installer/kernel/altmeta   string $BACKPORT_KERNEL" >> hwe-"$file"
 
97
                fi
 
98
                [ "$PROJECT" = "ubuntu-server" ] || mv hwe-"$file" "$file"
 
99
            done
 
100
            ;;
 
101
    esac
 
102
    )
 
103
fi