File: pre-pkgsel

package info (click to toggle)
debian-edu-install 2.10.21
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,164 kB
  • sloc: sh: 1,236; makefile: 100
file content (115 lines) | stat: -rwxr-xr-x 2,499 bytes parent folder | download | duplicates (4)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/sh

set -e

#export DEBCONF_DEBUG='developer'
. /usr/share/debconf/confmodule
. /lib/debian-edu-common

log() {
    logger -t edu-pre-pkgsel "info: $*"
}

error() {
    logger -t edu-pre-pkgsel "error: $*"
}

report_fatal_error() {
    template=debian-edu-install/errors-pkg-installation
    db_subst $template PACKAGES "$p"
    db_fset $template seen false
    db_capb "" # Disable "Go Back" button
    db_settitle $template-title
    db_input critical $template || [ $? -eq 30 ]
    db_go
    db_capb backup
    reboot
}

at_exit() {
    error "script $0 terminated unexpectedly."
    report_fatal_error "unexpected exit"
}
disable_exception() { trap - INT TERM EXIT; }
trap at_exit INT TERM EXIT

# Install required packages, report fatal error and reboot if it fail.
install_required_pkg() {
    p="$1"
    log "installing package $p"
    if apt-install --allow-remove --with-recommends $p ; then
	:
    else
	report_fatal_error "$p"
    fi
}

load_proxy_conf

db_get debian-edu-install/quick-install
if [ true = "$RET" ] ; then
    edu-eatmydata-install enable
else
    log "not enabling quick install, preseed debian-edu-install/quick-install=true to change this."
fi

# Initialize etckeeper early
edu-etcvcs init

db_get debian-edu-install/profile
PROFILE="$RET"

db_get debian-installer/language
LANGCODE="$RET"

db_get debian-installer/locale
LOCALE="$RET"

if [ ! -d /target/etc/debian-edu ] ; then
    if mkdir /target/etc/debian-edu ; then
        :
    else
        error "unable to create /target/etc/debian-edu"
    fi
fi

# get the current version
VERSION="$(cat /usr/lib/debian-edu-install/version || true)"
if [ -z "$VERSION" ] ; then
    error "missing /usr/lib/debian-edu-install/version, incomplete /etc/debian-edu/config created."
fi

(
    echo "# Generated by debian-edu-profile-udeb"
    echo "VERSION=\"$VERSION\""
    echo "PROFILE=\"$PROFILE\""
    echo "LANGCODE=\"$LANGCODE\""
    echo "LOCALE=\"$LOCALE\""
) >> /target/etc/debian-edu/config

if edu-is-testinstall ; then
    echo "TESTINSTALL=\"true\"" >> /target/etc/debian-edu/config
fi

edu-etcvcs commit

log "asking for a few extra packages to be installed"

# education tasksel tasks
install_required_pkg education-tasks

# the debian-edu preseeding files
install_required_pkg debian-edu-install

edu-etcvcs commit

hook=/target/usr/share/debian-edu-config/d-i/pre-pkgsel
if [ -x $hook ] ; then
    log "Running debian-edu-config pre-pkgsel hook"
    $hook
fi

edu-etcvcs commit

disable_exception
exit 0