diff options
author | Andrew Cady <d@jerkface.net> | 2019-06-19 11:45:30 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2019-06-19 11:45:30 -0400 |
commit | bb47d2cd28aff26a054d3c10d4131dbe3ad476c6 (patch) | |
tree | 63970e9610e609aeb7b3bbfa6a5303f704ea3487 | |
parent | 2fc5bdad0b5b6d68392b41adfbf39bbbdec859e4 (diff) |
selfstrap
-rwxr-xr-x | src/selfstrap | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/selfstrap b/src/selfstrap index f379525..7f331e9 100755 --- a/src/selfstrap +++ b/src/selfstrap | |||
@@ -1,5 +1,6 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | debian_mirror=http://httpredir.debian.org/debian | 2 | debian_mirror=http://httpredir.debian.org/debian |
3 | debian_security_mirror=http://security.debian.org | ||
3 | EXTRA_PACKAGES='apt debian-archive-keyring locales' | 4 | EXTRA_PACKAGES='apt debian-archive-keyring locales' |
4 | 5 | ||
5 | die() { printf 'Error: %s\n' "$*"; exit 1; } | 6 | die() { printf 'Error: %s\n' "$*"; exit 1; } |
@@ -187,13 +188,21 @@ populate_rootfs() | |||
187 | [ -e "$TARGET/usr/bin/awk" -o -L "$TARGET/usr/bin/awk" ] || ln -s mawk "$TARGET/usr/bin/awk" | 188 | [ -e "$TARGET/usr/bin/awk" -o -L "$TARGET/usr/bin/awk" ] || ln -s mawk "$TARGET/usr/bin/awk" |
188 | 189 | ||
189 | write_lines_once "$TARGET"/var/lib/dpkg/arch "$target_arch" | 190 | write_lines_once "$TARGET"/var/lib/dpkg/arch "$target_arch" |
190 | write_lines_once "$TARGET"/etc/apt/sources.list \ | 191 | write_sources_list |
191 | "deb $debian_mirror $target_release main contrib non-free" \ | ||
192 | "deb http://httpredir.debian.org/debian ${target_release}-backports main contrib non-free" \ | ||
193 | "deb http://security.debian.org $target_release/updates main contrib non-free" | ||
194 | install_devices | 192 | install_devices |
195 | } | 193 | } |
196 | 194 | ||
195 | write_sources_list() | ||
196 | { | ||
197 | local dest="$TARGET"/etc/apt/sources.list | ||
198 | [ -e "$dest" ] && return | ||
199 | printf '%s\n' \ | ||
200 | "deb ${debian_mirror} ${target_release} main contrib non-free" \ | ||
201 | "deb ${debian_mirror} ${target_release}-backports main contrib non-free" \ | ||
202 | "deb ${debian_security_mirror} ${target_release}/updates main contrib non-free" | | ||
203 | column -t > "$dest" | ||
204 | } | ||
205 | |||
197 | parse_apt_simul_line() | 206 | parse_apt_simul_line() |
198 | { | 207 | { |
199 | set -- $* | 208 | set -- $* |