diff --git a/gentoostrap.sh b/gentoostrap.sh index afddc11..a0c7301 100755 --- a/gentoostrap.sh +++ b/gentoostrap.sh @@ -104,6 +104,8 @@ build-gentoo() { chmod 0600 "$file" done # We grab the checksums first to verify the integrity of any tarball leftover from a previous run + local shouldextract=1 + [ -f "$_optdest/bin/bash" ] && unset shouldextract log "Downloading stage3 signature" curl -s "$stage3.DIGESTS" -o "$stage3sig" if ! [ -f "$stage3file" ]; then @@ -117,8 +119,11 @@ build-gentoo() { if ! grep "$stage3sig" -e "$(sha512sum "$stage3file" | awk '{print $1}')" > /dev/null 2>&1; then error "stage3 checksum verification failed" 50 fi - log "Decompressing tarball; this will prompt for root privileges" - sudo tar xf "$stage3file" -C "$_optdest" + if [ -n "$shouldextract" ]; then + log "Decompressing tarball; this will prompt for root privileges" + sudo tar xf "$stage3file" -C "$_optdest" + fi + unset shouldextract # Now we do some pre-chroot configuration pushd "$_optdest" > /dev/null 2>&1