Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions androdeb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ source $spath/utils/banners
source $spath/utils/remote

# Set default vars
DISTRO=buster; ARCH=arm64
DISTRO=bullseye; ARCH=arm64
ADB="adb"
REMOTE="adb"
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 @@ -63,6 +64,8 @@ case $key in
--sshpass) SSHPASS="sshpass -p$2"; shift || true; shift || true; ;;
--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 @@ -237,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