Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
support mirror config
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed Jun 10, 2022
1 parent c855187 commit 099709b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion androdeb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FULL=0 # Default to a minimal install
DOWNLOAD=1 # Default to downloading from web
SKIP_DEVICE=0 # Skip device preparation
INSTALL_BCC=0 # Decide if BCC is to be installed
DEBIAN_URL=http://ftp.us.debian.org/debian/

# Default packages
PACKAGES=""
Expand Down Expand Up @@ -64,6 +65,7 @@ case $key in
--build-image) BI=1; BUILD_IMAGEF=$2; SKIP_DEVICE=1; DOWNLOAD=0; shift || true; shift || true; ;;
--debug) set -x; shift || true; ;;
--distro) DISTRO="$2"; shift || true; shift || true; ;;
--mirror) DEBIAN_URL="$2"; shift || true; shift || true; ;;
*) c_error "Unknown option ($1)"; usage; ;;
esac
done
Expand Down Expand Up @@ -238,7 +240,7 @@ ex_files=$(mktemp); echo $EXTRA_FILES > $ex_files

sudo $spath/buildstrap $ARCH $DISTRO $TDIR $OUT_TMP \
"$(make_csv "$PACKAGES")"\
$ex_files $INSTALL_BCC $SKIP_DEVICE
$ex_files $INSTALL_BCC $SKIP_DEVICE $DEBIAN_URL
rm $ex_files

# If we only wanted to prepare a rootfs and don't have
Expand Down
3 changes: 2 additions & 1 deletion buildstrap
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ EXTRA_FILES="$(cat $6)"
INSTALL_BCC=$7
SKIP_DEVICE=$8 # Skip any device-specific stages
VARIANT="--variant=minbase"
REPO_URL=$9

time qemu-debootstrap --arch $ARCH --include=$PACKAGES $VARIANT \
$DISTRO $OUT_TMP http://ftp.us.debian.org/debian/
$DISTRO $OUT_TMP $REPO_URL

# Some reason debootstrap leaves these mounted
umount $OUT_TMP/proc/sys/fs/binfmt_misc || true
Expand Down
2 changes: 2 additions & 0 deletions utils/banners
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ usage() {
c_info ""
c_info " --build-image Build an ext4 .img with the base image and BCC (useful for Qemu)"
c_info ""
c_info " --mirror Specific the mirror for downloading debian images"
c_info ""
c_info " ** Folowing are misc build options **"
c_info " --tempdir Use a specific temporary directory for build operation"
c_info " --arch Specify an ARCH to build for (default arm64)"
Expand Down

0 comments on commit 099709b

Please sign in to comment.