@@ -1,53 +1,58 | |||||
1 | #!/bin/bash |
|
1 | #!/bin/bash | |
2 | # |
|
2 | # | |
3 | # Setup APT repositories |
|
3 | # Setup APT repositories | |
4 | # |
|
4 | # | |
5 |
|
5 | |||
6 | # Load utility functions |
|
6 | # Load utility functions | |
7 | . ./functions.sh |
|
7 | . ./functions.sh | |
8 |
|
8 | |||
9 | # Install and setup APT proxy configuration |
|
9 | # Install and setup APT proxy configuration | |
10 | if [ -z "$APT_PROXY" ] ; then |
|
10 | if [ -z "$APT_PROXY" ] ; then | |
11 | install_readonly files/apt/10proxy "${ETC_DIR}/apt/apt.conf.d/10proxy" |
|
11 | install_readonly files/apt/10proxy "${ETC_DIR}/apt/apt.conf.d/10proxy" | |
12 | sed -i "s/\"\"/\"${APT_PROXY}\"/" "${ETC_DIR}/apt/apt.conf.d/10proxy" |
|
12 | sed -i "s/\"\"/\"${APT_PROXY}\"/" "${ETC_DIR}/apt/apt.conf.d/10proxy" | |
13 | fi |
|
13 | fi | |
14 |
|
14 | |||
15 | if [ "$BUILD_KERNEL" = false ] ; then |
|
15 | if [ "$BUILD_KERNEL" = false ] ; then | |
16 | echo "Downloading precompiled kernel" |
|
16 | echo "Downloading precompiled kernel" | |
17 | echo "error: not configured" |
|
17 | echo "error: not configured" | |
18 | exit 1; |
|
18 | exit 1; | |
19 | # BUILD_KERNEL=true |
|
19 | # BUILD_KERNEL=true | |
20 | else |
|
20 | else | |
21 | echo "No precompiled kernel repositories were added" |
|
21 | echo "No precompiled kernel repositories were added" | |
22 | fi |
|
22 | fi | |
23 |
|
23 | |||
24 | #autconfigure best apt server to not spam ftp.debian.org |
|
24 | #autconfigure best apt server to not spam ftp.debian.org | |
25 | #rm files/apt/sources.list |
|
25 | #rm files/apt/sources.list | |
26 | #netselect-apt does not know buster yet |
|
26 | #netselect-apt does not know buster yet | |
27 | if [ "$RELEASE" = "buster" ] ; then |
|
27 | if [ "$RELEASE" = "buster" ] ; then | |
28 | RELEASE=${RELEASE:=testing} |
|
28 | RELEASE=${RELEASE:=testing} | |
29 | fi |
|
29 | fi | |
30 |
|
30 | |||
31 | if [ "$ENABLE_NONFREE" = true ] ; then |
|
31 | if [ "$ENABLE_NONFREE" = true ] ; then | |
32 | netselect-apt --arch "$RELEASE_ARCH" --sources --nonfree --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE" |
|
32 | netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --nonfree --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE" | |
33 | else |
|
33 | else | |
34 | netselect-apt --arch "$RELEASE_ARCH" --sources --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE" |
|
34 | netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE" | |
35 | fi |
|
35 | fi | |
36 |
|
36 | |||
|
37 | #ipinfo=$(curl ipinfo.io | grep country ) | |||
|
38 | #grep -o '\"[^"]*\"' $ipinfo | tr -d '"' | |||
|
39 | #grep -Po '"country":.*?[^\\]",' $(curl ipinfo.io | grep country ) | |||
|
40 | #sed -i "s,http:,https:,g" "${ETC_DIR}/apt/sources.list" | |||
|
41 | ||||
37 | # Upgrade package index and update all installed packages and changed dependencies |
|
42 | # Upgrade package index and update all installed packages and changed dependencies | |
38 | chroot_exec apt-get -qq -y update |
|
43 | chroot_exec apt-get -qq -y update | |
39 | chroot_exec apt-get -qq -y -u dist-upgrade |
|
44 | chroot_exec apt-get -qq -y -u dist-upgrade | |
40 |
|
45 | |||
41 | if [ "$APT_INCLUDES_LATE" ] ; then |
|
46 | if [ "$APT_INCLUDES_LATE" ] ; then | |
42 | chroot_exec apt-get -qq -y install "$(echo "$APT_INCLUDES_LATE" |tr , ' ')" |
|
47 | chroot_exec apt-get -qq -y install "$(echo "$APT_INCLUDES_LATE" |tr , ' ')" | |
43 | fi |
|
48 | fi | |
44 |
|
49 | |||
45 | if [ -d packages ] ; then |
|
50 | if [ -d packages ] ; then | |
46 | for package in packages/*.deb ; do |
|
51 | for package in packages/*.deb ; do | |
47 | cp "$package" "${R}"/tmp |
|
52 | cp "$package" "${R}"/tmp | |
48 | chroot_exec dpkg --unpack /tmp/"$(basename "$package")" |
|
53 | chroot_exec dpkg --unpack /tmp/"$(basename "$package")" | |
49 | done |
|
54 | done | |
50 | fi |
|
55 | fi | |
51 | chroot_exec apt-get -qq -y -f install |
|
56 | chroot_exec apt-get -qq -y -f install | |
52 |
|
57 | |||
53 | chroot_exec apt-get -qq -y check No newline at end of file |
|
58 | chroot_exec apt-get -qq -y check |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant