summaryrefslogtreecommitdiff
path: root/debootstrap.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2018-06-12 11:43:57 -0400
committerAndrew Cady <d@jerkface.net>2018-06-13 17:13:52 -0400
commit34dbe10ca8ab17dc6c250a5c547bd47584a8105c (patch)
tree0372f32dfefe1f5213958f3d59de3032ec03ade0 /debootstrap.sh
parent00d462edc151ac0c27c6c79aa63be5c5e2027223 (diff)
use selfstrap instead of deboostrap when possible
this isn't quite right since it uses ./src/selfstrap instead of PATH
Diffstat (limited to 'debootstrap.sh')
-rwxr-xr-xdebootstrap.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/debootstrap.sh b/debootstrap.sh
index 520be3b..2ce7e2c 100755
--- a/debootstrap.sh
+++ b/debootstrap.sh
@@ -239,6 +239,7 @@ init()
239 suite=$1 239 suite=$1
240 variant=minbase 240 variant=minbase
241 arch=$(dpkg-architecture -q DEB_HOST_ARCH) || die "command 'dpkg-architecture' failed" 241 arch=$(dpkg-architecture -q DEB_HOST_ARCH) || die "command 'dpkg-architecture' failed"
242 running_suite=$(lsb_release -cs) || die 'lsb_release failed'
242 243
243 size=1G # truncate(1) format 244 size=1G # truncate(1) format
244 245
@@ -257,8 +258,12 @@ init()
257 mount -t btrfs "$target".tmp "$target".mnt || die "mount failed" 258 mount -t btrfs "$target".tmp "$target".mnt || die "mount failed"
258 trap 'umount "$target.mnt"' EXIT 259 trap 'umount "$target.mnt"' EXIT
259 260
260 debootstrap_efficiently "$arch" "$variant" "$suite" \ 261 if [ "$suite" = "$running_suite" -a -x ./src/selfstrap ]; then
261 "$target".mnt "${target%.btrfs}".debs.txt || die "debootstrap failed" 262 ./src/selfstrap -t "$target.mnt"
263 else
264 debootstrap_efficiently "$arch" "$variant" "$suite" \
265 "$target".mnt "${target%.btrfs}".debs.txt || die "debootstrap failed"
266 fi
262 267
263 if umount "$target".mnt 268 if umount "$target".mnt
264 then trap - EXIT 269 then trap - EXIT