summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-06-18 18:05:05 -0400
committerAndrew Cady <d@jerkface.net>2019-06-18 18:05:05 -0400
commitd170553513c12d75b15de7e560ed6b58e06517f7 (patch)
tree5908e7b969ab7ee3e0151df42e34a0b412ce615b
parentd0b46fd6b01e561b7e388dd91c271ad8e301bb6d (diff)
selfstrap: include backports in sources.list
-rwxr-xr-xsrc/selfstrap40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/selfstrap b/src/selfstrap
index 86bbab4..f379525 100755
--- a/src/selfstrap
+++ b/src/selfstrap
@@ -68,9 +68,7 @@ generate_apt_config()
68 APT_CONFIG=$(mktemp) || exit 68 APT_CONFIG=$(mktemp) || exit
69 chmod 644 "$APT_CONFIG" 69 chmod 644 "$APT_CONFIG"
70 cat > "$APT_CONFIG" <<EOF 70 cat > "$APT_CONFIG" <<EOF
71Dir::Etc "${TARGET}/etc/apt/"; 71Dir "${TARGET}";
72Dir::Etc::Parts "${TARGET}/etc/apt/apt.conf.d/";
73Dir::Etc::PreferencesParts "${TARGET}/etc/apt/preferences.d/";
74EOF 72EOF
75 export APT_CONFIG 73 export APT_CONFIG
76} 74}
@@ -87,37 +85,34 @@ apt_()
87 printf "+ apt-${apt_cmd} %s\n" "$*" >&2 85 printf "+ apt-${apt_cmd} %s\n" "$*" >&2
88 fi 86 fi
89 87
90 set -- -o Apt::Install-Recommends=false "$@" 88 set -- "$@" -o Apt::Install-Recommends=false
89 set -- "$@" -o Apt::Architecture="$target_arch"
90 set -- "$@" -o Apt::Default-Release="$target_release"
91 91
92 # Set various paths to within the created system. 92 # Set default paths to within the created system.
93 set -- -o Apt::Architecture="$target_arch" "$@" 93 set -- "$@" -o Dir="$TARGET"
94 set -- -o Apt::Default-Release="$target_release" "$@" 94 set -- "$@" -o Dir::State::Status="$TARGET"/var/lib/dpkg/status
95 set -- -o Dir="$TARGET" "$@"
96 set -- -o Dir::Cache="$TARGET"/var/cache/apt/ "$@"
97 set -- -o Dir::Etc::Parts="$TARGET"/etc/apt/apt.conf.d/ "$@"
98 set -- -o Dir::Etc::PreferencesParts="$TARGET"/etc/apt/preferences.d/ "$@"
99 set -- -o Dir::Etc="$TARGET"/etc/apt/ "$@"
100 set -- -o Dir::State="$TARGET"/var/lib/apt/ "$@"
101 set -- -o Dir::State::Status="$TARGET"/var/lib/dpkg/status "$@"
102 95
103 # We must also set dpkg to use the created system. 96 # We must also set dpkg to use the created system.
104 # Dpkg::options requires undocumented apt CLI magic. 97 # Dpkg::options requires undocumented apt CLI magic.
105 if [ "$DEBUG_DPKG" ]; then 98 if [ "$DEBUG_DPKG" ]; then
106 [ "$DEBUG_DPKG" -gt 0 ] 2>/dev/null || DEBUG_DPKG=10013 99 [ "$DEBUG_DPKG" -gt 0 ] 2>/dev/null || DEBUG_DPKG=10013
107 set -- -o DPkg::options::arg0=--debug="${DEBUG_DPKG}" "$@" 100 set -- "$@" -o DPkg::options::arg0=--debug="${DEBUG_DPKG}"
108 fi 101 fi
109 # This is the important one: 102 # This is the important one:
110 set -- -o DPkg::options::arg1=--root="$TARGET" "$@" 103 set -- "$@" -o DPkg::options::arg1=--root="$TARGET"
111 set -- -o DPkg::options::arg2=--force-unsafe-io "$@" 104 set -- "$@" -o DPkg::options::arg2=--force-unsafe-io
112 105
113 # Use the calling system for these. This is an optimization. 106 # Use the calling system for these. This is an optimization.
114 set -- -o Dir::Cache::archives=/var/cache/apt/archives "$@" 107 #set -- "$@" -o Dir::Etc::sourcelist=/etc/apt/sources.list
115 set -- -o Dir::Etc::Trusted=/etc/apt/trusted.gpg "$@" 108 #set -- "$@" -o Dir::Etc::sourceparts=/etc/apt/sources.list.d
116 set -- -o Dir::Etc::TrustedParts=/etc/apt/trusted.gpg.d "$@" 109 set -- "$@" -o Dir::Etc::Trusted=/etc/apt/trusted.gpg
117 set -- -o Dir::State::Lists=/var/lib/apt/lists "$@" 110 set -- "$@" -o Dir::Etc::TrustedParts=/etc/apt/trusted.gpg.d
111 set -- "$@" -o Dir::State::lists=/var/lib/apt/lists
112 set -- "$@" -o Dir::Cache::archives=/var/cache/apt/archives
118 113
119 # Avoid deleting lists on the calling system. 114 # Avoid deleting lists on the calling system.
120 set -- -o APT::Get::List-Cleanup=false "$@" 115 set -- "$@" -o APT::Get::List-Cleanup=false
121 116
122 apt-"${apt_cmd}" "$@" 117 apt-"${apt_cmd}" "$@"
123} 118}
@@ -194,6 +189,7 @@ populate_rootfs()
194 write_lines_once "$TARGET"/var/lib/dpkg/arch "$target_arch" 189 write_lines_once "$TARGET"/var/lib/dpkg/arch "$target_arch"
195 write_lines_once "$TARGET"/etc/apt/sources.list \ 190 write_lines_once "$TARGET"/etc/apt/sources.list \
196 "deb $debian_mirror $target_release main contrib non-free" \ 191 "deb $debian_mirror $target_release main contrib non-free" \
192 "deb http://httpredir.debian.org/debian ${target_release}-backports main contrib non-free" \
197 "deb http://security.debian.org $target_release/updates main contrib non-free" 193 "deb http://security.debian.org $target_release/updates main contrib non-free"
198 install_devices 194 install_devices
199} 195}