File: 20-setup-apt

package info (click to toggle)
xen-tools 4.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 1,476 kB
  • sloc: perl: 4,942; sh: 1,690; makefile: 268
file content (87 lines) | stat: -rwxr-xr-x 1,815 bytes parent folder | download | duplicates (6)
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
#!/bin/sh
#
#  This script sets up the /etc/apt/sources.list for APT, and it disables
# TLS where appropriate.
#
# Steve
# --
#


prefix=$1


#
#  Source our common functions
#
if [ -e /usr/share/xen-tools/common.sh ]; then
    . /usr/share/xen-tools/common.sh
else
    . ./hooks/common.sh
fi


#
# Log our start
#
logMessage Script $0 starting


#
# Attempt to auto-magically detect the use of a Proxy for apt-get, and
# replicate that setup in our new guest via apt-config dump and save
# the setting to the proxy guess file.
#
if [ ${apt_proxy} ]; then
  echo "Acquire::http::Proxy \"${apt_proxy}\";" > ${prefix}/etc/apt/apt.conf.d/01proxy
else
  logMessage The use of a proxy detected.
  apt-config dump | grep -i Acquire::HTTP::Proxy > ${prefix}/etc/apt/apt.conf.d/01proxy
fi


#
# Setup the sources.list file for new installations of Ubuntu GNU/Linux.
#
cat <<E_O_APT > ${prefix}/etc/apt/sources.list
#
#  /etc/apt/sources.list
#


#
# ${dist}
#
deb     ${mirror}     ${dist} main restricted universe multiverse
deb-src ${mirror}     ${dist} main restricted universe
deb     ${mirror}     ${dist}-updates main restricted universe multiverse
deb-src ${mirror}     ${dist}-updates main restricted universe
deb http://security.ubuntu.com/ubuntu ${dist}-security main restricted universe
deb-src http://security.ubuntu.com/ubuntu ${dist}-security main restricted universe

E_O_APT



#
#  Now that the sources have been setup make sure the system is up to date.
#
chroot ${prefix} /usr/bin/apt-get update


#
#  Now fixup TLS on non-64bit systems after dapper. For dapper this is
#  already fixed in 10-disable-tls.
#
if [ "$arch" = 'i386' -a "$dist" != 'dapper' ]; then

    logMessage "Installing libc6-xen"
    installDebianPackage ${prefix} libc6-xen

fi


#
#  Log our finish
#
logMessage Script $0 finished